PAN1080 Peripheral API
Modules | Macros | Functions
Private rf Interface

Private rf Interface. More...

Collaboration diagram for Private rf Interface:

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...
 

Detailed Description

Private rf Interface.

Macro Definition Documentation

◆ LLHWC_READ32_REG

#define LLHWC_READ32_REG (   base_addr,
  reg_ofst 
)     (*(volatile uint32_t *)((0x50020000) + (base_addr) + (reg_ofst)))

Read 32 bit register value.

Parameters
[in]base_addrModule base address
[in]reg_ofstregister address offset

◆ LLHWC_WRITE32_REG

#define LLHWC_WRITE32_REG (   base_addr,
  reg_ofst,
  data 
)     (*(volatile uint32_t *)(((0x50020000) + (base_addr) + (reg_ofst))) = (data))

Write value to 32 bit register.

Parameters
[in]base_addrModule base address
[in]reg_ofstregister address offset
[in]dataregister expect value

◆ PRI_RF_READ_REG_VALUE

#define PRI_RF_READ_REG_VALUE (   base,
  Reg,
  Func 
)     ((base->Reg & (Reg##_##Func##_Msk)) >> Reg##_##Func##_Pos)

Read value to register.

Parameters
[in]baseModule base address
[in]Regregister address
[in]Funcregister function

◆ PRI_RF_SET_FUNC_ENABLE

#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.

Parameters
[in]baseModule base address
[in]Regregister address
[in]Funcregister function
[in]Stateenable state

◆ PRI_RF_WRITE_REG_VALUE

#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.

Parameters
[in]baseModule base address
[in]Regregister address
[in]Funcregister function
[in]Valueregister expect value

◆ READ_4_BYTES

#define READ_4_BYTES (   pckt,
  pos 
)
Value:
(((uint32_t) (pckt)[pos]) | \
(((uint32_t) (pckt)[pos + 1]) << 8) | \
(((uint32_t) (pckt)[pos + 2]) << 16) | \
(((uint32_t) (pckt)[pos + 3]) << 24))

Read 4 byte with byte read mode.

Parameters
[in]pcktBase address
[in]posaddress offset

Function Documentation

◆ ana_prf_ldo_dis()

void ana_prf_ldo_dis ( void  )

This function used to disable private radio ldo.

Returns
none

◆ ana_prf_ldo_en()

void ana_prf_ldo_en ( void  )

This function used to enable private radio ldo.

Returns
none

◆ PRI_RF_AutoAnlsPayloadEn()

__STATIC_INLINE void PRI_RF_AutoAnlsPayloadEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable auto analysis payload function.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_BandWidth2mSel()

__STATIC_INLINE void PRI_RF_BandWidth2mSel ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to set band width, 1Mbps or 2Mbps can selected.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatestate of 2Mbps selected,if 1,2Mbps selected, or 1Mbps selected
Returns
none

◆ PRI_RF_ChipModeSel()

__STATIC_INLINE void PRI_RF_ChipModeSel ( PRI_RF_T *  rf,
uint8_t  modeSel 
)

This function used to select chip mode.

Parameters
rfwhere rf is a private rf peripheral base address
modeSelchip mode select,including: PRI_RF_CHIP_MODE_INVALID PRI_RF_CHIP_MODE_BLE
PRI_RF_CHIP_MODE_297
PRI_RF_CHIP_MODE_NORDIC
Returns
none

◆ PRI_RF_ClearAllIrqEn()

__STATIC_INLINE void PRI_RF_ClearAllIrqEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable all interrupt clear function.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_Crc16Select()

__STATIC_INLINE void PRI_RF_Crc16Select ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function select crc check mode.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of crc16 select,if enable,crc16 selected,or crc8 selected
Returns
none

◆ PRI_RF_CrcCheckEn()

__STATIC_INLINE void PRI_RF_CrcCheckEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable crc check function.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_EnhanceEn()

__STATIC_INLINE void PRI_RF_EnhanceEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable enhance mode.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_ForceExitRx()

__STATIC_INLINE void PRI_RF_ForceExitRx ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to force exit rx mode.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of force exit function
Returns
none

◆ PRI_RF_GetChipMode()

__STATIC_INLINE uint8_t PRI_RF_GetChipMode ( PRI_RF_T *  rf)

This function used to get chip mode.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
chip mode

◆ PRI_RF_IntFlag()

__STATIC_INLINE bool PRI_RF_IntFlag ( PRI_RF_T *  rf,
uint32_t  msk 
)

This function used to read interrupt flag.

Parameters
rfwhere rf is a private rf peripheral base address
mskinterrupt 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
Returns
true,interrupt happened
false,interrupt does not happened

◆ PRI_RF_IntMask()

__STATIC_INLINE void PRI_RF_IntMask ( PRI_RF_T *  rf,
uint32_t  msk,
FunctionalState  NewState 
)

This function used to set interrupt mask.

Parameters
rfwhere rf is a private rf peripheral base address
mskinterrupt 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
NewStatenew state of interrupt mask
Returns
none

◆ PRI_RF_IsEnhance()

__STATIC_INLINE uint8_t PRI_RF_IsEnhance ( PRI_RF_T *  rf)

This function used to adjuest enhance mode is enable or not.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
enable state

◆ PRI_RF_IsNordicEnhance()

__STATIC_INLINE uint8_t PRI_RF_IsNordicEnhance ( PRI_RF_T *  rf)

This function used to adjuest enhance mode2 enable or not.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
enable state

◆ PRI_RF_IsRxAckEn()

__STATIC_INLINE uint8_t PRI_RF_IsRxAckEn ( PRI_RF_T *  rf)

This function used to adjust rx ack is enable or not.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
enable state

◆ PRI_RF_IsRxSel()

__STATIC_INLINE uint8_t PRI_RF_IsRxSel ( PRI_RF_T *  rf)

This function used to adjust rx function is enable or not.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
none

◆ PRI_RF_IsTrxRamReady()

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.

Parameters
rfwhere rf is a private rf peripheral base address
modetx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX
Return values
trueram is ready
falseram is not ready

◆ PRI_RF_IsTxNoAckEn()

__STATIC_INLINE uint8_t PRI_RF_IsTxNoAckEn ( PRI_RF_T *  rf)

This function used to adjuest tx no ack is enable or not.

Parameters
rfwhere rf is a private rf peripheral base address
Returns
tx enable state

◆ PRI_RF_NordicEnhanceEn()

__STATIC_INLINE void PRI_RF_NordicEnhanceEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable enhance mode2(compatible with nordic)

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_RxAckEn()

__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.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_ScambleEn()

__STATIC_INLINE void PRI_RF_ScambleEn ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable or disable scamble function.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_SetAddrByteLen()

bool PRI_RF_SetAddrByteLen ( PRI_RF_T *  rf,
uint8_t  len 
)

This function used to set private rf address byte lenth.

Parameters
rfwhere rf is a private rf peripheral base address
lenaddress 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
Return values
truevalue valid
falsevalue invalid

◆ PRI_RF_SetPidManualEn()

void PRI_RF_SetPidManualEn ( PRI_RF_T *  rf,
uint8_t  pid 
)

This function used to set pid manual.

Parameters
rfwhere rf is a private rf peripheral base address
pidpid value
Return values
none

◆ PRI_RF_SetRxWaitTime()

void PRI_RF_SetRxWaitTime ( PRI_RF_T *  rf,
uint16_t  time 
)

This function used to set rx wait time.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Return values
none

◆ PRI_RF_SetTrxAddr()

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.

Parameters
rfwhere rf is a private rf peripheral base address
modetx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX
addraddr base address
Return values
none

◆ PRI_RF_SetTrxPayloadLen()

void PRI_RF_SetTrxPayloadLen ( PRI_RF_T *  rf,
uint8_t  mode,
uint8_t  len 
)

This function used to set private rf payload lenth.

Parameters
rfwhere rf is a private rf peripheral base address
modetx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX
lenpayload lenth
Return values
none

◆ PRI_RF_SetTrxRamReady()

void PRI_RF_SetTrxRamReady ( PRI_RF_T *  rf,
uint8_t  mode,
uint8_t  ready 
)

This function used to set private rf ram ready state.

Parameters
rfwhere rf is a private rf peripheral base address
modetx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX
readyready state
Return values
none

◆ PRI_RF_SetTrxRamStartAddr()

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.

Parameters
rfwhere rf is a private rf peripheral base address
modetx or rx mode select,including: PRI_RF_MODE_SEL_TX PRI_RF_MODE_SEL_RX PRI_RF_MODE_SEL_TRX
addraddr base address
Return values
none

◆ PRI_RF_SetTrxTransWaitTime()

__STATIC_INLINE void PRI_RF_SetTrxTransWaitTime ( PRI_RF_T *  rf,
uint16_t  time 
)

This function used to set tx& rx transmit wait time.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none

◆ PRI_RF_TrxFuncSel()

__STATIC_INLINE void PRI_RF_TrxFuncSel ( PRI_RF_T *  rf,
FunctionalState  NewState 
)

This function used to enable tx or rx function.

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of function control state,if enabled,rx function enabled, or tx function enabled
Returns
none

◆ PRI_RF_TxNoAckEn()

__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

Parameters
rfwhere rf is a private rf peripheral base address
NewStatenew state of enabling state
Returns
none