Go to the source code of this file.
Macros | |
#define | RF_CHN_TABLE 0x8000 |
#define | RF_FAST_MODE_1M 1 |
#define | RF_FAST_MODE_2M 0 |
#define | RF_LONG_PACKET_EN 0 |
#define | RF_BLE_PACKET_LENGTH_OK(p) ( *((unsigned int*)p) == p[5]+13) |
#define | RF_BLE_PACKET_CRC_OK(p) ((p[*((unsigned int*)p) + 3] & 0x01) == 0x0) |
#define | RF_PACKET_LENGTH_OK(p) (MAKE_U16(p[1], p[0]) == p[5]+13) |
#define | RF_PACKET_CRC_OK(p) ((p[MAKE_U16(p[1], p[0])+3] & 0x01) == 0x0) |
#define | RF_PACKET_1M_LENGTH_OK(p) (p[0] == p[5]+13) |
#define | RF_PACKET_2M_LENGTH_OK(p) (p[0] == (p[12]&0x3f)+15) |
#define | RF_FAST_MODE 1 |
#define | RF_TRX_MODE 0x80 |
#define | RF_TRX_OFF 0x45 |
#define | RF_ZIGBEE_PACKET_LENGTH_OK(p) (p[0] == p[4]+9) |
#define | RF_ZIGBEE_PACKET_CRC_OK(p) ((p[p[0]+3] & 0x51) == 0x10) |
#define | RF_ZIGBEE_PACKET_RSSI_GET(p) (p[p[0]+2]) |
#define | RF_ZIGBEE_PACKET_TIMESTAMP_GET(p) (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
#define | RF_ZIGBEE_PACKET_PAYLOAD_LENGTH_GET(p) (p[4]) |
#define | RF_NRF_ESB_PACKET_LENGTH_OK(p) (p[0] == (p[4] & 0x3f) + 11) |
#define | RF_NRF_ESB_PACKET_CRC_OK(p) ((p[p[0]+3] & 0x01) == 0x00) |
#define | RF_NRF_ESB_PACKET_RSSI_GET(p) (p[p[0]+2]) |
#define | RF_NRF_SB_PACKET_PAYLOAD_LENGTH_GET(p) (p[0] - 10) |
#define | RF_NRF_SB_PACKET_CRC_OK(p) ((p[p[0]+3] & 0x01) == 0x00) |
#define | RF_NRF_SB_PACKET_CRC_GET(p) ((p[p[0]-8]<<8) + p[p[0]-7]) |
#define | RF_NRF_SB_PACKET_RSSI_GET(p) (p[p[0]+2]) |
#define | RF_NRF_ESB_PACKET_TIMESTAMP_GET(p) (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
#define | RF_NRF_SB_PACKET_TIMESTAMP_GET(p) (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
Functions | |
static void | reset_baseband (void) |
This function serves to reset RF BaseBand. More... | |
void | rf_drv_init (RF_ModeTypeDef rf_mode) |
This function serves to initiate the mode of RF. More... | |
void | rf_set_power_level_index (RF_PowerTypeDef level) |
This function serves to set RF power level index. More... | |
void | rf_set_power_level_index_zgb (int level_idx) |
This function serves to set RF power level index. More... | |
signed char | rf_get_tx_power_level (void) |
This function serves to get RF TX power level . More... | |
void | rf_acc_len_set (unsigned char len) |
this function is to Set byte length for access_code. More... | |
static unsigned char | rf_acc_len_get (unsigned char len) |
this function performs to get access_code length. More... | |
void | rf_acc_code_set (unsigned char pipe_id, const unsigned char *addr) |
this function is to set access code. More... | |
void | rf_acc_code_get (unsigned char pipe_id, unsigned char *addr) |
this function is to set access code. More... | |
void | rf_set_channel (signed char chn, unsigned short set) |
This function serves to set RF's channel. More... | |
static void | rf_access_code_comm (unsigned int acc) |
This function serves to set RF access command. More... | |
static void | rf_longrange_access_code_comm (unsigned int acc) |
This function serves to set RF access command. More... | |
static void | rf_rx_acc_code_enable (unsigned char pipe) |
this function is to enable/disable each access_code channel for RF Rx terminal. More... | |
static void | rf_tx_acc_code_select (unsigned char pipe) |
this function is to select access_code channel for RF Rx terminal. More... | |
static void | rf_set_tx_rx_off (void) |
This function serves to reset RF Tx/Rx mode. More... | |
static void | rf_set_tx_rx_off_auto_mode (void) |
This function serves to turn off RF auto mode. More... | |
int | rf_trx_state_set (RF_StatusTypeDef rf_status, signed char rf_channel) |
This function serves to judge RF Tx/Rx state. More... | |
RF_StatusTypeDef | rf_trx_state_get (void) |
This function serves to get RF status. More... | |
static void | rf_set_txmode (void) |
This function serves to set RF Tx mode. More... | |
static void | tx_settle_adjust (unsigned short txstl_us) |
This function serves to settle adjust for RF Tx. More... | |
static void | rf_set_tx_pipe (unsigned char pipe) |
This function serves to set pipe for RF Tx. More... | |
void | rf_tx_pkt (unsigned char *addr) |
This function serves to set RF Tx packet. More... | |
void | rf_tx_pkt_auto (void *addr) |
This function serves to send packet for RF. More... | |
static unsigned char | rf_tx_finish (void) |
This function serves to determine whether sending a packet of data is finished. More... | |
static void | rf_tx_finish_clear_flag (void) |
This function serves to clear the Tx finish flag bit. After all packet data are sent, corresponding Tx finish flag bit will be set as 1.By reading this flag bit, it can check whether packet transmission is finished. After the check, it¡¯s needed to manually clear this flag bit so as to avoid misjudgment. More... | |
static unsigned char | rf_is_rx_finish (void) |
This function serves to determine whether sending a packet of rf_tx_acc_code_select is finished. More... | |
void | rf_rx_buffer_set (unsigned char *RF_RxAddr, int size, unsigned char PingpongEn) |
This function is to set rx buffer. More... | |
static void | rf_rx_buffer_reconfig (unsigned short RF_RxAddr) |
This function serves to reconfigure the buffer. More... | |
static unsigned char | rf_is_rx_right (void) |
This function serves to determine whether a packet of data received is right. More... | |
static void | rf_rx_finish_clear_flag (void) |
This function serves to clear the Rx finish flag bit. After all packet data are resive, corresponding Rx finish flag bit will be set as 1.By reading this flag bit, it can check whether packet transmission is finished. After the check, it¡¯s needed to manually clear this flag bit so as to avoid misjudgment. More... | |
static void | rf_set_rxmode (void) |
This function serves to set RF Tx mode. More... | |
void | rf_start_btx (void *addr, unsigned int tick) |
This function serves to start Tx of ble_mode. More... | |
void | rf_start_brx (void *addr, unsigned int tick) |
This function serves to start Rx of auto mode. In this mode, RF module stays in Rx status until a packet is received or it fails to receive packet when timeout expires. Timeout duration is set by the parameter "tick". The address to store received data is set by the function ¡°addr¡±. More... | |
void | rf_start_stx (void *addr, unsigned int tick) |
This function serves to start Tx. More... | |
void | rf_start_srx (unsigned int tick) |
This function serves to start Rx. More... | |
void | rf_start_stx2rx (void *addr, unsigned int tick) |
This function serves to start stx2rx mode of auto_mode. In this mode, a packet is sent first,RF module waits for 10us, stays in Rx status until data is received or timeout expires, then exits this mode.Timeout duration is set by the parameter ¡°timeout_us¡±.The address to store received data is set by the function ¡°RF_RxBufferSet¡±. More... | |
void | rf_start_srx2tx (void *addr, unsigned int tick) |
This function serves to start srx2tx mode of auto_mode. In this mode,RF module stays in Rx status until a packet is received or it fails to receive packetwhen timeout expires. If a packet is received within the timeout duration, RF module will wait for 10us,send a packet, and then exit this mode. If it fails to receive packet when timeout expires, RF module will directly exit this mode.Timeout duration is set by the parameter "timeout_us". The address to store received data is set by the function ¡°RF_RxBufferSet¡±. More... | |
void | rf_set_ble_channel (signed char chn_num) |
This function serves to set the ble channel. More... | |
static void | rf_ble_tx_on () |
This function performs to enable RF Tx. More... | |
static void | rf_ble_tx_done () |
This function performs to done RF Tx. More... | |
static void | reset_sn_nesn (void) |
This function serves to reset function for RF. More... | |
static void | rf_reset_sn (void) |
This function serves to reset the RF sn. More... | |
static void | rf_set_ble_crc (unsigned char *p) |
This function serves to set pipe for RF Tx. More... | |
static void | rf_set_ble_crc_value (unsigned int crc) |
This function serves to set CRC value for RF. More... | |
static void | rf_set_ble_crc_adv () |
This function serves to set CRC advantage. More... | |
static void | rf_set_ble_access_code (unsigned char *p) |
This function serves to set RF access code. More... | |
static void | rf_set_ble_access_code_value (unsigned int ac) |
This function serves to set RF access code value. More... | |
static void | rf_set_ble_access_code_adv (void) |
This function serves to set RF access code advantage. More... | |
static unsigned int | rf_access_code_16to32 (unsigned short code) |
This function serves to set RF access code 6bit to 32bit. More... | |
static unsigned short | rf_access_code_32to16 (unsigned int code) |
This function serves to set RF access code 6bit to 32bit. More... | |
static unsigned char | is_rf_receiving_pkt (void) |
This function serves to judge the statue of RF receive. More... | |
void | rf_set_channel_500k (signed short chn, unsigned short set) |
This function serves to set The channel . More... | |
static void | rf_fix_payload_len_set (int len) |
this function is to set shock burst for RF. More... | |
void | rf_rx_cfg (int size, unsigned char PingpongEn) |
This function. More... | |
unsigned short | crc16_ccitt_cal (unsigned char *input, unsigned int len, unsigned short init_val) |
This function serves to get CRC. More... | |
void | rf_tx_500k_simulate_100k (unsigned char *preamble, unsigned char preamble_len, unsigned char *acc_code, unsigned char acc_len, unsigned char *payload, unsigned char pld_len, unsigned char *tx_buf, unsigned short crc_init) |
This function serves to simulate 100k Tx by 500k Tx. More... | |
void | rf_ed_detecct_154 (void) |
This function is to start energy detect of the current channel for zigbee mode Before using it. More... | |
unsigned char | rf_stop_ed_154 (void) |
This function is to stop energy detect and get energy detect value of the current channel for zigbee mode. More... | |
void | rf_rffe_set_pin (RF_PATxPinDef tx_pin, RF_LNARxPinDef rx_pin) |
This function serves to set pin for RFFE of RF. More... | |
unsigned char | rx_packet_process_1mbps (unsigned char *rx_buf, unsigned int len) |
This function process the received packet in 1mbps shockburst mode only for hanshow for the compatiblity with third-party chips. The process includes data-whitening transformation and crc check. More... | |
void | tx_packet_process_1mbps (unsigned char *tx_buf, unsigned char *payload, unsigned int len) |
This function process the tx packet in 1mbps shockburst mode only for hanshow for the compatiblity with third-party chips. The process includes data-whitening transformation and crc padding. More... | |
Variables | |
const RF_PowerTypeDef | rf_power_Level_list [60] |
#define RF_CHN_TABLE 0x8000 |
#define RF_FAST_MODE_1M 1 |
#define RF_FAST_MODE_2M 0 |
#define RF_LONG_PACKET_EN 0 |
#define RF_BLE_PACKET_LENGTH_OK | ( | p | ) | ( *((unsigned int*)p) == p[5]+13) |
#define RF_BLE_PACKET_CRC_OK | ( | p | ) | ((p[*((unsigned int*)p) + 3] & 0x01) == 0x0) |
#define RF_PACKET_LENGTH_OK | ( | p | ) | (MAKE_U16(p[1], p[0]) == p[5]+13) |
#define RF_PACKET_CRC_OK | ( | p | ) | ((p[MAKE_U16(p[1], p[0])+3] & 0x01) == 0x0) |
#define RF_PACKET_1M_LENGTH_OK | ( | p | ) | (p[0] == p[5]+13) |
#define RF_PACKET_2M_LENGTH_OK | ( | p | ) | (p[0] == (p[12]&0x3f)+15) |
#define RF_FAST_MODE 1 |
#define RF_TRX_MODE 0x80 |
#define RF_TRX_OFF 0x45 |
#define RF_ZIGBEE_PACKET_LENGTH_OK | ( | p | ) | (p[0] == p[4]+9) |
#define RF_ZIGBEE_PACKET_CRC_OK | ( | p | ) | ((p[p[0]+3] & 0x51) == 0x10) |
#define RF_ZIGBEE_PACKET_RSSI_GET | ( | p | ) | (p[p[0]+2]) |
#define RF_ZIGBEE_PACKET_TIMESTAMP_GET | ( | p | ) | (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
#define RF_ZIGBEE_PACKET_PAYLOAD_LENGTH_GET | ( | p | ) | (p[4]) |
#define RF_NRF_ESB_PACKET_LENGTH_OK | ( | p | ) | (p[0] == (p[4] & 0x3f) + 11) |
#define RF_NRF_ESB_PACKET_CRC_OK | ( | p | ) | ((p[p[0]+3] & 0x01) == 0x00) |
#define RF_NRF_ESB_PACKET_RSSI_GET | ( | p | ) | (p[p[0]+2]) |
#define RF_NRF_SB_PACKET_PAYLOAD_LENGTH_GET | ( | p | ) | (p[0] - 10) |
#define RF_NRF_SB_PACKET_CRC_OK | ( | p | ) | ((p[p[0]+3] & 0x01) == 0x00) |
#define RF_NRF_SB_PACKET_CRC_GET | ( | p | ) | ((p[p[0]-8]<<8) + p[p[0]-7]) |
#define RF_NRF_SB_PACKET_RSSI_GET | ( | p | ) | (p[p[0]+2]) |
#define RF_NRF_ESB_PACKET_TIMESTAMP_GET | ( | p | ) | (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
#define RF_NRF_SB_PACKET_TIMESTAMP_GET | ( | p | ) | (p[p[0]-4] | (p[p[0]-3]<<8) | (p[p[0]-2]<<16) | (p[p[0]-1]<<24)) |
enum RF_ModeTypeDef |
enum RF_StatusTypeDef |
enum RF_LNARxPinDef |
enum RF_PATxPinDef |
enum RF_PowerTypeDef |
Define power list of RF.
|
inlinestatic |
This function serves to reset RF BaseBand.
[in] | none. |
void rf_drv_init | ( | RF_ModeTypeDef | rf_mode | ) |
This function serves to initiate the mode of RF.
[in] | rf_mode | - mode of RF |
void rf_set_power_level_index | ( | RF_PowerTypeDef | level | ) |
This function serves to set RF power level index.
[in] | RF_PowerTypeDef | - the RF power types. |
void rf_set_power_level_index_zgb | ( | int | level_idx | ) |
This function serves to set RF power level index.
[in] | level_idx | - the RF power index. |
signed char rf_get_tx_power_level | ( | void | ) |
This function serves to get RF TX power level .
[in] | RF_PowerTypeDef | - the RF power types. |
void rf_acc_len_set | ( | unsigned char | len | ) |
this function is to Set byte length for access_code.
[in] | len | Optional range: 2~5 , The effect for 3-byte access_code is not good. |
|
inlinestatic |
this function performs to get access_code length.
[in] | len | - Optional range: 3~5 Note: The effect for 3-byte access_code is not good. |
void rf_acc_code_set | ( | unsigned char | pipe_id, |
const unsigned char * | addr | ||
) |
this function is to set access code.
[in] | pipe | index number for access_code channel. |
[in] | addr | the access code address. |
void rf_acc_code_get | ( | unsigned char | pipe_id, |
unsigned char * | addr | ||
) |
this function is to set access code.
[in] | pipe_id | index number for access_code channel. |
[in] | addr | the access code address. |
void rf_set_channel | ( | signed char | chn, |
unsigned short | set | ||
) |
This function serves to set RF's channel.
[in] | chn | - RF channel. |
[in] | set | - the value to set. |
|
inlinestatic |
This function serves to set RF access command.
[in] | acc | - the command. |
|
inlinestatic |
This function serves to set RF access command.
[in] | acc | - the command. |
|
inlinestatic |
this function is to enable/disable each access_code channel for RF Rx terminal.
[in] | pipe | Bit0~bit5 correspond to channel 0~5, respectively. 0£ºDisable 1£ºEnable If ¡°enable¡± is set as 0x3f (i.e. 00111111), all access_code channels (0~5) are enabled. |
|
inlinestatic |
this function is to select access_code channel for RF Rx terminal.
[in] | pipe | Bit0~bit5 correspond to channel 0~5, respectively. 0£ºDisable 1£ºEnable If ¡°enable¡± is set as 0x3f (i.e. 00111111), all access_code channels (0~5) are enabled. |
|
inlinestatic |
This function serves to reset RF Tx/Rx mode.
none. |
|
inlinestatic |
This function serves to turn off RF auto mode.
none. |
int rf_trx_state_set | ( | RF_StatusTypeDef | rf_status, |
signed char | rf_channel | ||
) |
This function serves to judge RF Tx/Rx state.
[in] | rf_status | - Tx/Rx status. |
[in] | rf_channel | - RF channel. |
RF_StatusTypeDef rf_trx_state_get | ( | void | ) |
This function serves to get RF status.
[in] | none. |
|
inlinestatic |
This function serves to set RF Tx mode.
none. |
|
inlinestatic |
This function serves to settle adjust for RF Tx.
txstl_us | - adjust TX settle time. |
|
inlinestatic |
This function serves to set pipe for RF Tx.
pipe | - RF Optional range . |
void rf_tx_pkt | ( | unsigned char * | addr | ) |
This function serves to set RF Tx packet.
[in] | rf_txaddr | - the address RF to send packet. |
void rf_tx_pkt_auto | ( | void * | addr | ) |
This function serves to send packet for RF.
addr | - the address need to be send. |
|
inlinestatic |
This function serves to determine whether sending a packet of data is finished.
[in] | none. |
|
inlinestatic |
This function serves to clear the Tx finish flag bit. After all packet data are sent, corresponding Tx finish flag bit will be set as 1.By reading this flag bit, it can check whether packet transmission is finished. After the check, it¡¯s needed to manually clear this flag bit so as to avoid misjudgment.
none |
|
inlinestatic |
This function serves to determine whether sending a packet of rf_tx_acc_code_select is finished.
[in] | none. |
void rf_rx_buffer_set | ( | unsigned char * | RF_RxAddr, |
int | size, | ||
unsigned char | PingpongEn | ||
) |
This function is to set rx buffer.
[out] | RF_RxAddr | Pointer for Rx buffer in RAM(Generally it¡¯s starting address of an array.Should be 4-byte aligned) |
[in] | size | Rx buffer size (It¡¯s an integral multiple of 16) |
[in] | PingpongEn | Enable/Disable Ping-Pong buffer 1£ºEnable 0£ºDisable Note: When ¡°PingpongEn¡± is set as 0, received RF data will be stored in RAM pointed by ¡° RF_RxAddr¡±. When ¡°PingpongEn¡± is set as 1, received RF data will be stored in buffer0 and buffer1 successively. The RAM size reserved for received RF data should be double of ¡°Size¡±. |
|
inlinestatic |
This function serves to reconfigure the buffer.
[out] | RF_RxAddr | Pointer for Rx buffer in RAM(Generally it¡¯s starting address of an array.Should be 4-byte aligned) |
|
inlinestatic |
This function serves to determine whether a packet of data received is right.
[in] | none. |
|
inlinestatic |
This function serves to clear the Rx finish flag bit. After all packet data are resive, corresponding Rx finish flag bit will be set as 1.By reading this flag bit, it can check whether packet transmission is finished. After the check, it¡¯s needed to manually clear this flag bit so as to avoid misjudgment.
none |
|
inlinestatic |
This function serves to set RF Tx mode.
none. |
void rf_start_btx | ( | void * | addr, |
unsigned int | tick | ||
) |
This function serves to start Tx of ble_mode.
[in] | addr | Tx packet address in RAM. Should be 4-byte aligned. |
[in] | tick | Tick value of system timer. It determines when to start ble mode and send packet. |
void rf_start_brx | ( | void * | addr, |
unsigned int | tick | ||
) |
This function serves to start Rx of auto mode. In this mode, RF module stays in Rx status until a packet is received or it fails to receive packet when timeout expires. Timeout duration is set by the parameter "tick". The address to store received data is set by the function ¡°addr¡±.
[in] | addr | - The address to store received data. |
[in] | tick | - Unit is us. It indicates timeout duration in Rx status.Max value: 0xffffff (16777215) |
void rf_start_stx | ( | void * | addr, |
unsigned int | tick | ||
) |
This function serves to start Tx.
[in] | addr | Tx packet address in RAM. Should be 4-byte aligned. |
[in] | tick | Tick value of system timer. |
void rf_start_srx | ( | unsigned int | tick | ) |
This function serves to start Rx.
[in] | tick | Tick value of system timer. |
void rf_start_stx2rx | ( | void * | addr, |
unsigned int | tick | ||
) |
This function serves to start stx2rx mode of auto_mode. In this mode, a packet is sent first,RF module waits for 10us, stays in Rx status until data is received or timeout expires, then exits this mode.Timeout duration is set by the parameter ¡°timeout_us¡±.The address to store received data is set by the function ¡°RF_RxBufferSet¡±.
[in] | addr | Tx packet address in RAM. Should be 4-byte aligned. |
[in] | tick | Tick value of system timer. It determines when to start StxToRx mode and send packet. |
[in] | timeout_us | Unit is us. It indicates timeout duration in Rx status.Max value: 0xfff (4095) |
void rf_start_srx2tx | ( | void * | addr, |
unsigned int | tick | ||
) |
This function serves to start srx2tx mode of auto_mode. In this mode,RF module stays in Rx status until a packet is received or it fails to receive packetwhen timeout expires. If a packet is received within the timeout duration, RF module will wait for 10us,send a packet, and then exit this mode. If it fails to receive packet when timeout expires, RF module will directly exit this mode.Timeout duration is set by the parameter "timeout_us". The address to store received data is set by the function ¡°RF_RxBufferSet¡±.
[in] | addr | Tx packet address in RAM. Should be 4-byte aligned. |
[in] | tick | Tick value of system timer. It determines when to start SrxToTx mode. |
[in] | timeout_us | Unit is us. It indicates timeout duration in Rx status. Max value: 0xffffff (16777215) |
void rf_set_ble_channel | ( | signed char | chn_num | ) |
This function serves to set the ble channel.
chn_num | - channel numbers. |
|
inlinestatic |
This function performs to enable RF Tx.
[in] | none. |
|
inlinestatic |
This function performs to done RF Tx.
[in] | none. |
|
inlinestatic |
This function serves to reset function for RF.
none |
|
inlinestatic |
This function serves to reset the RF sn.
none. |
|
inlinestatic |
This function serves to set pipe for RF Tx.
p | - RF Optional range . |
|
inlinestatic |
This function serves to set CRC value for RF.
[in] | crc | - CRC value. |
|
inlinestatic |
This function serves to set CRC advantage.
none. |
|
inlinestatic |
This function serves to set RF access code.
[in] | p | - the address to access. |
|
inlinestatic |
This function serves to set RF access code value.
[in] | ac | - the address value. |
|
inlinestatic |
This function serves to set RF access code advantage.
none. |
|
inlinestatic |
This function serves to set RF access code 6bit to 32bit.
[in] | code | - the access code. |
|
inlinestatic |
This function serves to set RF access code 6bit to 32bit.
[in] | code | - the access code. |
|
inlinestatic |
This function serves to judge the statue of RF receive.
none. |
void rf_set_channel_500k | ( | signed short | chn, |
unsigned short | set | ||
) |
This function serves to set The channel .
[in] | RF_PowerTypeDef | - the RF power types. |
|
inlinestatic |
this function is to set shock burst for RF.
[in] | len | - length of shockburst. |
void rf_rx_cfg | ( | int | size, |
unsigned char | PingpongEn | ||
) |
This function.
[in] | size | - the expected size of dma2 |
[in] | PingpongEn | - the flag of g_RFRxPingpongEn |
unsigned short crc16_ccitt_cal | ( | unsigned char * | input, |
unsigned int | len, | ||
unsigned short | init_val | ||
) |
This function serves to get CRC.
[in] | *input | - the content of payload |
[in] | len | - the length of payload |
[in] | init_val | - the initial value of CRC |
void rf_tx_500k_simulate_100k | ( | unsigned char * | preamble, |
unsigned char | preamble_len, | ||
unsigned char * | acc_code, | ||
unsigned char | acc_len, | ||
unsigned char * | payload, | ||
unsigned char | pld_len, | ||
unsigned char * | tx_buf, | ||
unsigned short | crc_init | ||
) |
This function serves to simulate 100k Tx by 500k Tx.
[in] | *preamble | - the content of preamble |
[in] | preamble_len | - the length of preamble |
[in] | *acc_code | - the content of access code |
[in] | acc_len | - the length of access code |
[in] | *payload | - the content of payload |
[in] | pld_len | - the length of payload |
[in] | *tx_buf | - the data need to be sent |
[in] | crc_init | - the initial value of CRC |
void rf_ed_detecct_154 | ( | void | ) |
This function is to start energy detect of the current channel for zigbee mode Before using it.
[in] | none |
unsigned char rf_stop_ed_154 | ( | void | ) |
This function is to stop energy detect and get energy detect value of the current channel for zigbee mode.
none |
void rf_rffe_set_pin | ( | RF_PATxPinDef | tx_pin, |
RF_LNARxPinDef | rx_pin | ||
) |
This function serves to set pin for RFFE of RF.
[in] | tx_pin | - select pin to send |
[in] | rx_pin | - select pin to receive |
unsigned char rx_packet_process_1mbps | ( | unsigned char * | rx_buf, |
unsigned int | len | ||
) |
This function process the received packet in 1mbps shockburst mode only for hanshow for the compatiblity with third-party chips. The process includes data-whitening transformation and crc check.
[in] | rx_buf | - the rf rx buffer containing the received packet(dma length+payload+3 byte crc) |
[in] | len | - the expected rx length of shockburst mode, containing payload and 3byte crc |
void tx_packet_process_1mbps | ( | unsigned char * | tx_buf, |
unsigned char * | payload, | ||
unsigned int | len | ||
) |
This function process the tx packet in 1mbps shockburst mode only for hanshow for the compatiblity with third-party chips. The process includes data-whitening transformation and crc padding.
[in] | tx_buf | - the rf tx buffer containing the tx packet(dma length+payload+3 byte crc) |
[in] | len | - the expected tx length of shockburst mode, containing payload and 3byte crc |
const RF_PowerTypeDef rf_power_Level_list[60] |