14 *****************************************************************************/
15#ifndef __PAN_PRI_RF_H__
16#define __PAN_PRI_RF_H__
30#define PRI_RF_MODE_SEL_TX (0)
31#define PRI_RF_MODE_SEL_RX (1)
32#define PRI_RF_MODE_SEL_TRX (2)
38#define PRI_RF_ADDR_BYTE_LEN_INVALID (0)
39#define PRI_RF_ADDR_BYTE_LEN_3 (1)
40#define PRI_RF_ADDR_BYTE_LEN_4 (2)
41#define PRI_RF_ADDR_BYTE_LEN_5 (3)
47#define PRI_RF_CHIP_MODE_INVALID (0)
48#define PRI_RF_CHIP_MODE_BLE (1)
49#define PRI_RF_CHIP_MODE_297 (2)
50#define PRI_RF_CHIP_MODE_NORDIC (3)
56#define REG_FILE_OFST 0x0000
57#define SEQ_RAM_OFST 0x1000
58#define LIST_RAM_OFST 0x8000
59#define TX_RX_RAM_OFST 0x8200
60#define CTE_IQ_RAM_OFST 0xB7FC
69#define LLHWC_READ32_REG(base_addr, reg_ofst) \
70 (*(volatile uint32_t *)((0x50020000) + (base_addr) + (reg_ofst)))
78#define LLHWC_WRITE32_REG(base_addr, reg_ofst, data) \
79 (*(volatile uint32_t *)(((0x50020000) + (base_addr) + (reg_ofst))) = (data))
86#define READ_4_BYTES(pckt, pos) (((uint32_t) (pckt)[pos]) | \
87 (((uint32_t) (pckt)[pos + 1]) << 8) | \
88 (((uint32_t) (pckt)[pos + 2]) << 16) | \
89 (((uint32_t) (pckt)[pos + 3]) << 24))
99#define PRI_RF_WRITE_REG_VALUE(base,Reg,Func,Value) \
100 (base->Reg = (base->Reg & ~(Reg##_##Func##_Msk)) | ((Value << Reg##_##Func##_Pos) & Reg##_##Func##_Msk))
108#define PRI_RF_READ_REG_VALUE(base,Reg,Func) \
109 ((base->Reg & (Reg##_##Func##_Msk)) >> Reg##_##Func##_Pos)
118#define PRI_RF_SET_FUNC_ENABLE(base,Reg,Func,State) \
119 ((State == ENABLE) ? (base->Reg |= Reg##_##Func##_Msk) : (base->Reg &= ~Reg##_##Func##_Msk))
253 return (rf->R00_CTL & R00_CTL_RX_ACK_PAYLOAD_EN_Msk) >> R00_CTL_RX_ACK_PAYLOAD_EN_Pos;
273 return (rf->R00_CTL & R00_CTL_TX_NOACK_EN_Msk) >> R00_CTL_TX_NOACK_EN_Pos;
320__STATIC_INLINE
void PRI_RF_IntMask(PRI_RF_T *rf,uint32_t msk,FunctionalState NewState)
322 (NewState)?(rf->R01_INT_CTL |= msk):(rf->R01_INT_CTL &= ~msk);
338 return (rf->R01_INT_CTL & msk)?(
true):(
false);
void ana_prf_ldo_en(void)
This function used to enable private radio ldo.
void PRI_RF_SetTrxRamReady(PRI_RF_T *rf, uint8_t mode, uint8_t ready)
This function used to set private rf ram ready state.
bool PRI_RF_SetAddrByteLen(PRI_RF_T *rf, uint8_t len)
This function used to set private rf address byte lenth.
__STATIC_INLINE uint8_t PRI_RF_IsRxSel(PRI_RF_T *rf)
This function used to adjust rx function is enable or not.
Definition: pan_pri_rf.h:293
void PRI_RF_SetTrxPayloadLen(PRI_RF_T *rf, uint8_t mode, uint8_t len)
This function used to set private rf payload lenth.
#define PRI_RF_SET_FUNC_ENABLE(base, Reg, Func, State)
Set function according to state.
Definition: pan_pri_rf.h:118
__STATIC_INLINE void PRI_RF_RxAckEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable rx ack if rx with payload.
Definition: pan_pri_rf.h:242
__STATIC_INLINE void PRI_RF_AutoAnlsPayloadEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable auto analysis payload function.
Definition: pan_pri_rf.h:126
__STATIC_INLINE void PRI_RF_ForceExitRx(PRI_RF_T *rf, FunctionalState NewState)
This function used to force exit rx mode.
Definition: pan_pri_rf.h:347
void PRI_RF_SetTrxAddr(PRI_RF_T *rf, uint8_t mode, uint32_t *addr)
This function used to set private rf tx or rx address.
__STATIC_INLINE void PRI_RF_IntMask(PRI_RF_T *rf, uint32_t msk, FunctionalState NewState)
This function used to set interrupt mask.
Definition: pan_pri_rf.h:320
__STATIC_INLINE void PRI_RF_ClearAllIrqEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable all interrupt clear function.
Definition: pan_pri_rf.h:303
__STATIC_INLINE void PRI_RF_BandWidth2mSel(PRI_RF_T *rf, FunctionalState NewState)
This function used to set band width, 1Mbps or 2Mbps can selected.
Definition: pan_pri_rf.h:207
__STATIC_INLINE void PRI_RF_CrcCheckEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable crc check function.
Definition: pan_pri_rf.h:137
__STATIC_INLINE void PRI_RF_ScambleEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable scamble function.
Definition: pan_pri_rf.h:158
__STATIC_INLINE void PRI_RF_TrxFuncSel(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable tx or rx function.
Definition: pan_pri_rf.h:283
void PRI_RF_SetRxWaitTime(PRI_RF_T *rf, uint16_t time)
This function used to set rx wait time.
#define PRI_RF_READ_REG_VALUE(base, Reg, Func)
Read value to register.
Definition: pan_pri_rf.h:108
__STATIC_INLINE uint8_t PRI_RF_IsEnhance(PRI_RF_T *rf)
This function used to adjuest enhance mode is enable or not.
Definition: pan_pri_rf.h:197
void ana_prf_ldo_dis(void)
This function used to disable private radio ldo.
bool PRI_RF_IsTrxRamReady(PRI_RF_T *rf, uint8_t mode)
This function used to adjust private rf tx or rx ram state is ready or not.
__STATIC_INLINE void PRI_RF_ChipModeSel(PRI_RF_T *rf, uint8_t modeSel)
This function used to select chip mode.
Definition: pan_pri_rf.h:222
void PRI_RF_SetTrxRamStartAddr(PRI_RF_T *rf, uint8_t mode, uint32_t addr)
This function used to set private rf tx or rx ram start address.
__STATIC_INLINE uint8_t PRI_RF_IsTxNoAckEn(PRI_RF_T *rf)
This function used to adjuest tx no ack is enable or not.
Definition: pan_pri_rf.h:271
__STATIC_INLINE void PRI_RF_Crc16Select(PRI_RF_T *rf, FunctionalState NewState)
This function select crc check mode.
Definition: pan_pri_rf.h:148
void PRI_RF_SetPidManualEn(PRI_RF_T *rf, uint8_t pid)
This function used to set pid manual.
__STATIC_INLINE uint8_t PRI_RF_GetChipMode(PRI_RF_T *rf)
This function used to get chip mode.
Definition: pan_pri_rf.h:231
__STATIC_INLINE uint8_t PRI_RF_IsRxAckEn(PRI_RF_T *rf)
This function used to adjust rx ack is enable or not.
Definition: pan_pri_rf.h:251
__STATIC_INLINE bool PRI_RF_IntFlag(PRI_RF_T *rf, uint32_t msk)
This function used to read interrupt flag.
Definition: pan_pri_rf.h:336
__STATIC_INLINE uint8_t PRI_RF_IsNordicEnhance(PRI_RF_T *rf)
This function used to adjuest enhance mode2 enable or not.
Definition: pan_pri_rf.h:178
#define PRI_RF_WRITE_REG_VALUE(base, Reg, Func, Value)
Write value to register.
Definition: pan_pri_rf.h:99
__STATIC_INLINE void PRI_RF_EnhanceEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable enhance mode.
Definition: pan_pri_rf.h:188
__STATIC_INLINE void PRI_RF_TxNoAckEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable tx no ack if function enabled and tx works in enhance mode,...
Definition: pan_pri_rf.h:262
__STATIC_INLINE void PRI_RF_SetTrxTransWaitTime(PRI_RF_T *rf, uint16_t time)
This function used to set tx& rx transmit wait time.
Definition: pan_pri_rf.h:358
__STATIC_INLINE void PRI_RF_NordicEnhanceEn(PRI_RF_T *rf, FunctionalState NewState)
This function used to enable or disable enhance mode2(compatible with nordic)
Definition: pan_pri_rf.h:169