59 #define SUPPORTED_PART_NUMBER ( 2 )
60 #define RF230_REVA ( 1 )
61 #define RF230_REVB ( 2 )
62 #define SUPPORTED_MANUFACTURER_ID ( 31 )
63 #define RF230_SUPPORTED_INTERRUPT_MASK ( 0x0C )
65 #define RF230_MIN_CHANNEL ( 11 )
66 #define RF230_MAX_CHANNEL ( 26 )
67 #define RF230_MIN_ED_THRESHOLD ( 0 )
68 #define RF230_MAX_ED_THRESHOLD ( 15 )
69 #define RF230_MAX_TX_FRAME_LENGTH ( 127 )
71 #define TX_PWR_3DBM ( 0 )
72 #define TX_PWR_17_2DBM ( 15 )
74 #define BATTERY_MONITOR_HIGHEST_VOLTAGE ( 15 )
75 #define BATTERY_MONITOR_VOLTAGE_UNDER_THRESHOLD ( 0 )
76 #define BATTERY_MONITOR_HIGH_VOLTAGE ( 1 )
77 #define BATTERY_MONITOR_LOW_VOLTAGE ( 0 )
79 #define FTN_CALIBRATION_DONE ( 0 )
80 #define PLL_DCU_CALIBRATION_DONE ( 0 )
81 #define PLL_CF_CALIBRATION_DONE ( 0 )
83 #define RC_OSC_REFERENCE_COUNT_MAX (1.005*F_CPU*31250UL/8000000UL)
84 #define RC_OSC_REFERENCE_COUNT_MIN (0.995*F_CPU*31250UL/8000000UL)
96 #define RADIO_STATUS_START_VALUE ( 0x40 )
128 #define TRAC_SUCCESS 0
129 #define TRAC_SUCCESS_DATA_PENDING 1
130 #define TRAC_SUCCESS_WAIT_FOR_ACK 2
131 #define TRAC_CHANNEL_ACCESS_FAILURE 3
132 #define TRAC_NO_ACK 5
133 #define TRAC_INVALID 7
164 typedef void (*radio_rx_callback) (uint16_t data);
165 extern uint8_t rxMode;
170 radio_rx_callback rx_callback);
171 uint8_t radio_get_saved_rssi_value(
void);
214 uint8_t * radio_frame_data(
void);
215 uint8_t radio_frame_length(
void);
216 #define delay_us( us ) ( _delay_loop_2( ( F_CPU / 4000000UL ) * ( us ) ) )
The requested service timed out.
radio_status_t radio_batmon_configure(bool range, uint8_t voltage_threshold)
This function is used to configure the battery monitor module.
radio_status_t radio_set_clock_speed(bool direct, uint8_t clock_speed)
This function changes the prescaler on the CLKM pin.
radio_status_t radio_configure_csma(uint8_t seed0, uint8_t be_csma_seed1)
This function will configure the CSMA algorithm used by the radio transceiver when transmitting data ...
Measured battery voltage is lower than voltage threshold.
uint8_t radio_batmon_get_voltage_threshold(void)
This function returns the current threshold volatge used by the battery monitor (BATMON_VTH).
radio_status_t radio_get_rssi_value(uint8_t *rssi)
This function returns the Received Signal Strength Indication.
radio_status_t radio_send_data(uint8_t data_length, uint8_t *data)
This function will download a frame to the radio transceiver's transmit buffer and send it...
radio_status_t radio_set_tx_power_level(uint8_t power_level)
This function will change the output power level.
uint8_t radio_get_device_role(void)
This function will read the I_AM_COORD sub register.
radio_status_t radio_calibrate_filter(void)
This function calibrates the Single Side Band Filter.
Channel is clear, available to transmit a new frame.
void calibrate_rc_osc_32k(void)
Calibrate the internal RC oscillator.
uint8_t radio_get_tx_power_level(void)
This function will read and return the output power level.
The connected device is not an Atmel AT86RF230.
uint8_t radio_get_ed_threshold(void)
This function returns the current ED threshold used by the CCA algorithm.
void radio_use_auto_tx_crc(bool auto_crc_on)
This function will enable or disable automatic CRC during frame transmission.
This file contains low-level radio driver code.
#define RADIO_STATUS_START_VALUE
This macro defines the start value for the RADIO_* status constants.
uint8_t radio_get_operating_channel(void)
This function will return the channel used by the radio transceiver.
bool calibrate_rc_osc_clkm(void)
Calibrate the internal RC oscillator.
uint8_t radio_get_clock_speed(void)
This function returns the current clock setting for the CLKM pin.
The requested state transition could not be completed.
radio_status_t radio_leave_sleep_mode(void)
This function will take the radio transceiver from sleep mode and put it into the TRX_OFF state...
void radio_get_extended_address(uint8_t *extended_address)
This function will read the extended address used by the address filter.
uint8_t radio_get_trx_state(void)
This function return the Radio Transceivers current state.
void(* hal_trx_end_isr_event_handler_t)(uint32_t const isr_timestamp)
RRX_END event handler callback type.
uint16_t radio_get_pan_id(void)
This function will return the PANID used by the address filter.
This file contains the register definitions for the AT86RF230.
radio_status_t radio_set_cca_mode(uint8_t mode, uint8_t ed_threshold)
This function will configure the Clear Channel Assessment algorithm.
The end-user tried to do an invalid state transition.
uint16_t radio_get_short_address(void)
This function will return the current short address used by the address filter.
Use a combination of both energy detection and carrier sense.
No acknowledge frame was received.
radio_status_t radio_init(bool cal_rc_osc, hal_rx_start_isr_event_handler_t rx_event, hal_trx_end_isr_event_handler_t trx_end_event, radio_rx_callback rx_callback)
Initialize the Transceiver Access Toolbox and lower layers.
Transceiver is busy receiving or transmitting data.
uint8_t radio_get_cca_mode(void)
This function returns the current CCA mode used.
radio_status_t radio_calibrate_pll(void)
This function calibrates the PLL.
radio_status_t
This enumeration defines the possible return values for the TAT API functions.
radio_status_t radio_set_operating_channel(uint8_t channel)
This function will change the operating channel.
The requested service was performed successfully.
The radio transceiver is busy receiving or transmitting.
void radio_set_pan_id(uint16_t new_pan_id)
This function will set the PANID used by the address filter.
void radio_set_device_role(bool i_am_coordinator)
This function will set the I_AM_COORD sub register.
void radio_set_extended_address(uint8_t *extended_address)
This function will set a new extended address to be used by the address filter.
radio_status_t radio_enter_sleep_mode(void)
This function will put the radio transceiver to sleep.
radio_clkm_speed_t
This enumeration defines the possible CLKM speeds.
void radio_set_short_address(uint16_t new_short_address)
This function will set the short address used by the address filter.
The CRC failed for the actual frame.
radio_cca_mode_t
This enumeration defines the possible modes available for the Clear Channel Assessment algorithm...
One or more of the supplied function arguments are invalid.
uint8_t radio_batmon_get_voltage_range(void)
This function returns if high or low voltage range is used.
The channel access failed during the auto mode.
radio_status_t radio_set_trx_state(uint8_t new_state)
This function will change the current state of the radio transceiver's internal state machine...
Use energy detection above threshold mode.
void radio_reset_state_machine(void)
This function will reset the state machine (to TRX_OFF) from any of its states, except for the SLEEP ...
void(* hal_rx_start_isr_event_handler_t)(uint32_t const isr_timestamp, uint8_t const frame_length)
RX_START event handler callback type.
void radio_reset_trx(void)
This function will reset all the registers and the state machine of the radio transceiver.
Measured battery voltage is above the voltage threshold.
radio_status_t radio_batmon_get_status(void)
This function returns the status of the Battery Monitor module.