nrf24L01  1.0
nrf24L01 library
 All Files Functions Variables Typedefs Enumerations Enumerator Macros
nrf24spiXM2.h
Go to the documentation of this file.
1 
30 #ifndef __nrf24spiXM2_H__
31 #define __nrf24spiXM2_H__
32 
33 #ifndef F_CPU
34 #define F_CPU 32000000UL
35 #endif
36 
37 #include <avr/io.h>
38 #include <util/delay.h>
39 
40 #define NRF_SELECT 0
41 #define NRF_DESELECT 1
42 #define NRF_ENABLE 1
43 #define NRF_DISABLE 0
44 
45 void nrfspiInit(void);
46 uint8_t nrfspiTransfer(uint8_t iData);
47 
55 inline void nrfCSn(uint8_t bSelected)
56 {
57  if (bSelected == NRF_DESELECT) PORTF.OUTSET = PIN5_bm;
58  else if (bSelected == NRF_SELECT) PORTF.OUTCLR = PIN5_bm;
59 }
60 
71 inline void nrfCE(uint8_t bEnabled)
72 {
73  if (bEnabled == NRF_ENABLE) PORTF.OUTSET = PIN7_bm;
74  else if (bEnabled == NRF_DISABLE) PORTF.OUTCLR = PIN7_bm;
75 }
76 
77 #endif
#define NRF_SELECT
Spi slave selected.
Definition: nrf24spiXM2.h:40
void nrfspiInit(void)
Initialization of SPI.
Definition: nrf24spiXM2.c:36
void nrfCE(uint8_t bEnabled)
Set chip enable.
Definition: nrf24spiXM2.h:71
#define NRF_DESELECT
Spi slave deselected.
Definition: nrf24spiXM2.h:41
#define NRF_ENABLE
NRF chip enable.
Definition: nrf24spiXM2.h:42
uint8_t nrfspiTransfer(uint8_t iData)
SPI transfer.
Definition: nrf24spiXM2.c:64
void nrfCSn(uint8_t bSelected)
Set chip select.
Definition: nrf24spiXM2.h:55
#define NRF_DISABLE
NRF chip disable.
Definition: nrf24spiXM2.h:43