57 #if defined(__AVR_ATmega128RFA1__)
65 #define SUPPORTED_PART_NUMBER ( 2 )
66 #define RF230_REVA ( 1 )
67 #define RF230_REVB ( 2 )
68 #define SUPPORTED_MANUFACTURER_ID ( 31 )
72 #if defined(__AVR_ATmega128RFA1__)
73 #define RF230_SUPPORTED_INTERRUPT_MASK ( 0xFF )
75 #define RF230_SUPPORTED_INTERRUPT_MASK ( 0x0F )
78 #define RF230_MIN_CHANNEL ( 11 )
79 #define RF230_MAX_CHANNEL ( 26 )
80 #define RF230_MIN_ED_THRESHOLD ( 0 )
81 #define RF230_MAX_ED_THRESHOLD ( 15 )
82 #define RF230_MAX_TX_FRAME_LENGTH ( 127 )
85 #define TX_PWR_3DBM ( 0 )
86 #define TX_PWR_17_2DBM ( 15 )
88 #define TX_PWR_MAX TX_PWR_3DBM
89 #define TX_PWR_MIN TX_PWR_17_2DBM
90 #define TX_PWR_UNDEFINED (TX_PWR_MIN+1)
93 #define BATTERY_MONITOR_HIGHEST_VOLTAGE ( 15 )
94 #define BATTERY_MONITOR_VOLTAGE_UNDER_THRESHOLD ( 0 )
95 #define BATTERY_MONITOR_HIGH_VOLTAGE ( 1 )
96 #define BATTERY_MONITOR_LOW_VOLTAGE ( 0 )
98 #define FTN_CALIBRATION_DONE ( 0 )
99 #define PLL_DCU_CALIBRATION_DONE ( 0 )
100 #define PLL_CF_CALIBRATION_DONE ( 0 )
102 #define RC_OSC_REFERENCE_COUNT_MAX (1.005*F_CPU*31250UL/8000000UL)
103 #define RC_OSC_REFERENCE_COUNT_MIN (0.995*F_CPU*31250UL/8000000UL)
106 #define RF_CHANNEL 26
119 #define RADIO_STATUS_START_VALUE ( 0x40 )
151 #define TRAC_SUCCESS 0
152 #define TRAC_SUCCESS_DATA_PENDING 1
153 #define TRAC_SUCCESS_WAIT_FOR_ACK 2
154 #define TRAC_CHANNEL_ACCESS_FAILURE 3
155 #define TRAC_NO_ACK 5
156 #define TRAC_INVALID 7
188 typedef void (*radio_rx_callback) (uint16_t data);
208 int rf230_init(
void);
209 void rf230_warm_reset(
void);
210 void rf230_start_sneeze(
void);
213 void rf230_set_channel(uint8_t channel);
214 void rf230_listen_channel(uint8_t channel);
215 uint8_t rf230_get_channel(
void);
216 void rf230_set_pan_addr(
unsigned pan,
unsigned addr,
const uint8_t ieee_addr[8]);
217 void rf230_set_txpower(uint8_t power);
218 uint8_t rf230_get_txpower(
void);
220 void rf230_set_promiscuous_mode(
bool isPromiscuous);
221 bool rf230_is_ready_to_send();
223 extern uint8_t rf230_last_correlation,rf230_last_rssi,rf230_smallest_rssi;
225 uint8_t rf230_get_raw_rssi(
void);
227 #define rf230_rssi rf230_get_raw_rssi