| LibDriver NRF24L01 1.0.0 NRF24L01 full function driver

driver_nrf24l01_interface_template.c
Go to the documentation of this file.
1
37 #include "driver_nrf24l01_interface.h"
38
46 uint8_t nrf24l01_interface_spi_init(void)
47 {
48 return 0;
49 }
50
58 uint8_t nrf24l01_interface_spi_deinit(void)
59 {
60 return 0;
61 }
62
73 uint8_t nrf24l01_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
74 {
75 return 0;
76 }
77
88 uint8_t nrf24l01_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
89 {
90 return 0;
91 }
92
100 uint8_t nrf24l01_interface_gpio_init(void)
101 {
102 return 0;
103 }
104
112 uint8_t nrf24l01_interface_gpio_deinit(void)
113 {
114 return 0;
115 }
116
125 uint8_t nrf24l01_interface_gpio_write(uint8_t data)
126 {
127 return 0;
128 }
129
135 void nrf24l01_interface_delay_ms(uint32_t ms)
136 {
137
138 }
139
145 void nrf24l01_interface_debug_print(const char *const fmt, ...)
146 {
147
148 }
149
158 void nrf24l01_interface_receive_callback(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len)
159 {
160 switch (type)
161 {
162 case NRF24L01_INTERRUPT_RX_DR :
163 {
164 uint8_t i;
165
166 nrf24l01_interface_debug_print("nrf24l01: irq receive with pipe %d with %d.\n", num, len);
167 for (i = 0; i < len; i++)
168 {
169 nrf24l01_interface_debug_print("0x%02X ", buf[i]);
170 }
171 nrf24l01_interface_debug_print(".\n");
172
173 break;
174 }
175 case NRF24L01_INTERRUPT_TX_DS :
176 {
177 nrf24l01_interface_debug_print("nrf24l01: irq send ok.\n");
178
179 break;
180 }
181 case NRF24L01_INTERRUPT_MAX_RT :
182 {
183 nrf24l01_interface_debug_print("nrf24l01: irq reach max retry times.\n");
184
185 break;
186 }
187 case NRF24L01_INTERRUPT_TX_FULL :
188 {
189 nrf24l01_interface_debug_print("nrf24l01: irq tx full.\n");
190
191 break;
192 }
193 default :
194 {
195 nrf24l01_interface_debug_print("nrf24l01: unknown code.\n");
196
197 break;
198 }
199 }
200 }
driver_nrf24l01_interface.h
driver nrf24l01 interface header file
NRF24L01_INTERRUPT_TX_DS
@ NRF24L01_INTERRUPT_TX_DS
Definition: driver_nrf24l01.h:141
NRF24L01_INTERRUPT_MAX_RT
@ NRF24L01_INTERRUPT_MAX_RT
Definition: driver_nrf24l01.h:142
NRF24L01_INTERRUPT_RX_DR
@ NRF24L01_INTERRUPT_RX_DR
Definition: driver_nrf24l01.h:140
NRF24L01_INTERRUPT_TX_FULL
@ NRF24L01_INTERRUPT_TX_FULL
Definition: driver_nrf24l01.h:143
nrf24l01_interface_spi_read
uint8_t nrf24l01_interface_spi_read(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus read
Definition: driver_nrf24l01_interface_template.c:73
nrf24l01_interface_spi_deinit
uint8_t nrf24l01_interface_spi_deinit(void)
interface spi bus deinit
Definition: driver_nrf24l01_interface_template.c:58
nrf24l01_interface_delay_ms
void nrf24l01_interface_delay_ms(uint32_t ms)
interface delay ms
Definition: driver_nrf24l01_interface_template.c:135
nrf24l01_interface_receive_callback
void nrf24l01_interface_receive_callback(uint8_t type, uint8_t num, uint8_t *buf, uint8_t len)
interface receive callback
Definition: driver_nrf24l01_interface_template.c:158
nrf24l01_interface_debug_print
void nrf24l01_interface_debug_print(const char *const fmt,...)
interface print format data
Definition: driver_nrf24l01_interface_template.c:145
nrf24l01_interface_gpio_deinit
uint8_t nrf24l01_interface_gpio_deinit(void)
interface gpio deinit
Definition: driver_nrf24l01_interface_template.c:112
nrf24l01_interface_gpio_init
uint8_t nrf24l01_interface_gpio_init(void)
interface gpio init
Definition: driver_nrf24l01_interface_template.c:100
nrf24l01_interface_spi_init
uint8_t nrf24l01_interface_spi_init(void)
interface spi bus init
Definition: driver_nrf24l01_interface_template.c:46
nrf24l01_interface_spi_write
uint8_t nrf24l01_interface_spi_write(uint8_t reg, uint8_t *buf, uint16_t len)
interface spi bus write
Definition: driver_nrf24l01_interface_template.c:88
nrf24l01_interface_gpio_write
uint8_t nrf24l01_interface_gpio_write(uint8_t data)
interface gpio write
Definition: driver_nrf24l01_interface_template.c:125