Skip to content

Commit

Permalink
Update dma_sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
LuigiGiuffrida98 committed Jul 31, 2024
1 parent 95452f6 commit f779879
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions sw/device/lib/sdk/dma/dma_sdk.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,12 @@ extern "C"
#define DMA_WAIT(CH) \
while (!dma_is_ready(CH)) \
{ \
CSR_CLEAR_BITS(CSR_REG_MSTATUS, 0x8); \
if (dma_is_ready(CH) == 0) \
{ \
wait_for_interrupt(); \
} \
CSR_SET_BITS(CSR_REG_MSTATUS, 0x8); \
}

/********************************/
Expand All @@ -65,7 +67,7 @@ extern "C"
*
* This function initializes the DMA SDK and prepares it for use.
*/
void dma_sdk_init(void);
void __attribute__((noinline)) dma_sdk_init(void);

/**
* @brief Copies data from source to destination using DMA.
Expand All @@ -78,7 +80,7 @@ extern "C"
* @param dst_type Destination variable type (byte, half-word, word).
* @param signed_data Indicates whether the data is signed or unsigned.
*/
void dma_copy(uint32_t dst_ptr, uint32_t src_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);
void __attribute__((noinline)) dma_copy(uint32_t dst_ptr, uint32_t src_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);

/**
* @brief Fills a memory region with a specified value using DMA.
Expand All @@ -91,13 +93,13 @@ extern "C"
* @param dst_type Destination variable type (byte, half-word, word).
* @param signed_data Indicates whether the data is signed or unsigned.
*/
void dma_fill(uint32_t dst_ptr, uint32_t value_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);
void __attribute__((noinline)) dma_fill(uint32_t dst_ptr, uint32_t value_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);

void __attribute__ ((noinline)) dma_copy_async(uint32_t dst_ptr, uint32_t src_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);
void __attribute__((noinline)) dma_copy_async(uint32_t dst_ptr, uint32_t src_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);

void __attribute__ ((noinline)) dma_fill_async(uint32_t dst_ptr, uint32_t value_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);
void __attribute__ ((noinline)) dma_wait(uint8_t channel);
void __attribute__((noinline)) dma_fill_async(uint32_t dst_ptr, uint32_t value_ptr, uint32_t size, uint8_t channel, dma_data_type_t src_type, dma_data_type_t dst_type, uint8_t signed_data);

void __attribute__((noinline)) dma_wait(uint8_t channel);

#ifdef __cplusplus
}
Expand Down

0 comments on commit f779879

Please sign in to comment.