bf0_hal_ext_dma.h
EXT_DMA Configuration Structure definition.
- Author
Sifli software development team
Defines
-
EDMA_SRCFMT_RGB565
-
EDMA_SRCFMT_RGB888
-
EDMA_SRCFMT_ARGB8888
-
HAL_EXT_DMA_ERROR_NONE
No error
-
HAL_EXT_DMA_ERROR_TE
Transfer error
-
HAL_EXT_DMA_ERROR_NO_XFER
Abort requested with no Xfer ongoing
-
HAL_EXT_DMA_ERROR_TIMEOUT
Timeout error
-
HAL_EXT_DMA_ERROR_NOT_SUPPORTED
Not supported mode
-
HAL_EXT_DMA_ERROR_SIZE_ERR
Transfer size error
-
HAL_EXT_DMA_ERROR_OVERFLOW
Overflow error occurred
-
HAL_EXT_DMA_SRC_BURST1
-
HAL_EXT_DMA_SRC_BURST4
-
HAL_EXT_DMA_SRC_BURST8
-
HAL_EXT_DMA_SRC_BURST16
Burst 16 while
-
HAL_EXT_DMA_SRC_INC
Source address increase itself
-
HAL_EXT_DMA_DST_BURST1
-
HAL_EXT_DMA_DST_BURST4
-
HAL_EXT_DMA_DST_BURST8
-
HAL_EXT_DMA_DST_BURST16
-
HAL_EXT_DMA_DST_INC
-
MAX_CMPR_TBL_SIZE
-
HAL_EXT_DMA_SINGLE_MAX
-
__HAL_EXT_DMA_RESET_HANDLE_STATE(__HANDLE__)
Reset EXT_DMA handle state.
- 参数:
__HANDLE__ – DMA handle
- 返回值:
None –
-
__HAL_EXT_DMA_ENABLE(__HANDLE__)
Enable the EXT_DMA .
- 参数:
__HANDLE__ – DMA handle
- 返回值:
None –
-
__HAL_EXT_DMA_DISABLE(__HANDLE__)
Disable the specified DMA Channel.
- 参数:
__HANDLE__ – DMA handle
- 返回值:
None –
-
__HAL_EXT_DMA_GET_FLAG(__HANDLE__, __FLAG__)
Get the DMA Channel pending flags.
- 参数:
__HANDLE__ – DMA handle
__FLAG__ – Get the specified flag. This parameter can be any combination of the following values:
DMA_FLAG_TCx: Transfer complete flag
DMA_FLAG_HTx: Half transfer complete flag
DMA_FLAG_TEx: Transfer error flag
DMA_FLAG_GLx: Global interrupt flag Where x can be from 1 to 7 to select the DMA Channel x flag.
- 返回值:
The – state of FLAG (SET or RESET).
-
__HAL_EXT_DMA_CLEAR_FLAG(__HANDLE__, __FLAG__)
Clear the DMA Channel pending flags.
- 参数:
__HANDLE__ – DMA handle
__FLAG__ – specifies the flag to clear. This parameter can be any combination of the following values:
DMA_FLAG_TCx: Transfer complete flag
DMA_FLAG_HTx: Half transfer complete flag
DMA_FLAG_TEx: Transfer error flag
DMA_FLAG_GLx: Global interrupt flag Where x can be from 1 to 7 to select the DMA Channel x flag.
- 返回值:
None –
-
__HAL_EXT_DMA_ENABLE_IT(__HANDLE__, __INTERRUPT__)
Enable the specified DMA Channel interrupts.
- 参数:
__HANDLE__ – DMA handle
__INTERRUPT__ – specifies the DMA interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
DMA_IT_TC: Transfer complete interrupt mask
DMA_IT_HT: Half transfer complete interrupt mask
DMA_IT_TE: Transfer error interrupt mask
- 返回值:
None –
-
__HAL_EXT_DMA_DISABLE_IT(__HANDLE__, __INTERRUPT__)
Disable the specified DMA Channel interrupts.
- 参数:
__HANDLE__ – DMA handle
__INTERRUPT__ – specifies the DMA interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
DMA_IT_TC: Transfer complete interrupt mask
DMA_IT_HT: Half transfer complete interrupt mask
DMA_IT_TE: Transfer error interrupt mask
- 返回值:
None –
-
__HAL_EXT_DMA_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)
Check whether the specified DMA Channel interrupt is enabled or not.
- 参数:
__HANDLE__ – DMA handle
__INTERRUPT__ – specifies the DMA interrupt source to check. This parameter can be one of the following values:
DMA_IT_TC: Transfer complete interrupt mask
DMA_IT_HT: Half transfer complete interrupt mask
DMA_IT_TE: Transfer error interrupt mask
- 返回值:
The – state of DMA_IT (SET or RESET).
-
__HAL_EXT_DMA_GET_COUNTER(__HANDLE__)
Return the number of remaining data units in the current DMA Channel transfer.
- 参数:
__HANDLE__ – DMA handle
- 返回值:
The – number of remaining data units in the current DMA Channel transfer.
-
ROUNDED_TARGET_SIZE(w, num, denom)
-
TARGET_SIZE_TO_CMPR_WORDS(size)
-
CMPR_1_RGB565_TGT_SIZE(uncmpr_words)
-
CMPR_2_RGB565_TGT_SIZE(uncmpr_words)
-
CMPR_3_RGB565_TGT_SIZE(uncmpr_words)
-
CMPR_1_RGB888_TGT_SIZE(uncmpr_words)
-
CMPR_2_RGB888_TGT_SIZE(uncmpr_words)
-
CMPR_3_RGB888_TGT_SIZE(uncmpr_words)
-
CMPR_1_ARGB8888_TGT_SIZE(uncmpr_words)
-
CMPR_2_ARGB8888_TGT_SIZE(uncmpr_words)
-
CMPR_3_ARGB8888_TGT_SIZE(uncmpr_words)
-
CMPR_0_TGT_SIZE(uncmpr_words)
Typedefs
-
typedef struct __EXT_DMA_HandleTypeDef EXT_DMA_HandleTypeDef
EXT_DMA handle Structure definition.
Enums
-
enum HAL_EXT_DMA_StateTypeDef
HAL EXT_DMA State structures definition.
Values:
-
enumerator HAL_EXT_DMA_STATE_RESET
DMA not yet initialized or disabled
-
enumerator HAL_EXT_DMA_STATE_READY
DMA initialized and ready for use
-
enumerator HAL_EXT_DMA_STATE_BUSY
DMA process is ongoing
-
enumerator HAL_EXT_DMA_STATE_TIMEOUT
DMA timeout state
-
enumerator HAL_EXT_DMA_STATE_RESET
-
enum HAL_EXT_DMA_LevelCompleteTypeDef
HAL EXT_DMA Error Code structure definition.
Values:
-
enumerator HAL_EXT_DMA_FULL_TRANSFER
Full transfer
-
enumerator HAL_EXT_DMA_HALF_TRANSFER
Half Transfer
-
enumerator HAL_EXT_DMA_FULL_TRANSFER
-
enum HAL_EXT_DMA_CallbackIDTypeDef
HAL EXT_DMA Callback ID structure definition.
Values:
-
enumerator HAL_EXT_DMA_XFER_CPLT_CB_ID
Full transfer
-
enumerator HAL_EXT_DMA_XFER_HALFCPLT_CB_ID
Half transfer
-
enumerator HAL_EXT_DMA_XFER_ERROR_CB_ID
Error
-
enumerator HAL_EXT_DMA_XFER_ABORT_CB_ID
Abort
-
enumerator HAL_EXT_DMA_XFER_ALL_CB_ID
All
-
enumerator HAL_EXT_DMA_XFER_CPLT_CB_ID
Functions
-
float ceilf(float arg)
-
HAL_StatusTypeDef HAL_EXT_DMA_Init(EXT_DMA_HandleTypeDef *hdma)
Initialize the DMA according to the specified parameters in the DMA_InitTypeDef and initialize the associated handle.
- 参数:
hdma – Pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_DeInit(EXT_DMA_HandleTypeDef *hdma)
DeInitialize the EXT_DMA peripheral.
- 参数:
hdma – pointer to a EXT_DMA_HandleTypeDef structure that contains the configuration information.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_Start(EXT_DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t Counts)
Start the DMA Transfer.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
SrcAddress – The source memory Buffer address
DstAddress – The destination memory Buffer address
Counts – The counts of data transfer action from SrcAddress. Counts are uncompressed size from source if compressed is enable.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_Start_IT(EXT_DMA_HandleTypeDef *hdma, uint32_t SrcAddress, uint32_t DstAddress, uint32_t Counts)
Start the DMA Transfer with interrupt enabled.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
SrcAddress – The source memory Buffer address
DstAddress – The destination memory Buffer address
Counts – The counts of data transfer action from SrcAddress. Counts are uncompressed size from source if compressed is enable.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_Abort(EXT_DMA_HandleTypeDef *hdma)
Abort the DMA Transfer.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_Abort_IT(EXT_DMA_HandleTypeDef *hdma)
Aborts the DMA Transfer in Interrupt mode.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_PollForTransfer(EXT_DMA_HandleTypeDef *hdma, HAL_EXT_DMA_LevelCompleteTypeDef CompleteLevel, uint32_t Timeout)
Polling for transfer complete.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
CompleteLevel – Specifies the DMA level complete.
Timeout – Timeout duration.
- 返回值:
HAL – status
-
void HAL_EXT_DMA_IRQHandler(EXT_DMA_HandleTypeDef *hdma)
Handle DMA interrupt request.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
None –
-
HAL_StatusTypeDef HAL_EXT_DMA_RegisterCallback(EXT_DMA_HandleTypeDef *hdma, HAL_EXT_DMA_CallbackIDTypeDef CallbackID, void (*pCallback)(EXT_DMA_HandleTypeDef *_hdma))
Register callbacks.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
CallbackID – User Callback identifer a HAL_DMA_CallbackIDTypeDef ENUM as parameter.
pCallback – pointer to private callbacsk function which has pointer to a DMA_HandleTypeDef structure as parameter.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_UnRegisterCallback(EXT_DMA_HandleTypeDef *hdma, HAL_EXT_DMA_CallbackIDTypeDef CallbackID)
UnRegister callbacks.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
CallbackID – User Callback identifer a HAL_DMA_CallbackIDTypeDef ENUM as parameter.
- 返回值:
HAL – status
-
HAL_StatusTypeDef HAL_EXT_DMA_GetConfig(uint32_t target_size, uint32_t *cfg0, uint32_t *cfg1)
Get ext DAM compression/decompression configuration.
- 参数:
target_size – obsolete.
cfg0 – Compression configuration 0
cfg1 – Compression configuration 1
- 返回值:
HAL – status
-
HAL_EXT_DMA_StateTypeDef HAL_EXT_DMA_GetState(EXT_DMA_HandleTypeDef *hdma)
Return the DMA hande state.
- 参数:
hdma – pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
HAL – state
-
uint32_t HAL_EXT_DMA_GetError(EXT_DMA_HandleTypeDef *hdma)
Return the DMA error code.
- 参数:
hdma – : pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
DMA – Error Code
-
uint32_t HAL_EXT_DMA_GetCMPRQR(EXT_DMA_HandleTypeDef *hdma)
Return the DMA CMPRQR value.
- 参数:
hdma – : pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
DMA – CMPRQR register value
-
uint32_t HAL_EXT_DMA_GetCMPRDR(EXT_DMA_HandleTypeDef *hdma)
Return the DMA CMPRDR value.
- 参数:
hdma – : pointer to a DMA_HandleTypeDef structure that contains the configuration information for the specified DMA Channel.
- 返回值:
DMA – CMPRDR register value
-
HAL_StatusTypeDef HAL_EXT_DMA_CalcCompressedSize(uint32_t counts, uint8_t cmpr_rate, uint32_t row_num, uint8_t pixel_size, uint32_t *compressed_size, uint32_t *target_size)
-
struct EDMA_InitTypeDef
- #include <bf0_hal_ext_dma.h>
EXT_DMA Configuration Structure definition.
Public Members
-
uint32_t SrcInc
Source address increase after every DMA transfer This parameter can be a combination of burst length and increasement in EXT_DMA source incresement configuration
-
uint32_t DstInc
Destination address increase after every DMA transfer This parameter can be a combination of burst length and increasement in EXT_DMA destination incresement configuration
-
bool cmpr_en
Enable compress while DMA transfer
-
uint8_t cmpr_rate
Compress rate : 1 ~ 9
-
uint16_t col_num
Buffer column number in pixels
-
uint16_t row_num
Buffer row number in pixels
-
uint32_t src_format
Buffer color format This parameter can be a value of EXT_DMA source buffer format
-
uint32_t SrcInc
-
struct __EXT_DMA_HandleTypeDef
- #include <bf0_hal_ext_dma.h>
EXT_DMA handle Structure definition.
Public Members
-
EXTDMA_TypeDef *Instance
Register base address
-
EDMA_InitTypeDef Init
DMA communication parameters
-
HAL_LockTypeDef Lock
DMA locking object
-
HAL_EXT_DMA_StateTypeDef State
DMA transfer state
-
void (*XferCpltCallback)(struct __EXT_DMA_HandleTypeDef *hdma)
DMA transfer complete callback
-
void (*XferHalfCpltCallback)(struct __EXT_DMA_HandleTypeDef *hdma)
DMA Half transfer complete callback
-
void (*XferErrorCallback)(struct __EXT_DMA_HandleTypeDef *hdma)
DMA transfer error callback
-
void (*XferAbortCallback)(struct __EXT_DMA_HandleTypeDef *hdma)
DMA transfer abort callback
-
uint32_t ErrorCode
DMA Error code
-
EXTDMA_TypeDef *Instance