PAN1080 Peripheral API
|
Private rf Interface. More...
Modules | |
Private rf mode type | |
Private rf mode type definitions. | |
Private rf address lenth type | |
Private rf address lenth type definitions. | |
Private rf chip mode type | |
Private rf chip mode type definitions. | |
Private rf buf memory address offset | |
Private rf buf memory address offset definitions. | |
Macros | |
#define | LLHWC_READ32_REG(base_addr, reg_ofst) (*(volatile uint32_t *)((0x50020000) + (base_addr) + (reg_ofst))) |
Read 32 bit register value. More... | |
#define | LLHWC_WRITE32_REG(base_addr, reg_ofst, data) (*(volatile uint32_t *)(((0x50020000) + (base_addr) + (reg_ofst))) = (data)) |
Write value to 32 bit register. More... | |
#define | READ_4_BYTES(pckt, pos) |
Read 4 byte with byte read mode. More... | |
#define | PRI_RF_WRITE_REG_VALUE(base, Reg, Func, Value) (base->Reg = (base->Reg & ~(Reg##_##Func##_Msk)) | ((Value << Reg##_##Func##_Pos) & Reg##_##Func##_Msk)) |
Write value to register. More... | |
#define | PRI_RF_READ_REG_VALUE(base, Reg, Func) ((base->Reg & (Reg##_##Func##_Msk)) >> Reg##_##Func##_Pos) |
Read value to register. More... | |
#define | PRI_RF_SET_FUNC_ENABLE(base, Reg, Func, State) ((State == ENABLE) ? (base->Reg |= Reg##_##Func##_Msk) : (base->Reg &= ~Reg##_##Func##_Msk)) |
Set function according to state. More... | |
Functions | |
__STATIC_INLINE void | PRI_RF_AutoAnlsPayloadEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable auto analysis payload function. More... | |
__STATIC_INLINE void | PRI_RF_CrcCheckEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable crc check function. More... | |
__STATIC_INLINE void | PRI_RF_Crc16Select (PRI_RF_T *rf, FunctionalState NewState) |
This function select crc check mode. More... | |
__STATIC_INLINE void | PRI_RF_ScambleEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable scamble function. More... | |
__STATIC_INLINE void | PRI_RF_NordicEnhanceEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable enhance mode2(compatible with nordic) More... | |
__STATIC_INLINE uint8_t | PRI_RF_IsNordicEnhance (PRI_RF_T *rf) |
This function used to adjuest enhance mode2 enable or not. More... | |
__STATIC_INLINE void | PRI_RF_EnhanceEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable enhance mode. More... | |
__STATIC_INLINE uint8_t | PRI_RF_IsEnhance (PRI_RF_T *rf) |
This function used to adjuest enhance mode is enable or not. More... | |
__STATIC_INLINE void | PRI_RF_BandWidth2mSel (PRI_RF_T *rf, FunctionalState NewState) |
This function used to set band width, 1Mbps or 2Mbps can selected. More... | |
__STATIC_INLINE void | PRI_RF_ChipModeSel (PRI_RF_T *rf, uint8_t modeSel) |
This function used to select chip mode. More... | |
__STATIC_INLINE uint8_t | PRI_RF_GetChipMode (PRI_RF_T *rf) |
This function used to get chip mode. More... | |
__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. More... | |
__STATIC_INLINE uint8_t | PRI_RF_IsRxAckEn (PRI_RF_T *rf) |
This function used to adjust rx ack is enable or not. More... | |
__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,then rx ack is no needed More... | |
__STATIC_INLINE uint8_t | PRI_RF_IsTxNoAckEn (PRI_RF_T *rf) |
This function used to adjuest tx no ack is enable or not. More... | |
__STATIC_INLINE void | PRI_RF_TrxFuncSel (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable tx or rx function. More... | |
__STATIC_INLINE uint8_t | PRI_RF_IsRxSel (PRI_RF_T *rf) |
This function used to adjust rx function is enable or not. More... | |
__STATIC_INLINE void | PRI_RF_ClearAllIrqEn (PRI_RF_T *rf, FunctionalState NewState) |
This function used to enable or disable all interrupt clear function. More... | |
__STATIC_INLINE void | PRI_RF_IntMask (PRI_RF_T *rf, uint32_t msk, FunctionalState NewState) |
This function used to set interrupt mask. More... | |
__STATIC_INLINE bool | PRI_RF_IntFlag (PRI_RF_T *rf, uint32_t msk) |
This function used to read interrupt flag. More... | |
__STATIC_INLINE void | PRI_RF_ForceExitRx (PRI_RF_T *rf, FunctionalState NewState) |
This function used to force exit rx mode. More... | |
__STATIC_INLINE void | PRI_RF_SetTrxTransWaitTime (PRI_RF_T *rf, uint16_t time) |
This function used to set tx& rx transmit wait time. More... | |
void | ana_prf_ldo_en (void) |
This function used to enable private radio ldo. More... | |
void | ana_prf_ldo_dis (void) |
This function used to disable private radio ldo. More... | |
void | PRI_RF_SetTrxPayloadLen (PRI_RF_T *rf, uint8_t mode, uint8_t len) |
This function used to set private rf payload lenth. More... | |
bool | PRI_RF_SetAddrByteLen (PRI_RF_T *rf, uint8_t len) |
This function used to set private rf address byte lenth. More... | |
void | PRI_RF_SetPidManualEn (PRI_RF_T *rf, uint8_t pid) |
This function used to set pid manual. More... | |
void | PRI_RF_SetRxWaitTime (PRI_RF_T *rf, uint16_t time) |
This function used to set rx wait time. More... | |
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. More... | |
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. More... | |
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. More... | |
void | PRI_RF_SetTrxRamReady (PRI_RF_T *rf, uint8_t mode, uint8_t ready) |
This function used to set private rf ram ready state. More... | |
Private rf Interface.
#define LLHWC_READ32_REG | ( | base_addr, | |
reg_ofst | |||
) | (*(volatile uint32_t *)((0x50020000) + (base_addr) + (reg_ofst))) |
Read 32 bit register value.
[in] | base_addr | Module base address |
[in] | reg_ofst | register address offset |
#define LLHWC_WRITE32_REG | ( | base_addr, | |
reg_ofst, | |||
data | |||
) | (*(volatile uint32_t *)(((0x50020000) + (base_addr) + (reg_ofst))) = (data)) |
Write value to 32 bit register.
[in] | base_addr | Module base address |
[in] | reg_ofst | register address offset |
[in] | data | register expect value |
#define PRI_RF_READ_REG_VALUE | ( | base, | |
Reg, | |||
Func | |||
) | ((base->Reg & (Reg##_##Func##_Msk)) >> Reg##_##Func##_Pos) |
Read value to register.
[in] | base | Module base address |
[in] | Reg | register address |
[in] | Func | register function |
#define PRI_RF_SET_FUNC_ENABLE | ( | base, | |
Reg, | |||
Func, | |||
State | |||
) | ((State == ENABLE) ? (base->Reg |= Reg##_##Func##_Msk) : (base->Reg &= ~Reg##_##Func##_Msk)) |
Set function according to state.
[in] | base | Module base address |
[in] | Reg | register address |
[in] | Func | register function |
[in] | State | enable state |
#define PRI_RF_WRITE_REG_VALUE | ( | base, | |
Reg, | |||
Func, | |||
Value | |||
) | (base->Reg = (base->Reg & ~(Reg##_##Func##_Msk)) | ((Value << Reg##_##Func##_Pos) & Reg##_##Func##_Msk)) |
Write value to register.
[in] | base | Module base address |
[in] | Reg | register address |
[in] | Func | register function |
[in] | Value | register expect value |
#define READ_4_BYTES | ( | pckt, | |
pos | |||
) |
Read 4 byte with byte read mode.
[in] | pckt | Base address |
[in] | pos | address offset |
void ana_prf_ldo_dis | ( | void | ) |
This function used to disable private radio ldo.
void ana_prf_ldo_en | ( | void | ) |
This function used to enable private radio ldo.
__STATIC_INLINE void PRI_RF_AutoAnlsPayloadEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable auto analysis payload function.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_BandWidth2mSel | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to set band width, 1Mbps or 2Mbps can selected.
rf | where rf is a private rf peripheral base address |
NewState | state of 2Mbps selected,if 1,2Mbps selected, or 1Mbps selected |
__STATIC_INLINE void PRI_RF_ChipModeSel | ( | PRI_RF_T * | rf, |
uint8_t | modeSel | ||
) |
This function used to select chip mode.
rf | where rf is a private rf peripheral base address |
modeSel | chip mode select,including: PRI_RF_CHIP_MODE_INVALID PRI_RF_CHIP_MODE_BLE PRI_RF_CHIP_MODE_297 PRI_RF_CHIP_MODE_NORDIC |
__STATIC_INLINE void PRI_RF_ClearAllIrqEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable all interrupt clear function.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_Crc16Select | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function select crc check mode.
rf | where rf is a private rf peripheral base address |
NewState | new state of crc16 select,if enable,crc16 selected,or crc8 selected |
__STATIC_INLINE void PRI_RF_CrcCheckEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable crc check function.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_EnhanceEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable enhance mode.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_ForceExitRx | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to force exit rx mode.
rf | where rf is a private rf peripheral base address |
NewState | new state of force exit function |
__STATIC_INLINE uint8_t PRI_RF_GetChipMode | ( | PRI_RF_T * | rf | ) |
This function used to get chip mode.
rf | where rf is a private rf peripheral base address |
__STATIC_INLINE bool PRI_RF_IntFlag | ( | PRI_RF_T * | rf, |
uint32_t | msk | ||
) |
This function used to read interrupt flag.
rf | where rf is a private rf peripheral base address |
msk | interrupt flag bit,including: R01_INT_CTL_RX_CRC_ERR_Msk R01_INT_CTL_TX_TIMEOUT_IRQ_Msk R01_INT_CTL_TX_IRQ_Msk R01_INT_CTL_RX_IRQ_Msk |
__STATIC_INLINE void PRI_RF_IntMask | ( | PRI_RF_T * | rf, |
uint32_t | msk, | ||
FunctionalState | NewState | ||
) |
This function used to set interrupt mask.
rf | where rf is a private rf peripheral base address |
msk | interrupt mask bit,including: R01_INT_CTL_RX_CRC_ERR_MASK_Msk R01_INT_CTL_TX_TIMEOUT_IRQ_MASK_Msk R01_INT_CTL_TX_IRQ_MASK_Msk R01_INT_CTL_RX_IRQ_MASK_Msk |
NewState | new state of interrupt mask |
__STATIC_INLINE uint8_t PRI_RF_IsEnhance | ( | PRI_RF_T * | rf | ) |
This function used to adjuest enhance mode is enable or not.
rf | where rf is a private rf peripheral base address |
__STATIC_INLINE uint8_t PRI_RF_IsNordicEnhance | ( | PRI_RF_T * | rf | ) |
This function used to adjuest enhance mode2 enable or not.
rf | where rf is a private rf peripheral base address |
__STATIC_INLINE uint8_t PRI_RF_IsRxAckEn | ( | PRI_RF_T * | rf | ) |
This function used to adjust rx ack is enable or not.
rf | where rf is a private rf peripheral base address |
__STATIC_INLINE uint8_t PRI_RF_IsRxSel | ( | PRI_RF_T * | rf | ) |
This function used to adjust rx function is enable or not.
rf | where rf is a private rf peripheral base address |
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.
rf | where rf is a private rf peripheral base address |
mode | tx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX |
true | ram is ready |
false | ram is not ready |
__STATIC_INLINE uint8_t PRI_RF_IsTxNoAckEn | ( | PRI_RF_T * | rf | ) |
This function used to adjuest tx no ack is enable or not.
rf | where rf is a private rf peripheral base address |
__STATIC_INLINE void PRI_RF_NordicEnhanceEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable enhance mode2(compatible with nordic)
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__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.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_ScambleEn | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable or disable scamble function.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
bool PRI_RF_SetAddrByteLen | ( | PRI_RF_T * | rf, |
uint8_t | len | ||
) |
This function used to set private rf address byte lenth.
rf | where rf is a private rf peripheral base address |
len | address byte lenth ,including: PRI_RF_ADDR_BYTE_LEN_INVALID PRI_RF_ADDR_BYTE_LEN_3 PRI_RF_ADDR_BYTE_LEN_4 PRI_RF_ADDR_BYTE_LEN_5 |
true | value valid |
false | value invalid |
void PRI_RF_SetPidManualEn | ( | PRI_RF_T * | rf, |
uint8_t | pid | ||
) |
This function used to set pid manual.
rf | where rf is a private rf peripheral base address |
pid | pid value |
none |
void PRI_RF_SetRxWaitTime | ( | PRI_RF_T * | rf, |
uint16_t | time | ||
) |
This function used to set rx wait time.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
none |
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.
rf | where rf is a private rf peripheral base address |
mode | tx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX |
addr | addr base address |
none |
void PRI_RF_SetTrxPayloadLen | ( | PRI_RF_T * | rf, |
uint8_t | mode, | ||
uint8_t | len | ||
) |
This function used to set private rf payload lenth.
rf | where rf is a private rf peripheral base address |
mode | tx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX |
len | payload lenth |
none |
void PRI_RF_SetTrxRamReady | ( | PRI_RF_T * | rf, |
uint8_t | mode, | ||
uint8_t | ready | ||
) |
This function used to set private rf ram ready state.
rf | where rf is a private rf peripheral base address |
mode | tx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX |
ready | ready state |
none |
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.
rf | where rf is a private rf peripheral base address |
mode | tx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX |
addr | addr base address |
none |
__STATIC_INLINE void PRI_RF_SetTrxTransWaitTime | ( | PRI_RF_T * | rf, |
uint16_t | time | ||
) |
This function used to set tx& rx transmit wait time.
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |
__STATIC_INLINE void PRI_RF_TrxFuncSel | ( | PRI_RF_T * | rf, |
FunctionalState | NewState | ||
) |
This function used to enable tx or rx function.
rf | where rf is a private rf peripheral base address |
NewState | new state of function control state,if enabled,rx function enabled, or tx function enabled |
__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,then rx ack is no needed
rf | where rf is a private rf peripheral base address |
NewState | new state of enabling state |