This module contains APIs to program and use the MCASP module. The APIs can be used by other drivers to get access to MCASP and also by application to initiate data transfer operation.
|
Interleaved and non-interleaved is standard format, this enumeration captures the standard and custom data formats.
|
#define | MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_NON_INTERLEAVED (0U) |
| This is used for transfer of data on a single serializer with multiple slots.please note that the slot data is not interleaved in this format. TDM with single serializer and slots > 1 uses this format. More...
|
|
#define | MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_INTERLEAVED (1U) |
| This is used for transfer of data on a single serializer with multiple slots.please note that the slot data is interleaved in this format. TDM with single serializer and slots > 1 uses this format. More...
|
|
#define | MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1 (2U) |
| This is used for transfer of data with multiple serializers and also multiple slots enabled.please note that the serializer data is interleaved in this format. The slot data is also interleaved Refer to the user guide to view the sample data format. More...
|
|
#define | MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2 (3U) |
| This is used for transfer of data with multiple serializers and also multiple slots enabled.please note that the serializer data is NOT interleaved in this format. The slot data is interleaved. Refer to the user guide to view the sample data format. More...
|
|
◆ MCASP_GBLCTL_TIMEOUT
#define MCASP_GBLCTL_TIMEOUT (30000U) |
The time to try (in Msec) before the GBLCTL register setting timeouts if the setting/resetting is done in a context other than a task this will be used as a retry count rather than the MSec timeout.
◆ MCASP_DATA_TIMEOUT
#define MCASP_DATA_TIMEOUT (30000U) |
The time to try (in Msec) to check the XDTATA/RDATA flags in status register. if the setting/resetting is done in a context other than a task this will be used as a retry count rather than the MSec timeout.
◆ MCASP_RESET
#define MCASP_RESET ((uint32_t) 0x00U) |
McASP macros for enable/reset.
◆ MCASP_ENABLE
#define MCASP_ENABLE ((uint32_t) 0x01U) |
◆ MCASP_DISABLE
#define MCASP_DISABLE ((uint32_t) 0x00U) |
◆ MCASP_REG_OFFSET
#define MCASP_REG_OFFSET ((uint32_t)0x4U) |
◆ MCASP_TRANSFER_STATUS_COMPLETED
#define MCASP_TRANSFER_STATUS_COMPLETED (0U) |
I/O completed successfully.
◆ MCASP_TRANSFER_STATUS_STARTED
#define MCASP_TRANSFER_STATUS_STARTED (1U) |
◆ MCASP_TRANSFER_STATUS_CANCELLED
#define MCASP_TRANSFER_STATUS_CANCELLED (2U) |
I/O cancelled. Returned by incomplete read or write requests.
◆ MCASP_TRANSFER_STATUS_FAILED
#define MCASP_TRANSFER_STATUS_FAILED (3U) |
Generic failure condition.
◆ MCASP_TRANSFER_STATUS_TIMEOUT
#define MCASP_TRANSFER_STATUS_TIMEOUT (4U) |
◆ MCASP_TRANSFER_MODE_POLLING
#define MCASP_TRANSFER_MODE_POLLING (0U) |
MCASP read/write APIs blocks execution. This mode can only be used when called within a Task context.
◆ MCASP_TRANSFER_MODE_INTERRUPT
#define MCASP_TRANSFER_MODE_INTERRUPT (1U) |
◆ MCASP_TRANSFER_MODE_DMA
#define MCASP_TRANSFER_MODE_DMA (2U) |
MCASP read/write APIs does not block code execution and will use DMA for transfers.
◆ MCASP_OPMODE_MASTER
#define MCASP_OPMODE_MASTER (0U) |
I/O completed successfully.
◆ MCASP_OPMODE_SLAVE
#define MCASP_OPMODE_SLAVE (1U) |
◆ MCASP_CHANNEL_INPUT
#define MCASP_CHANNEL_INPUT (0x0001U) |
MCASP Channel will receive data.
◆ MCASP_CHANNEL_OUTPUT
#define MCASP_CHANNEL_OUTPUT (0x0002U) |
MCASP Channel will transmit data.
◆ MCASP_CHANNEL_INOUT
McASP channel transmits & recieves data.
◆ MCASP_DRIVER_STATE_DELETED
#define MCASP_DRIVER_STATE_DELETED (0U) |
◆ MCASP_DRIVER_STATE_CREATED
#define MCASP_DRIVER_STATE_CREATED (1U) |
◆ MCASP_DRIVER_STATE_INITIALIZED
#define MCASP_DRIVER_STATE_INITIALIZED (2U) |
◆ MCASP_DRIVER_STATE_OPENED
#define MCASP_DRIVER_STATE_OPENED (3U) |
◆ MCASP_DRIVER_STATE_CLOSED
#define MCASP_DRIVER_STATE_CLOSED (4U) |
◆ MCASP_DRIVER_STATE_DEINITIALIZED
#define MCASP_DRIVER_STATE_DEINITIALIZED (5U) |
◆ MCASP_DRIVER_STATE_POWERED_DOWN
#define MCASP_DRIVER_STATE_POWERED_DOWN (6U) |
◆ MCASP_DRIVER_STATE_PWRM_SUSPEND
#define MCASP_DRIVER_STATE_PWRM_SUSPEND (7U) |
◆ MCASP_SERIALIZER_STATUS_FREE
#define MCASP_SERIALIZER_STATUS_FREE (0U) |
◆ MCASP_SERIALIZER_STATUS_XMT
#define MCASP_SERIALIZER_STATUS_XMT (1U) |
◆ MCASP_SERIALIZER_STATUS_RCV
#define MCASP_SERIALIZER_STATUS_RCV (2U) |
◆ MCASP_CHANNEL_MODE_FREE
#define MCASP_CHANNEL_MODE_FREE (0U) |
◆ MCASP_CHANNEL_MODE_XMT_DIT
#define MCASP_CHANNEL_MODE_XMT_DIT (1U) |
◆ MCASP_CHANNEL_MODE_XMT_TDM
#define MCASP_CHANNEL_MODE_XMT_TDM (2U) |
◆ MCASP_CHANNEL_MODE_RCV
#define MCASP_CHANNEL_MODE_RCV (3U) |
◆ MCASP_WORD_SELECT_LSW
#define MCASP_WORD_SELECT_LSW (0U) |
◆ MCASP_WORD_SELECT_MSW
#define MCASP_WORD_SELECT_MSW (1U) |
◆ MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_NON_INTERLEAVED
#define MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_NON_INTERLEAVED (0U) |
This is used for transfer of data on a single serializer with multiple slots.please note that the slot data is not interleaved in this format. TDM with single serializer and slots > 1 uses this format.
◆ MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_INTERLEAVED
#define MCASP_AUDBUFF_FORMAT_1SER_MULTISLOT_INTERLEAVED (1U) |
This is used for transfer of data on a single serializer with multiple slots.please note that the slot data is interleaved in this format. TDM with single serializer and slots > 1 uses this format.
◆ MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1
#define MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1 (2U) |
This is used for transfer of data with multiple serializers and also multiple slots enabled.please note that the serializer data is interleaved in this format. The slot data is also interleaved Refer to the user guide to view the sample data format.
◆ MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2
#define MCASP_AUDBUFF_FORMAT_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2 (3U) |
This is used for transfer of data with multiple serializers and also multiple slots enabled.please note that the serializer data is NOT interleaved in this format. The slot data is interleaved. Refer to the user guide to view the sample data format.
◆ MCASP_TRANSMIT_STATE_TX_RESET
#define MCASP_TRANSMIT_STATE_TX_RESET (0U) |
◆ MCASP_TRANSMIT_STATE_TX_FLUSH
#define MCASP_TRANSMIT_STATE_TX_FLUSH (1U) |
◆ MCASP_TRANSMIT_STATE_LOAD_INIT_BUFFER
#define MCASP_TRANSMIT_STATE_LOAD_INIT_BUFFER (2U) |
◆ MCASP_TRANSMIT_STATE_RELEASE_FROM_RESET
#define MCASP_TRANSMIT_STATE_RELEASE_FROM_RESET (3U) |
◆ MCASP_TRANSMIT_STATE_WAIT_EVENT
#define MCASP_TRANSMIT_STATE_WAIT_EVENT (4U) |
◆ MCASP_TRANSMIT_STATE_PROCESS_EVENT
#define MCASP_TRANSMIT_STATE_PROCESS_EVENT (5U) |
◆ MCASP_TRANSMIT_STATE_LOAD_ACTIVE_BUFFER
#define MCASP_TRANSMIT_STATE_LOAD_ACTIVE_BUFFER (6U) |
◆ MCASP_TRANSMIT_STATE_DONE
#define MCASP_TRANSMIT_STATE_DONE (7U) |
◆ MCASP_TRANSMIT_STATE_SPIN_IDLE
#define MCASP_TRANSMIT_STATE_SPIN_IDLE (8U) |
◆ MCASP_TRANSMIT_STATE_ERROR
#define MCASP_TRANSMIT_STATE_ERROR (9U) |
◆ MCASP_TRANSMIT_STATE_EXIT
#define MCASP_TRANSMIT_STATE_EXIT (10U) |
◆ MCASP_RECEIVE_STATE_RX_RESET
#define MCASP_RECEIVE_STATE_RX_RESET (0U) |
◆ MCASP_RECEIVE_STATE_RX_FLUSH
#define MCASP_RECEIVE_STATE_RX_FLUSH (1U) |
◆ MCASP_RECEIVE_STATE_RELEASE_FROM_RESET
#define MCASP_RECEIVE_STATE_RELEASE_FROM_RESET (2U) |
◆ MCASP_RECEIVE_STATE_WAIT_EVENT
#define MCASP_RECEIVE_STATE_WAIT_EVENT (3U) |
◆ MCASP_RECEIVE_STATE_PROCESS_EVENT
#define MCASP_RECEIVE_STATE_PROCESS_EVENT (4U) |
◆ MCASP_RECEIVE_STATE_DONE
#define MCASP_RECEIVE_STATE_DONE (5U) |
◆ MCASP_RECEIVE_STATE_SPIN_IDLE
#define MCASP_RECEIVE_STATE_SPIN_IDLE (6U) |
◆ MCASP_RECEIVE_STATE_ERROR
#define MCASP_RECEIVE_STATE_ERROR (7U) |
◆ MCASP_RECEIVE_STATE_EXIT
#define MCASP_RECEIVE_STATE_EXIT (8U) |
◆ MCASP_DIR_OUT
◆ MCASP_DIR_IN
◆ MCASP_TRPD_INVALID_PTR
#define MCASP_TRPD_INVALID_PTR (0xFFFFFFFF) |
◆ MCASP_Handle
◆ MCASP_TxCallbackFxn
The definition of a callback function used by the MCASP driver when used in Callback Mode.
- Parameters
-
◆ MCASP_RxCallbackFxn
◆ MCASP_init()
This function initializes the MCASP module.
◆ MCASP_deinit()
void MCASP_deinit |
( |
void |
| ) |
|
This function de-initializes the MCASP module.
◆ MCASP_openParamsInit()
◆ MCASP_open()
This function opens a given MCASP peripheral.
- Precondition
- MCASP controller has been initialized using MCASP_init()
- Parameters
-
index | Index of config to use in the MCASP_Config array |
openParams | Pointer to parameters to open the driver with |
- Returns
- A MCASP_Handle on success or a NULL on an error or if it has been opened already
- See also
- MCASP_init()
-
MCASP_close()
◆ MCASP_close()
Function to close a MCASP peripheral specified by the MCASP handle.
- Precondition
- MCASP_open() has to be called first
- Parameters
-
- See also
- MCASP_open()
◆ MCASP_getHandle()
This function returns the handle of an open MCASP Instance from the instance index.
- Precondition
- MCASP controller has been opened using MCASP_open()
- Parameters
-
- Returns
- A MCASP_Handle if it has been opened already or NULL otherwise
- See also
- MCASP_init()
-
MCASP_open()
◆ MCASP_submitTx()
Function to submit the buffer to McASP driver for transmission. Transaction object is held by the driver till it is returned in the callback function. It is recommended not to allocate the transaction object in stack to avoid corruption.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ MCASP_submitRx()
Function to submit the buffer to McASP driver for reception. Transaction object is held by the driver till it is returned in the callback function. It is recommended not to allocate the transaction object in stack to avoid corruption.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ MCASP_withdrawTx()
Function to withdraw the buffer submitted to McASP driver for transmission. This should be called after the MCASP_stopTransferTx. These buffers are not transmitted.
- Parameters
-
- Returns
- Pointer to a MCASP_Transaction. NULL if no more buffers are there with driver.
◆ MCASP_withdrawRx()
Function to withdraw the buffer submitted to McASP driver for reception. This should be called after the MCASP_stopTransferRx. These buffers are not transmitted.
- Parameters
-
- Returns
- Pointer to a MCASP_Transaction. NULL if no more buffers are there with driver.
◆ MCASP_startTransferTx()
Function to start McASP transmission.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ MCASP_startTransferRx()
Function to start McASP reception.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ MCASP_stopTransferTx()
Function to stop McASP transmission.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ MCASP_stopTransferRx()
Function to stop McASP reception.
- Parameters
-
- Returns
- Success/Failure for configuration
◆ gMcaspConfig
Externally defined driver configuration array.
◆ gMcaspConfigNum
Externally defined driver configuration array size.