mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-08 20:21:04 +00:00
feat(gdma): set burst size and return alignment constraint
burst size can affect the buffer alignment
This commit is contained in:
@@ -62,6 +62,9 @@ extern "C" {
|
||||
|
||||
#define GDMA_LL_AHB_DESC_ALIGNMENT 4
|
||||
|
||||
#define GDMA_LL_AHB_BURST_SIZE_ADJUSTABLE 1 // AHB GDMA supports adjustable burst size
|
||||
#define GDMA_LL_AHB_RX_BURST_NEEDS_ALIGNMENT 1
|
||||
|
||||
///////////////////////////////////// Common /////////////////////////////////////////
|
||||
|
||||
/**
|
||||
@@ -177,20 +180,20 @@ static inline void gdma_ll_rx_reset_channel(gdma_dev_t *dev, uint32_t channel)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set DMA RX channel memory block size based on the alignment requirement
|
||||
* @param align Supported value: 16/32/64
|
||||
* @brief Set DMA RX channel memory block size based on the burst requirement
|
||||
* @param burst_sz Supported value: 16/32/64
|
||||
*/
|
||||
static inline void gdma_ll_rx_set_ext_mem_block_size(gdma_dev_t *dev, uint32_t channel, uint8_t align)
|
||||
static inline void gdma_ll_rx_set_burst_size(gdma_dev_t *dev, uint32_t channel, uint32_t burst_sz)
|
||||
{
|
||||
uint32_t block_size = 0;
|
||||
switch (align) {
|
||||
case 64: // 64 Bytes alignment
|
||||
switch (burst_sz) {
|
||||
case 64:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_64B;
|
||||
break;
|
||||
case 32: // 32 Bytes alignment
|
||||
case 32:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_32B;
|
||||
break;
|
||||
case 16: // 16 Bytes alignment
|
||||
case 16:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_16B;
|
||||
break;
|
||||
default:
|
||||
@@ -461,20 +464,20 @@ static inline void gdma_ll_tx_reset_channel(gdma_dev_t *dev, uint32_t channel)
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Set DMA TX channel memory block size based on the alignment requirement
|
||||
* @param align Supported value: 16/32/64
|
||||
* @brief Set DMA TX channel memory block size based on the burst requirement
|
||||
* @param burst_sz Supported value: 16/32/64
|
||||
*/
|
||||
static inline void gdma_ll_tx_set_ext_mem_block_size(gdma_dev_t *dev, uint32_t channel, uint8_t align)
|
||||
static inline void gdma_ll_tx_set_burst_size(gdma_dev_t *dev, uint32_t channel, uint32_t burst_sz)
|
||||
{
|
||||
uint32_t block_size = 0;
|
||||
switch (align) {
|
||||
case 64: // 64 Bytes alignment
|
||||
switch (burst_sz) {
|
||||
case 64:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_64B;
|
||||
break;
|
||||
case 32: // 32 Bytes alignment
|
||||
case 32:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_32B;
|
||||
break;
|
||||
case 16: // 16 Bytes alignment
|
||||
case 16:
|
||||
block_size = GDMA_LL_EXT_MEM_BK_SIZE_16B;
|
||||
break;
|
||||
default:
|
||||
|
Reference in New Issue
Block a user