• Main Page
  • Modules
  • Index
  • File List
  • Globals

hal/nrf24l01p/hal_nrf.h

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT.
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *
00011  * $LastChangedRevision: 2513 $
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 /* Setup function prototypes */
00053 
00064 void hal_nrf_set_irq_mode(hal_nrf_irq_source_t int_source, bool irq_state);
00065 
00066 /* For the obsolete nRF24L01 it is necessary to issue an activate command before the
00067  * features enabled by the FEATURE register can be used. For nRF24L01+ these features
00068  * are by default enabled.
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 /* Operation function prototypes */
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 /* Status functions prototypes */
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 /* Data operation prototypes */
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 /* Test functions prototypes */
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 /* hal_nrf_l01 basic functions, used by all the other functions */
00517 
00519 
00522 
00531 uint8_t hal_nrf_rw(uint8_t value);
00533 #endif // HAL_NRF_H__
00534 

Generated on Fri Apr 20 2012 14:11:44 for nRFGo SDK by  doxygen 1.7.2