dma.h File Reference

Go to the source code of this file.

Macros

#define DMA_RFRX_LEN_HW_INFO   0
 
#define DMA_RFRX_OFFSET_HEADER   4
 
#define DMA_RFRX_OFFSET_RFLEN   5
 
#define DMA_RFRX_OFFSET_DATA   6
 
#define DMA_RFRX_OFFSET_CRC24(p)   (p[DMA_RFRX_OFFSET_RFLEN]+6)
 
#define DMA_RFRX_OFFSET_TIME_STAMP(p)   (p[DMA_RFRX_OFFSET_RFLEN]+9)
 
#define DMA_RFRX_OFFSET_FREQ_OFFSET(p)   (p[DMA_RFRX_OFFSET_RFLEN]+13)
 
#define DMA_RFRX_OFFSET_RSSI(p)   (p[DMA_RFRX_OFFSET_RFLEN]+15)
 
#define RFDMA_RX_DISABLE   (reg_dma_chn_en &= (~FLD_DMA_CHN_RF_RX))
 
#define RFDMA_RX_ENABLE   (reg_dma_chn_en |= (FLD_DMA_CHN_RF_RX))
 
#define RFDMA_TX_DISABLE   (reg_dma_chn_en &= (~FLD_DMA_CHN_RF_TX))
 
#define RFDMA_TX_ENABLE   (reg_dma_chn_en |= (FLD_DMA_CHN_RF_TX))
 

Enumerations

enum  DMA_chn_Typdef {
  DMA0_UART_RX, DMA1_UART_TX, DMA2_RF_RX, DMA3_RF_TX,
  DMA4_AES_DECO, DMA5_AES_CODE, DMA6, DMA7_PWM
}
 

Functions

static void dma_reset (void)
 This function resets the DMA module. More...
 
static void dma_irq_enable (unsigned int msk)
 This function performs to enable DMA. More...
 
static void dma_irq_disable (unsigned int msk)
 This function performs to enable DMA. More...
 
static void dma_chn_enable (unsigned char chn, unsigned int en)
 This function performs to enable DMA chnnel. More...
 
static void dma_chn_irq_enable (unsigned char chn, unsigned int en)
 This function performs to enable DMA interrupt. More...
 
static void dma_chn_irq_status_clr (unsigned char irq_status)
 Clear IRQ status of uart. More...
 
static unsigned char dma_chn_irq_status_get (void)
 Get IRQ status of uart. More...
 
static void dma_set_buff_size (DMA_chn_Typdef chn, unsigned int size)
 This function serves to set the size of dma buffer. More...
 

Macro Definition Documentation

◆ DMA_RFRX_LEN_HW_INFO

#define DMA_RFRX_LEN_HW_INFO   0

◆ DMA_RFRX_OFFSET_HEADER

#define DMA_RFRX_OFFSET_HEADER   4

◆ DMA_RFRX_OFFSET_RFLEN

#define DMA_RFRX_OFFSET_RFLEN   5

◆ DMA_RFRX_OFFSET_DATA

#define DMA_RFRX_OFFSET_DATA   6

◆ DMA_RFRX_OFFSET_CRC24

#define DMA_RFRX_OFFSET_CRC24 (   p)    (p[DMA_RFRX_OFFSET_RFLEN]+6)

◆ DMA_RFRX_OFFSET_TIME_STAMP

#define DMA_RFRX_OFFSET_TIME_STAMP (   p)    (p[DMA_RFRX_OFFSET_RFLEN]+9)

◆ DMA_RFRX_OFFSET_FREQ_OFFSET

#define DMA_RFRX_OFFSET_FREQ_OFFSET (   p)    (p[DMA_RFRX_OFFSET_RFLEN]+13)

◆ DMA_RFRX_OFFSET_RSSI

#define DMA_RFRX_OFFSET_RSSI (   p)    (p[DMA_RFRX_OFFSET_RFLEN]+15)

◆ RFDMA_RX_DISABLE

#define RFDMA_RX_DISABLE   (reg_dma_chn_en &= (~FLD_DMA_CHN_RF_RX))

◆ RFDMA_RX_ENABLE

#define RFDMA_RX_ENABLE   (reg_dma_chn_en |= (FLD_DMA_CHN_RF_RX))

◆ RFDMA_TX_DISABLE

#define RFDMA_TX_DISABLE   (reg_dma_chn_en &= (~FLD_DMA_CHN_RF_TX))

◆ RFDMA_TX_ENABLE

#define RFDMA_TX_ENABLE   (reg_dma_chn_en |= (FLD_DMA_CHN_RF_TX))

Enumeration Type Documentation

◆ DMA_chn_Typdef

Enumerator
DMA0_UART_RX 
DMA1_UART_TX 
DMA2_RF_RX 
DMA3_RF_TX 
DMA4_AES_DECO 
DMA5_AES_CODE 
DMA6 
DMA7_PWM 

Function Documentation

◆ dma_reset()

static void dma_reset ( void  )
inlinestatic

This function resets the DMA module.

Parameters
[in]none
Returns
none

◆ dma_irq_enable()

static void dma_irq_enable ( unsigned int  msk)
inlinestatic

This function performs to enable DMA.

Parameters
[in]msk- variable to config.
Returns
none.

◆ dma_irq_disable()

static void dma_irq_disable ( unsigned int  msk)
inlinestatic

This function performs to enable DMA.

Parameters
[in]msk- variable to config.
Returns
none.

◆ dma_chn_enable()

static void dma_chn_enable ( unsigned char  chn,
unsigned int  en 
)
inlinestatic

This function performs to enable DMA chnnel.

Parameters
[in]en- en: 1 enable. 0 disable.
Returns
none.

◆ dma_chn_irq_enable()

static void dma_chn_irq_enable ( unsigned char  chn,
unsigned int  en 
)
inlinestatic

This function performs to enable DMA interrupt.

Parameters
[in]chn- variable to config the DMA interrupt channel.
[in]en- en: 1 enable. 0 disable.
Returns
none.

◆ dma_chn_irq_status_clr()

static void dma_chn_irq_status_clr ( unsigned char  irq_status)
inlinestatic

Clear IRQ status of uart.

Parameters
[in]irq_src- select tx or rx irq.
Returns
none

◆ dma_chn_irq_status_get()

static unsigned char dma_chn_irq_status_get ( void  )
inlinestatic

Get IRQ status of uart.

Parameters
[in]irq_src- select tx or rx irq.
Returns
none

◆ dma_set_buff_size()

static void dma_set_buff_size ( DMA_chn_Typdef  chn,
unsigned int  size 
)
inlinestatic

This function serves to set the size of dma buffer.

Parameters
[in]size- select tx or rx irq. caution: max size = 2048
Returns
none