55 #include "driverlib/rf_common_cmd.h" 60 #define RF_CORE_FRONT_END_MODE_DIFFERENTIAL 0 61 #define RF_CORE_FRONT_END_MODE_SINGLE_RFP 1 62 #define RF_CORE_FRONT_END_MODE_SINGLE_RFN 2 64 #define RF_CORE_BIAS_MODE_INTERNAL 0 65 #define RF_CORE_BIAS_MODE_EXTERNAL 1 71 #ifdef RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE 72 #define RF_CORE_RADIO_SETUP_FRONT_END_MODE RF_CORE_CONF_RADIO_SETUP_FRONT_END_MODE 74 #define RF_CORE_RADIO_SETUP_FRONT_END_MODE RF_CORE_FRONT_END_MODE_DIFFERENTIAL 77 #ifdef RF_CORE_CONF_RADIO_SETUP_BIAS_MODE 78 #define RF_CORE_RADIO_SETUP_BIAS_MODE RF_CORE_CONF_RADIO_SETUP_BIAS_MODE 80 #define RF_CORE_RADIO_SETUP_BIAS_MODE RF_CORE_BIAS_MODE_INTERNAL 87 #ifdef RF_CORE_CONF_PROP_FRONT_END_MODE 88 #define RF_CORE_PROP_FRONT_END_MODE RF_CORE_CONF_PROP_FRONT_END_MODE 90 #define RF_CORE_PROP_FRONT_END_MODE RF_CORE_FRONT_END_MODE_DIFFERENTIAL 93 #ifdef RF_CORE_CONF_PROP_BIAS_MODE 94 #define RF_CORE_PROP_BIAS_MODE RF_CORE_CONF_PROP_BIAS_MODE 96 #define RF_CORE_PROP_BIAS_MODE RF_CORE_BIAS_MODE_EXTERNAL 99 #define RF_CORE_CMD_ERROR 0 100 #define RF_CORE_CMD_OK 1 139 #define RF_CORE_CMDSTA_PENDING 0x00 140 #define RF_CORE_CMDSTA_DONE 0x01 141 #define RF_CORE_CMDSTA_ILLEGAL_PTR 0x81 142 #define RF_CORE_CMDSTA_UNKNOWN_CMD 0x82 143 #define RF_CORE_CMDSTA_UNKNOWN_DIR_CMD 0x83 144 #define RF_CORE_CMDSTA_CONTEXT_ERR 0x85 145 #define RF_CORE_CMDSTA_SCHEDULING_ERR 0x86 146 #define RF_CORE_CMDSTA_PAR_ERR 0x87 147 #define RF_CORE_CMDSTA_QUEUE_ERR 0x88 148 #define RF_CORE_CMDSTA_QUEUE_BUSY 0x89 151 #define RF_CORE_CMDSTA_ERR_MASK 0x80 154 #define RF_CORE_CMDSTA_RESULT_MASK 0xFF 156 #define RF_CORE_RADIO_OP_STATUS_IDLE 0x0000 158 #define RF_CORE_NOT_ACCESSIBLE 0x00 159 #define RF_CORE_ACCESSIBLE 0x01 162 #define RF_CORE_RADIO_OP_STATUS_IDLE 0x0000 163 #define RF_CORE_RADIO_OP_STATUS_PENDING 0x0001 164 #define RF_CORE_RADIO_OP_STATUS_ACTIVE 0x0002 165 #define RF_CORE_RADIO_OP_STATUS_SKIPPED 0x0003 166 #define RF_CORE_RADIO_OP_STATUS_DONE_OK 0x0400 167 #define RF_CORE_RADIO_OP_STATUS_DONE_COUNTDOWN 0x0401 168 #define RF_CORE_RADIO_OP_STATUS_DONE_RXERR 0x0402 169 #define RF_CORE_RADIO_OP_STATUS_DONE_TIMEOUT 0x0403 170 #define RF_CORE_RADIO_OP_STATUS_DONE_STOPPED 0x0404 171 #define RF_CORE_RADIO_OP_STATUS_DONE_ABORT 0x0405 172 #define RF_CORE_RADIO_OP_STATUS_ERROR_PAST_START 0x0800 173 #define RF_CORE_RADIO_OP_STATUS_ERROR_START_TRIG 0x0801 174 #define RF_CORE_RADIO_OP_STATUS_ERROR_CONDITION 0x0802 175 #define RF_CORE_RADIO_OP_STATUS_ERROR_PAR 0x0803 176 #define RF_CORE_RADIO_OP_STATUS_ERROR_POINTER 0x0804 177 #define RF_CORE_RADIO_OP_STATUS_ERROR_CMDID 0x0805 178 #define RF_CORE_RADIO_OP_STATUS_ERROR_NO_SETUP 0x0807 179 #define RF_CORE_RADIO_OP_STATUS_ERROR_NO_FS 0x0808 180 #define RF_CORE_RADIO_OP_STATUS_ERROR_SYNTH_PROG 0x0809 183 #define RF_CORE_RADIO_OP_STATUS_IEEE_SUSPENDED 0x2001 184 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_OK 0x2400 185 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_BUSY 0x2401 186 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_STOPPED 0x2402 187 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_ACK 0x2403 188 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_ACKPEND 0x2404 189 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_TIMEOUT 0x2405 190 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_BGEND 0x2406 191 #define RF_CORE_RADIO_OP_STATUS_IEEE_DONE_ABORT 0x2407 192 #define RF_CORE_RADIO_OP_STATUS_ERROR_WRONG_BG 0x0806 193 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_PAR 0x2800 194 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_NO_SETUP 0x2801 195 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_NO_FS 0x2802 196 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_SYNTH_PROG 0x2803 197 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_RXOVF 0x2804 198 #define RF_CORE_RADIO_OP_STATUS_IEEE_ERROR_TXUNF 0x2805 201 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_OK 0x1400 202 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_RXTIMEOUT 0x1401 203 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_NOSYNC 0x1402 204 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_RXERR 0x1403 205 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_CONNECT 0x1404 206 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_MAXNACK 0x1405 207 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_ENDED 0x1406 208 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_ABORT 0x1407 209 #define RF_CORE_RADIO_OP_STATUS_BLE_DONE_STOPPED 0x1408 210 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_PAR 0x1800 211 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_RXBUF 0x1801 212 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_NO_SETUP 0x1802 213 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_NO_FS 0x1803 214 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_SYNTH_PROG 0x1804 215 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_RXOVF 0x1805 216 #define RF_CORE_RADIO_OP_STATUS_BLE_ERROR_TXUNF 0x1806 219 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_OK 0x3400 220 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_RXTIMEOUT 0x3401 221 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_BREAK 0x3402 222 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_ENDED 0x3403 223 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_STOPPED 0x3404 224 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_ABORT 0x3405 225 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_RXERR 0x3406 226 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_IDLE 0x3407 227 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_BUSY 0x3408 228 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_IDLETIMEOUT 0x3409 229 #define RF_CORE_RADIO_OP_STATUS_PROP_DONE_BUSYTIMEOUT 0x340A 230 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_PAR 0x3800 231 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_RXBUF 0x3801 232 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_RXFULL 0x3802 233 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_NO_SETUP 0x3803 234 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_NO_FS 0x3804 235 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_RXOVF 0x3805 236 #define RF_CORE_RADIO_OP_STATUS_PROP_ERROR_TXUNF 0x3806 239 #define RF_CORE_RADIO_OP_STATUS_PROTO_MASK 0xF000 240 #define RF_CORE_RADIO_OP_STATUS_PROTO_GENERIC 0x0000 241 #define RF_CORE_RADIO_OP_STATUS_PROTO_BLE 0x1000 242 #define RF_CORE_RADIO_OP_STATUS_PROTO_IEEE 0x2000 243 #define RF_CORE_RADIO_OP_STATUS_PROTO_PROP 0x3000 246 #define RF_CORE_RADIO_OP_MASKED_STATUS 0x0C00 247 #define RF_CORE_RADIO_OP_MASKED_STATUS_RUNNING 0x0000 248 #define RF_CORE_RADIO_OP_MASKED_STATUS_DONE 0x0400 249 #define RF_CORE_RADIO_OP_MASKED_STATUS_ERROR 0x0800 252 #define RF_CORE_COMMAND_TYPE_MASK 0x0C00 253 #define RF_CORE_COMMAND_TYPE_RADIO_OP 0x0800 254 #define RF_CORE_COMMAND_TYPE_IEEE_BG_RADIO_OP 0x0800 255 #define RF_CORE_COMMAND_TYPE_IEEE_FG_RADIO_OP 0x0C00 257 #define RF_CORE_COMMAND_PROTOCOL_MASK 0x3000 258 #define RF_CORE_COMMAND_PROTOCOL_COMMON 0x0000 259 #define RF_CORE_COMMAND_PROTOCOL_BLE 0x1000 260 #define RF_CORE_COMMAND_PROTOCOL_IEEE 0x2000 261 #define RF_CORE_COMMAND_PROTOCOL_PROP 0x3000 264 #define RATCNT 0x00000004 267 extern volatile bool rx_is_full;
void rf_core_setup_interrupts(bool poll_mode)
Setup RF core interrupts.
rfc_radioOp_t * rf_core_get_last_radio_op()
Returns a pointer to the most recent proto-dependent Radio Op.
struct rf_core_primary_mode_s rf_core_primary_mode_t
A data strcuture representing the radio's primary mode of operation.
int rf_core_power_up()
Turn on power to the RFC and boot it.
void rf_core_power_down()
Disable RFCORE clock domain in the MCU VD and turn off the RFCORE PD.
uint8_t rf_core_set_modesel()
Initialise RF APIs in the RF core.
void rf_core_primary_mode_abort()
Abort the currently running primary radio op.
void rf_core_primary_mode_register(const rf_core_primary_mode_t *mode)
Register a primary mode for radio operation.
void rf_core_cmd_done_dis(bool poll_mode)
Disable the LAST_CMD_DONE and LAST_FG_CMD_DONE interrupts.
A data strcuture representing the radio's primary mode of operation.
#define PROCESS_NAME(name)
Declare the name of a process.
uint8_t(* restore)(void)
A pointer to a function that will restore the previous radio op.
void rf_core_init_radio_op(rfc_radioOp_t *op, uint16_t len, uint16_t command)
Prepare a buffer to host a Radio Op.
uint8_t rf_core_primary_mode_restore()
Abort the currently running primary radio op.
uint8_t rf_core_is_accessible()
Check whether the RF core is accessible.
void(* abort)(void)
A pointer to a function used to abort the current radio op.
uint_fast8_t rf_core_send_cmd(uint32_t cmd, uint32_t *status)
Sends a command to the RF core.
void rf_core_cmd_done_en(bool fg, bool poll_mode)
Enable interrupt on command done.
uint8_t rf_core_start_rat(void)
Start the CM0 RAT.
uint8_t rf_core_restart_rat(void)
Restart the CM0 RAT.
uint8_t rf_core_boot()
Boot the RF Core.
uint8_t rf_core_stop_rat(void)
Stop the CM0 RAT synchronously.
uint_fast8_t rf_core_wait_cmd_done(void *cmd)
Block and wait for a Radio op to complete.