42 #include "aducrf101-include.h"
45 #define RIE_ENGINE_MAJOR_VERSION 1UL
46 #define RIE_ENGINE_MINOR_VERSION 0UL
49 #define RADIO_SPI_CLK_FREQ 4000000 // 4 MHz SPI CLK for radio interface
50 #define SYSTEM_UCLK 16000000 // 16 MHz UCLK
52 #define DEFAULT_CHNL_FREQ 915000000
53 #define FREQ_CNVRT_VAL 0.00252061538
55 #define PACKETRAM_START 0x10
56 #define PACKETRAM_LEN 240
57 #define BBRAM_START 0x100
58 #define PR_var_tx_mode_ADR 0x00D
61 #define PARAM_TX_NORMAL_PACKET 0
62 #define PARAM_TX_PREAMBLE_FOREVER 2
63 #define PARAM_TX_CARRIER_FOREVER 3
65 #define gpio_configure_sport_mode_0 0xA0
66 #define gpio_configure_default 0x00
67 #define MCR_pa_level_mcr_Adr 0x307
68 #define MCR_rssi_readback_Adr 0x312
69 #define MCR_gpio_configure_Adr 0x3fa
70 #define MCR_ext_uc_clk_divide_Adr 0x32e
71 #define MCR_interrupt_source_0_Adr 0x336
72 #define MCR_interrupt_source_1_Adr 0x337
75 #define RADIO_MISO_IN GP2IN_IN0_BBA
77 #define RADIO_CSN_DEASSERT (pADI_GP2->GPSET = GP2SET_SET3)
78 #define RADIO_CSN_ASSERT (pADI_GP2->GPCLR = GP2CLR_CLR3)
80 #define SEND_SPI(x) pADI_SPI0->SPITX = x
81 #define WAIT_SPI_RX while((pADI_SPI0->SPISTA & SPISTA_RXFSTA_MSK) == 0x0);
82 #define READ_SPI pADI_SPI0->SPIRX
85 #define MSKSET_VAL(byte,numbits,offset,value) ((byte & ~(((0x1 << numbits)-1) << offset)) | value)
102 CMD_PHY_SLEEP = 0xBA,
103 CMD_CONFIG_DEV = 0xBB,
127 #define STATUS_BYTE_FW_STATE (0x1F << 0)
128 #define STATUS_BYTE_CMD_READY (0x1 << 5)
129 #define STATUS_BYTE_IRQ_STATUS (0x1 << 6)
130 #define STATUS_BYTE_SPI_READY (0x1 << 7)
134 #define SPI_MEMCMD_BYTE0_ADR_MSK (0x3 << 0)
135 #define SPI_MEMCMD_BYTE0_CMD_BITOFFSET 3
136 #define SPI_MEMCMD_BYTE0_CMD_MSK (0x1F << SPI_MEMCMD_BYTE0_CMD_BITOFFSET)
146 RIE_U8 interrupt_mask_0_r;
155 RIE_U8 channel_freq_0_r;
156 RIE_U8 channel_freq_1_r;
157 RIE_U8 channel_freq_2_r;
166 RIE_U8 radio_cfg_8_r;
167 RIE_U8 radio_cfg_9_r;
170 RIE_U8 image_reject_cal_phase_r;
171 RIE_U8 image_reject_cal_amplitude_r;
174 RIE_U8 symbol_mode_r;
182 RIE_U8 tx_base_adr_r;
183 RIE_U8 rx_base_adr_r;
184 RIE_U8 packet_length_control_r;
185 RIE_U8 packet_length_max_r;
210 } TyRadioConfiguration;
214 #define interrupt_mask_0_interrupt_tx_eof (0x1 << 4)
215 #define interrupt_mask_0_interrupt_crc_correct (0x1 << 2)
217 #define packet_length_control_length_offset_offset (0)
218 #define packet_length_control_length_offset_minus0 (0x4 << packet_length_control_length_offset_offset)
219 #define packet_length_control_data_mode_offset (3)
220 #define packet_length_control_data_mode_packet (0x0 << packet_length_control_data_mode_offset)
221 #define packet_length_control_crc_en_yes (0x1 << 5)
222 #define packet_length_control_packet_len_variable (0x0 << 6)
223 #define packet_length_control_packet_len_fixed (0x1 << 6)
224 #define packet_length_control_data_byte_lsb (0x0 << 7)
226 #define symbol_mode_symbol_length_8_bit (0 << 0)
227 #define symbol_mode_data_whitening_disabled (0 << 3)
228 #define symbol_mode_data_whitening_enabled (1 << 3)
229 #define symbol_mode_eight_ten_enc_disabled (0 << 4 )
230 #define symbol_mode_prog_crc_en_disabled (0 << 5)
231 #define symbol_mode_manchester_enc_enabled (1 << 6)
233 #define radio_cfg_8_pa_single_diff_sel_single_ended (0x0 << 7)
234 #define radio_cfg_8_pa_single_diff_sel_differential (0x1 << 7)
235 #define radio_cfg_8_pa_power_numbits (4)
236 #define radio_cfg_8_pa_power_offset (3)
237 #define radio_cfg_8_pa_power_setting_63 (0xF << radio_cfg_8_pa_power_offset)
238 #define radio_cfg_8_pa_ramp_numbits (3)
239 #define radio_cfg_8_pa_ramp_offset (0)
240 #define radio_cfg_8_pa_ramp_16 (0x5 << radio_cfg_8_pa_ramp_offset)
242 #define radio_cfg_9_demod_scheme_offset (0)
243 #define radio_cfg_9_demod_scheme_FSK (0x0 << radio_cfg_9_demod_scheme_offset)
244 #define radio_cfg_9_mod_scheme_numbits (3)
245 #define radio_cfg_9_mod_scheme_offset (3)
246 #define radio_cfg_9_mod_scheme_2_level_FSK (0x0 << radio_cfg_9_mod_scheme_offset)
247 #define radio_cfg_9_mod_scheme_2_level_GFSK (0x1 << radio_cfg_9_mod_scheme_offset)
248 #define radio_cfg_9_ifbw_numbits (2)
249 #define radio_cfg_9_ifbw_offset (6)
250 #define radio_cfg_9_ifbw_100kHz (0x0 << radio_cfg_9_ifbw_offset)
251 #define radio_cfg_9_ifbw_150kHz (0x1 << radio_cfg_9_ifbw_offset)
252 #define radio_cfg_9_ifbw_200kHz (0x2 << radio_cfg_9_ifbw_offset)
253 #define radio_cfg_9_ifbw_300kHz (0x3 << radio_cfg_9_ifbw_offset)
258 static TyRadioConfiguration RadioConfiguration;
261 static RIE_U32 DataRate = 38400;
265 const RIE_U8 DR_38_4kbps_Dev20kHz_Configuration[] =
267 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
270 0x80,0x01,0xC8,0x20,0x0E,0x00,0x00,0x00,0xFD,0x00,0x0B,0x37,
273 0x40,0x0C,0x00,0x0C,0x00,0x00,
274 0x10,0x00,0xC3,0x36,0x10,0x10,0x24,0xF0,0x2A,0x00,0x2F,0x19,0x5E,0x46,0x5F,0x78,
275 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
279 const RIE_U8 DR_300_0kbps_Dev75_0kHz_Configuration[] =
281 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
284 0xB8,0x2B,0xEE,0x0B,0x70,0x00,0x03,0x00,0xFD,0xC0,0x0B,0x37,
287 0x40,0x0C,0x00,0x0C,0x00,0x00,
288 0x10,0x00,0xC3,0x36,0x10,0x10,0x24,0xF0,0x2A,0x00,0x2F,0x19,0x5E,0x46,0x5F,0x78,
289 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
294 const RIE_U8 DR_1_0kbps_Dev10_0kHz_Configuration[] =
296 0x14,0x00,0x00,0x00,0x00,0x00,0x00,0x33,0x00,0x76,0x62,0x21,
298 0x0A,0x00,0x64,0x41,0x01,0x00,0x02,0x00,0xFD,0x00,0x0B,0x37,
301 0x40,0x0C,0x00,0x0C,0x00,0x00,
302 0x10,0x00,0xC3,0x36,0x10,0x10,0x24,0xF0,0x2A,0x00,0x2F,0x19,0x5E,0x46,0x5F,0x78,
303 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
311 static RIE_Responses RadioSendCommandBytes (RIE_U8 * pCmdBytes,
313 static RIE_Responses RadioSendCommandNoWait (Radio_CmdCodes CmdCode);
314 static RIE_Responses RadioSendCommandWait (Radio_CmdCodes CmdCode);
352 *pVersion = RIE_ENGINE_MINOR_VERSION | (RIE_ENGINE_MAJOR_VERSION << 8);
373 Response = RadioToOffMode();
375 Response = SetRadioConfiguration(BaseConfig);
377 Response = RadioCommitRadioConfig();
379 Response = RadioToOnMode();
404 pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
405 GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
406 GP2CON_CON4_IRQ8 | GP2CON_CON5_GPIO |
407 GP2CON_CON6_GPIO | GP2CON_CON7_GPIOIRQ7;
409 pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
410 GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
411 GP2OEN_OEN4_IN | GP2OEN_OEN5_IN |
412 GP2OEN_OEN6_IN | GP2OEN_OEN7_IN;
415 GP2PUL_PUL4_BBA = 0x0;
418 pADI_SPI0->SPIDIV = ((SYSTEM_UCLK/RADIO_SPI_CLK_FREQ)/2)-0x1;
419 pADI_SPI0->SPICON = SPICON_MASEN |
424 pADI_SPI0->SPICON = SPICON_MASEN |
439 pADI_INTERRUPT->EI2CFG = EI2CFG_IRQ8MDE_HIGHLEVEL | EI2CFG_IRQ8EN;
443 pADI_INTERRUPT->EICLR = EICLR_IRQ8;
451 Response = RadioSyncComms();
453 Response = RadioToOffMode();
455 Response = SetRadioConfiguration(BaseConfig);
457 Response = RadioCommitRadioConfig();
459 Response = RadioToOnMode();
480 pADI_GP2->GPCON = GP2CON_CON0_SPI0MISO | GP2CON_CON1_SPI0SCLK |
481 GP2CON_CON2_SPI0MOSI | GP2CON_CON3_GPIO |
482 GP2CON_CON4_IRQ8 | GP2CON_CON5_GPIO |
483 GP2CON_CON6_GPIO | GP2CON_CON7_GPIOIRQ7;
485 pADI_GP2->GPOEN = GP2OEN_OEN0_IN | GP2OEN_OEN1_IN |
486 GP2OEN_OEN2_IN | GP2OEN_OEN3_OUT |
487 GP2OEN_OEN4_IN | GP2OEN_OEN5_IN |
488 GP2OEN_OEN6_IN | GP2OEN_OEN7_IN;
491 GP2PUL_PUL4_BBA = 0x1;
494 pADI_SPI0->SPIDIV = ((SYSTEM_UCLK/RADIO_SPI_CLK_FREQ)/2)-0x1;
495 pADI_SPI0->SPICON = SPICON_MASEN |
500 pADI_SPI0->SPICON = SPICON_MASEN |
508 Response = RadioSendCommandNoWait(CMD_HW_RESET);
523 volatile RIE_U32 ulDelay;
526 Response = RadioSendCommandNoWait(CMD_HW_RESET);
555 Response = RadioToOnMode();
577 RIE_U32 EncodedFrequency;
579 bRadioConfigurationChanged =
RIE_TRUE;
581 EncodedFrequency = (RIE_U32)(Frequency * FREQ_CNVRT_VAL);
582 RadioConfiguration.channel_freq_0_r = (EncodedFrequency >> 0) & 0xFF;
583 RadioConfiguration.channel_freq_1_r = (EncodedFrequency >> 8) & 0xFF;
584 RadioConfiguration.channel_freq_2_r = (EncodedFrequency >> 16)& 0xFF;
585 if (Frequency >= 862000000)
587 RadioConfiguration.image_reject_cal_amplitude_r = 0x07;
588 RadioConfiguration.image_reject_cal_phase_r = 0x16;
592 RadioConfiguration.image_reject_cal_amplitude_r = 0x03;
593 RadioConfiguration.image_reject_cal_phase_r = 0x08;
616 RIE_U8 ucNewRegVal = RadioConfiguration.radio_cfg_9_r;
618 switch (ModulationType)
621 ucNewCode = radio_cfg_9_mod_scheme_2_level_FSK;
624 ucNewCode = radio_cfg_9_mod_scheme_2_level_GFSK;
632 ucNewRegVal = MSKSET_VAL(RadioConfiguration.radio_cfg_9_r,
633 radio_cfg_9_mod_scheme_numbits,
634 radio_cfg_9_mod_scheme_offset,
636 if (ucNewRegVal != RadioConfiguration.radio_cfg_9_r )
638 bRadioConfigurationChanged =
RIE_TRUE;
639 RadioConfiguration.radio_cfg_9_r = ucNewRegVal;
673 RIE_U8 ucNewRegVal = RadioConfiguration.symbol_mode_r;
678 ucNewRegVal &= ~symbol_mode_manchester_enc_enabled;
681 ucNewRegVal |= symbol_mode_manchester_enc_enabled;
689 if (ucNewRegVal != RadioConfiguration.symbol_mode_r )
691 bRadioConfigurationChanged =
RIE_TRUE;
692 RadioConfiguration.symbol_mode_r = ucNewRegVal;
732 RIE_U8 ucNewRegVal = RadioConfiguration.symbol_mode_r;
737 ucNewRegVal &= ~symbol_mode_data_whitening_enabled;
740 ucNewRegVal |= symbol_mode_data_whitening_enabled;
748 if (ucNewRegVal != RadioConfiguration.symbol_mode_r )
750 bRadioConfigurationChanged =
RIE_TRUE;
751 RadioConfiguration.symbol_mode_r = ucNewRegVal;
777 if (Len > PACKETRAM_LEN)
780 Response = RadioToOnMode();
785 RadioConfiguration.packet_length_max_r = Len;
786 RadioConfiguration.packet_length_control_r |= packet_length_control_packet_len_fixed;
789 Response = RadioCommitRadioConfig();
791 Response = RadioToOnMode();
793 Response = RadioSendCommandWait(CMD_PHY_TX);
820 if (Len > PACKETRAM_LEN)
823 Response = RadioToOnMode();
830 RadioConfiguration.packet_length_max_r = PACKETRAM_LEN;
831 RadioConfiguration.packet_length_control_r &= ~packet_length_control_packet_len_fixed;
834 Response = RadioCommitRadioConfig();
836 Response = RadioToOnMode();
838 Response = RadioSendCommandWait(CMD_PHY_TX);
882 RIE_U8 ucNewRegVal = 0x0;
883 unsigned long pa_level_mcr,pa_ramp, codes_per_bit,min_codes_per_bit;
888 ucNewRegVal |= radio_cfg_8_pa_single_diff_sel_differential;
891 ucNewRegVal |= radio_cfg_8_pa_single_diff_sel_single_ended;
917 ucNewRegVal |= ((RIE_U8)Power << radio_cfg_8_pa_power_offset);
919 pa_level_mcr = (((RIE_U8)Power)* 4) + 0x3;
920 min_codes_per_bit = (pa_level_mcr * 2500)/(DataRate/100);
923 while (codes_per_bit > min_codes_per_bit)
926 codes_per_bit = 512 >> pa_ramp;
930 ucNewRegVal |= ((RIE_U8)pa_ramp << radio_cfg_8_pa_ramp_offset);
940 if (ucNewRegVal != RadioConfiguration.radio_cfg_8_r )
942 bRadioConfigurationChanged =
RIE_TRUE;
943 RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
962 RIE_U8 ParamTX = PARAM_TX_CARRIER_FOREVER;
965 Response = RadioCommitRadioConfig();
968 Response = RadioToOnMode();
971 Response =
RadioMMapWrite(PR_var_tx_mode_ADR,
sizeof(ParamTX),&ParamTX);
973 Response = RadioSendCommandWait(CMD_PHY_TX);
990 RIE_U8 ParamTX = PARAM_TX_PREAMBLE_FOREVER;
993 Response = RadioCommitRadioConfig();
995 Response = RadioToOnMode();
999 Response =
RadioMMapWrite(PR_var_tx_mode_ADR,
sizeof(ParamTX),&ParamTX);
1001 Response = RadioSendCommandWait(CMD_PHY_TX);
1022 if (Len > PACKETRAM_LEN)
1027 RadioConfiguration.packet_length_max_r = Len;
1028 RadioConfiguration.packet_length_control_r |= packet_length_control_packet_len_fixed;
1031 Response = RadioCommitRadioConfig();
1033 Response = RadioToOnMode();
1035 Response = RadioSendCommandWait(CMD_PHY_RX);
1058 RadioConfiguration.packet_length_max_r = PACKETRAM_LEN;
1059 RadioConfiguration.packet_length_control_r &= ~packet_length_control_packet_len_fixed;
1062 Response = RadioCommitRadioConfig();
1064 Response = RadioToOnMode();
1066 Response = RadioSendCommandWait(CMD_PHY_RX);
1132 if(RadioConfiguration.packet_length_control_r & packet_length_control_packet_len_fixed)
1135 *pPktLen = RadioConfiguration.packet_length_max_r;
1136 RdLen = RadioConfiguration.packet_length_max_r;
1137 if (RdLen > BufferLen)
1149 if (RdLen > BufferLen)
1158 Response =
RadioMMapRead(MCR_rssi_readback_Adr,0x1, (RIE_U8 *)pRSSIdBm);
1192 pADI_MISC->RFTST = 0x7E1;
1195 Response = RadioCommitRadioConfig();
1199 Data = gpio_configure_sport_mode_0;
1201 Response =
RadioMMapWrite(MCR_gpio_configure_Adr, 0x1, (RIE_U8 *)&Data);
1210 Response = RadioSendCommandWait(CMD_PHY_RX);
1225 if(bTestModeEnabled)
1228 Data = gpio_configure_default;
1230 Response =
RadioMMapWrite(MCR_gpio_configure_Adr, 0x1, (RIE_U8 *)&Data);
1237 Data = PARAM_TX_NORMAL_PACKET;
1239 Response =
RadioMMapWrite(PR_var_tx_mode_ADR,
sizeof(Data),&Data);
1242 if (bRadioConfigurationChanged)
1244 Response = RadioConfigure();
1264 Response = RadioSPIXferByte(SPI_NOP,
NULL);
1266 Response = RadioSPIXferByte(SPI_NOP,&StatusByte);
1270 *pState = (RadioState)(StatusByte & STATUS_BYTE_FW_STATE);
1283 RadioState CurrState;
1288 while((Response ==
RIE_Success) && (CurrState != FinalState));
1306 Response = RadioSPIXferByte(SPI_NOP,
NULL);
1308 Response = RadioSPIXferByte(SPI_NOP,&StatusByte);
1312 if(StatusByte & STATUS_BYTE_CMD_READY)
1337 while ((FwState != FW_ON) && (Response ==
RIE_Success))
1345 Response = RadioSendCommandNoWait(CMD_PHY_ON);
1351 Response = RadioSendCommandNoWait(CMD_PHY_ON);
1357 Response = RadioSendCommandNoWait(CMD_PHY_ON);
1386 while ((FwState != FW_OFF) && (Response ==
RIE_Success))
1394 Response = RadioSendCommandNoWait(CMD_PHY_ON);
1400 Response = RadioSendCommandNoWait(CMD_PHY_ON);
1406 Response = RadioSendCommandNoWait(CMD_PHY_OFF);
1427 Response = RadioSendCommandWait(CMD_SYNC);
1446 while (!RADIO_MISO_IN && (i < 1000))
1460 void Ext_Int8_Handler (
void)
1467 Response =
RadioMMapRead(MCR_interrupt_source_0_Adr,0x1, &ucInt0);
1469 Response =
RadioMMapRead(MCR_interrupt_source_1_Adr,0x1,&ucInt1);
1470 if (ucInt0 & interrupt_mask_0_interrupt_tx_eof)
1472 if (ucInt0 & interrupt_mask_0_interrupt_crc_correct) {
1478 Response =
RadioMMapWrite(MCR_interrupt_source_0_Adr,0x1, &ucInt0);
1480 Response =
RadioMMapWrite(MCR_interrupt_source_1_Adr,0x1,&ucInt1);
1482 pADI_INTERRUPT->EICLR = EICLR_IRQ8;
1494 static RIE_Responses RadioSPIXferByte(RIE_U8 ucByte,RIE_U8 *pData)
1520 static RIE_Responses RadioSendCommandBytes(RIE_U8 *pCmdBytes,RIE_U8 NumBytes)
1527 Response = RadioSPIXferByte(*(pCmdBytes++),
NULL);
1540 static RIE_Responses RadioSendCommandNoWait (Radio_CmdCodes CmdCode )
1542 RIE_U8 Command = (RIE_U8)CmdCode;
1543 return RadioSendCommandBytes(&Command,0x1);
1552 static RIE_Responses RadioSendCommandWait (Radio_CmdCodes CmdCode )
1555 RIE_U8 Command = (RIE_U8)CmdCode;
1560 Response = RadioSendCommandBytes(&Command,0x1);
1579 Response = RadioSPIXferByte(SPI_MEM_RD | ((ulAdr & 0x700) >> 8),
NULL);
1581 Response = RadioSPIXferByte((RIE_U8)(ulAdr & 0xFF),
NULL);
1583 Response = RadioSPIXferByte((RIE_U8)SPI_NOP,
NULL);
1585 Response = RadioSPIXferByte(SPI_NOP,pData++);
1606 Response = RadioSPIXferByte(SPI_MEM_WR | ((ulAdr & 0x700) >> 8),
NULL);
1608 Response = RadioSPIXferByte((RIE_U8)(ulAdr & 0xFF),
NULL);
1610 Response = RadioSPIXferByte(*(pData++),
NULL);
1629 bRadioConfigurationChanged =
RIE_TRUE;
1633 memcpy((
void *)&RadioConfiguration,
1634 (
void *)DR_1_0kbps_Dev10_0kHz_Configuration,
1635 sizeof(TyRadioConfiguration));
1639 memcpy((
void *)&RadioConfiguration,
1640 (
void *)DR_38_4kbps_Dev20kHz_Configuration,
1641 sizeof(TyRadioConfiguration));
1645 memcpy((
void *)&RadioConfiguration,
1646 (
void *)DR_300_0kbps_Dev75_0kHz_Configuration,
1647 sizeof(TyRadioConfiguration));
1666 Response = RadioToOffMode();
1669 sizeof(TyRadioConfiguration),
1670 (RIE_U8 *)&RadioConfiguration);
1672 Response = RadioSendCommandWait(CMD_CONFIG_DEV);
1674 Response = RadioToOnMode();
1696 Response = RadioCommitRadioConfig();
1698 Response = RadioToOnMode();
1700 Response = RadioSendCommandWait(CMD_GET_RSSI);
1702 Response = RadioSyncComms();
1706 Response =
RadioMMapRead(MCR_rssi_readback_Adr,0x1, (RIE_U8 *)pRSSIdBm);
1729 RIE_U8 ucNewRegVal = RadioConfiguration.radio_cfg_8_r;
1730 unsigned long pa_level_mcr,pa_ramp, codes_per_bit,min_codes_per_bit;
1732 if (RadioConfiguration.radio_cfg_8_r & radio_cfg_8_pa_single_diff_sel_differential)
1733 ucNewRegVal = radio_cfg_8_pa_single_diff_sel_differential;
1735 ucNewRegVal = radio_cfg_8_pa_single_diff_sel_single_ended;
1757 ucNewRegVal |= ((RIE_U8)Power << radio_cfg_8_pa_power_offset);
1759 pa_level_mcr = (((RIE_U8)Power)* 4) + 0x3;
1760 min_codes_per_bit = (pa_level_mcr * 2500)/(DataRate/100);
1762 codes_per_bit = 256;
1763 while (codes_per_bit > min_codes_per_bit)
1766 codes_per_bit = 512 >> pa_ramp;
1770 ucNewRegVal |= ((RIE_U8)pa_ramp << radio_cfg_8_pa_ramp_offset);
1780 if (ucNewRegVal != RadioConfiguration.radio_cfg_8_r )
1784 Response =
RadioMMapWrite(MCR_pa_level_mcr_Adr, 0x1, (RIE_U8 *)&ucNewRegVal);
1785 RadioConfiguration.radio_cfg_8_r = ucNewRegVal;
RIE_Responses RadioTxCarrier(void)
Transmit a carrier tone using the current radio configuration.
RIE_Responses RadioRxPacketVariableLen(void)
Enter receive mode and wait for a packet to be received.
static RIE_Responses RadioMMapRead(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
Read bytes from specified memory map address.
RIE_Responses RadioTxPreamble(void)
Transmit a pre-amble (alternating ones and zeros) using the current radio configuration.
RIE_Responses RadioTxSetPA(RIE_PATypes PAType, RIE_PAPowerLevel Power)
Set PA Type and the Transmit Power Level for Radio Transmission.
static RIE_Responses RadioWaitForPowerUp(void)
Wake Up the Part.
__STATIC_INLINE void NVIC_EnableIRQ(IRQn_Type IRQn)
Enable External Interrupt.
RIE_BOOL RadioTxPacketComplete(void)
Checks if a packet has finished transmitting.
__STATIC_INLINE void NVIC_DisableIRQ(IRQn_Type IRQn)
Disable External Interrupt.
RIE_Responses RadioRxBERTestMode(void)
Enter receiver Bit Error Rate (BER) test mode where the clock and data appear on GPIO pins...
RIE_Responses RadioRxPacketFixedLen(RIE_U8 Len)
Enter receive mode and wait for a packet to be received.
RIE_BOOL RadioRxPacketAvailable(void)
Checks if a packet has been received.
void aducrf101_rx_packet_hook(void)
Trigger function called by ADI radio engine upon packet RX.
RIE_Responses RadioTxSetPower(RIE_PAPowerLevel Power)
Set the Transmit Power Level for Radio Transmission.
RIE_Responses RadioTxPacketFixedLen(RIE_U8 Len, RIE_U8 *pData)
Transmit a fixed length packet.
__STATIC_INLINE void NVIC_SetPriority(IRQn_Type IRQn, uint32_t priority)
Set Interrupt Priority.
__STATIC_INLINE void NVIC_ClearPendingIRQ(IRQn_Type IRQn)
Clear Pending Interrupt.
RIE_Responses RadioTxPacketVariableLen(RIE_U8 Len, RIE_U8 *pData)
Transmit a Variable length packet.
#define NULL
The null pointer.
RIE_Responses RadioPowerOff(void)
Shutdown the radio and place it in its lowest power sleep mode.
RIE_Responses RadioSetModulationType(RIE_ModulationTypes ModulationType)
Set the Radio Transmitter Modulation Type.
RIE_Responses RadioSwitchConfig(RIE_BaseConfigs BaseConfig)
Change the Radio to using specified configuration.
static RIE_Responses RadioWaitOnState(RadioState FinalState)
Wait for Final State to be reached.
RIE_Responses RadioSetFrequency(RIE_U32 Frequency)
Set frequency for radio communications.
RIE_Responses RadioPayldManchesterEncode(RIE_BOOL bEnable)
Enable or Disable Manchester Encoding of payload data.
static RIE_Responses RadioMMapWrite(RIE_U32 ulAdr, RIE_U32 ulLen, RIE_U8 *pData)
Read bytes from specified memory map address.
RIE_Responses RadioGetAPIVersion(RIE_U32 *pVersion)
Return the Radio Interface Engine API Version.
RIE_Responses RadioDeInit(void)
Deinitialise the Radio, and power it down.
static RIE_Responses RadioReadState(RadioState *pState)
Read the current state.
static RIE_Responses RadioWaitOnCmdLdr(void)
Wait for Final State to be reached.
RIE_Responses RadioTerminateRadioOp(void)
Terminate a currently running radio RX or TX operation.
RIE_Responses RadioPayldDataWhitening(RIE_BOOL bEnable)
Enable or Disable Data Whitening of payload data.
RIE_Responses RadioInit(RIE_BaseConfigs BaseConfig)
Initialise the Radio, using specified configuration.
RIE_Responses RadioRxPacketRead(RIE_U8 BufferLen, RIE_U8 *pPktLen, RIE_U8 *pData, RIE_S8 *pRSSIdBm)
Read the packet that was received by the radio.
RIE_Responses RadioRadioGetRSSI(RIE_S8 *pRSSIdBm)
Return a Received Signal Strength Indicator value.