The LPI2C_EDMA module provide a method for LPI2C transfer operation based on EDMA.
struct _lpi2c_master_edma_transfer_handle |
- Note
- The contents of this structure are private and subject to change.
LPI2C_Type* lpi2c_master_edma_transfer_handle_t::base |
bool lpi2c_master_edma_transfer_handle_t::bIsBusy |
uint8_t lpi2c_master_edma_transfer_handle_t::u8Nbytes |
uint16_t lpi2c_master_edma_transfer_handle_t::u16CommandBuffer[7] |
lpi2c_master_transfer_t lpi2c_master_edma_transfer_handle_t::sTransfer |
status_t lpi2c_master_edma_transfer_handle_t::completionStatus |
void* lpi2c_master_edma_transfer_handle_t::pUserData |
edma_handle_t lpi2c_master_edma_transfer_handle_t::sRxDmaHandle |
edma_handle_t lpi2c_master_edma_transfer_handle_t::sTxDmaHandle |
typedef void(* lpi2c_master_edma_transfer_callback_t)(lpi2c_master_edma_transfer_handle_t *psHandle) |
This callback is used only for the non-blocking master transfer API. Specify the callback you wish to use in the call to LPI2C_MasterCreateEDMAHandle().
- Parameters
-
psHandle | Handle associated with the completed transfer. |
The creation of a handle is for use with the DMA APIs. Once a handle is created, there is not a corresponding destroy handle. If the user wants to terminate a transfer, the LPI2C_MasterTransferAbortEDMA() API shall be called.
For devices where the LPI2C send and receive DMA requests are OR'd together, the txDmaHandle parameter is ignored and may be set to NULL.
- Parameters
-
base | The LPI2C peripheral base address. |
psHandle | Pointer to the LPI2C master driver handle. |
pfcallback | User provided pointer to the asynchronous callback function. |
pUserData | User provided pointer to the application callback data. |
edmaBase | Edma base address. |
eEdmaTxChannel | eDMA channel for master transfer Tx request. |
eEdmaTxChannel | eDMA channel for master transfer Rx request. |
status_t LPI2C_MasterTransferEDMA |
( |
lpi2c_master_edma_transfer_handle_t * |
psHandle, |
|
|
lpi2c_master_transfer_t * |
psTransfer |
|
) |
| |
The callback specified when the handle was created is invoked when the transaction has completed.
- Parameters
-
psHandle | Pointer to the LPI2C master driver handle. |
psTransfer | The pointer to the transfer descriptor. |
- Return values
-
#kStatus_Success | The transaction was started successfully. |
kStatus_LPI2C_Busy | Either another master is currently utilizing the bus, or another DMA transaction is already in progress. |
status_t LPI2C_MasterTransferGetCountEDMA |
( |
lpi2c_master_edma_transfer_handle_t * |
psHandle, |
|
|
uint16_t * |
pu16Count |
|
) |
| |
- Parameters
-
psHandle | Pointer to the LPI2C master driver handle. |
pu16Count | Number of bytes transferred so far by the non-blocking transaction. |
- Return values
-
#kStatus_Success | |
#kStatus_NoTransferInProgress | There is not a DMA transaction currently in progress. |
status_t LPI2C_MasterTransferAbortEDMA |
( |
lpi2c_master_edma_transfer_handle_t * |
psHandle | ) |
|
- Note
- It is not safe to call this function from an IRQ handler that has a higher priority than the eDMA peripheral's IRQ priority.
- Parameters
-
psHandle | Pointer to the LPI2C master driver handle. |
- Return values
-
#kStatus_Success | A transaction was successfully aborted. |
kStatus_LPI2C_Idle | There is not a DMA transaction currently in progress. |