Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00041 #ifndef HAL_NRF_H__
00042 #define HAL_NRF_H__
00043
00044 #include <stdint.h>
00045 #include <stdbool.h>
00046
00047 #include "hal_nrf_reg.h"
00048 #include "hal_nrf_hw.h"
00049
00052
00053
00064 void hal_nrf_set_irq_mode(hal_nrf_irq_source_t int_source, bool irq_state);
00065
00066
00067
00068
00069
00070 void hal_nrf_activate_features(void);
00071
00075 void hal_nrf_enable_dynamic_payload(bool enable);
00076
00080 void hal_nrf_enable_ack_payload(bool enable);
00081
00085 void hal_nrf_enable_dynamic_ack(bool enable);
00086
00093 void hal_nrf_setup_dynamic_payload(uint8_t setup);
00094
00098 uint8_t hal_nrf_read_rx_payload_width(void);
00099
00106 void hal_nrf_write_ack_payload(uint8_t pipe, const uint8_t *tx_pload, uint8_t length);
00107
00117 uint8_t hal_nrf_get_clear_irq_flags(void);
00118
00119 uint8_t hal_nrf_clear_irq_flags_get_status(void);
00120
00127 void hal_nrf_clear_irq_flag(hal_nrf_irq_source_t int_source);
00128
00134 void hal_nrf_set_crc_mode(hal_nrf_crc_mode_t crc_mode);
00135
00144 void hal_nrf_open_pipe(hal_nrf_address_t pipe_num, bool auto_ack);
00145
00151 void hal_nrf_close_pipe(hal_nrf_address_t pipe_num);
00152
00160 void hal_nrf_set_address(const hal_nrf_address_t address, const uint8_t *addr);
00161
00173 uint8_t hal_nrf_get_address (uint8_t address, uint8_t *addr);
00174
00182 void hal_nrf_set_auto_retr(uint8_t retr, uint16_t delay);
00183
00190 void hal_nrf_set_address_width(hal_nrf_address_width_t address_width);
00191
00196 uint8_t hal_nrf_get_address_width (void);
00197
00205 void hal_nrf_set_rx_payload_width(uint8_t pipe_num, uint8_t pload_width);
00206
00217 bool hal_nrf_get_irq_mode(uint8_t int_source);
00218
00229 uint8_t hal_nrf_get_irq_flags(void);
00230
00241 uint8_t hal_nrf_get_pipe_status(uint8_t pipe_num);
00242
00252 uint8_t hal_nrf_get_auto_retr_status(void);
00253
00259 uint8_t hal_nrf_get_packet_lost_ctr(void);
00260
00269 uint8_t hal_nrf_get_rx_payload_width(uint8_t pipe_num);
00271
00274
00275
00282 void hal_nrf_set_operation_mode(hal_nrf_operation_mode_t op_mode);
00283
00289 void hal_nrf_set_power_mode(hal_nrf_pwr_mode_t pwr_mode);
00290
00296 void hal_nrf_set_rf_channel(uint8_t channel);
00297
00303 void hal_nrf_set_output_power(hal_nrf_output_power_t power);
00304
00311 void hal_nrf_set_datarate(hal_nrf_datarate_t datarate);
00312
00313
00314
00315
00326 uint8_t hal_nrf_get_tx_fifo_status(void);
00327
00337 bool hal_nrf_tx_fifo_empty(void);
00338
00348 bool hal_nrf_tx_fifo_full(void);
00349
00360 uint8_t hal_nrf_get_rx_fifo_status(void);
00361
00362 uint8_t hal_nrf_get_fifo_status(void);
00363
00375 bool hal_nrf_rx_fifo_empty(void);
00376
00386 bool hal_nrf_rx_fifo_full(void);
00387
00394 uint8_t hal_nrf_get_transmit_attempts(void);
00395
00405 bool hal_nrf_get_carrier_detect(void);
00406
00407
00408
00415 uint8_t hal_nrf_get_rx_data_source(void);
00416
00424 uint16_t hal_nrf_read_rx_payload(uint8_t *rx_pload);
00425
00434 void hal_nrf_write_tx_payload(const uint8_t *tx_pload, uint8_t length);
00435
00447 void hal_nrf_write_tx_payload_noack(const uint8_t *tx_pload, uint8_t length);
00448
00454 void hal_nrf_reuse_tx(void);
00455
00464 bool hal_nrf_get_reuse_tx_status(void);
00465
00471 void hal_nrf_flush_rx(void);
00472
00478 void hal_nrf_flush_tx(void);
00479
00486 uint8_t hal_nrf_nop(void);
00488
00491
00492
00499 void hal_nrf_set_pll_mode(bool pll_lock);
00500
00507 void hal_nrf_set_lna_gain(bool lna_gain);
00508
00514 void hal_nrf_enable_continious_wave (bool enable);
00515
00516
00517
00519
00522
00531 uint8_t hal_nrf_rw(uint8_t value);
00533 #endif // HAL_NRF_H__
00534