PDK API Guide for J721E
|
MCASP driver interface
Files | |
file | mcasp_drv.h |
McASP driver interface definition file. | |
Data Structures | |
struct | Mcasp_errCbStatus |
structure to hold the error condition and the status More... | |
struct | Mcasp_HwSetupDataClk |
Hardware setup data clock structure. More... | |
struct | Mcasp_HwSetupGbl |
Hardware setup global structure. More... | |
struct | Mcasp_HwSetupData |
Hardware setup data structure. More... | |
struct | Mcasp_HwSetup |
Hardware setup structure. More... | |
struct | Mcasp_AudioDevData |
structure to store the audio device related information More... | |
struct | Mcasp_ChanParams |
channel Parameters to initialize channel Object More... | |
struct | Mcasp_ChStatusRam |
DIT channel status register structure. More... | |
struct | Mcasp_UserDataRam |
DIT channel user data register structure. More... | |
struct | Mcasp_PktAddrPayload |
Structure passed through DriverTypes_Packet addr field. More... | |
struct | MCASP_Packet |
McASP frame object params. More... | |
struct | Mcasp_Params |
Functions | |
int32_t | mcaspBindDev (void **devp, int32_t devId, void *devParams) |
int32_t | mcaspUnBindDev (void *devp) |
int32_t | mcaspCreateChan (void **chanp, void *devp, Mcasp_chanMode_e mode, void *chanParams, MCASP_TiomCallback cbFxn, void *cbArg) |
int32_t | mcaspSubmitChan (void *chanp, MCASP_Packet *ioPacket) |
int32_t | mcaspDeleteChan (void *chanp) |
int32_t | mcaspControlChan (void *chanp, Mcasp_ioctlCmd cmd, void *cmdArgs) |
Variables | |
const Mcasp_Params | Mcasp_PARAMS |
Typedefs | |
typedef void(* | Mcasp_GblCallback) (Mcasp_errCbStatus errCbStat) |
Global error callback function protype. More... | |
typedef void(* | Mcasp_Isr) (void *arg) |
Mcasp Interrupt service routine. More... | |
typedef QueueP_Elem | Mcasp_QueueElem |
McASP queue element. More... | |
typedef void(* | MCASP_TiomCallback) (void *arg, MCASP_Packet *packet) |
EDMA TC callback function prototype This function is the call back function provided by the application during the mcaspCreateChannel(). This call back function is called every time a TX or RX transaction is completed. The arguments to this function are defined as below. More... | |
Macros | |
#define | Mcasp_CACHE_LENGTH (128u) |
#define | Mcasp_NUMSERIALIZERS (16u) |
#define | Mcasp_GBLCTL_TIMEOUT (30000U) |
#define | MCASP_EBADIO (-(1)) /* Generic failure condition */ |
#define | MCASP_ETIMEOUT (-(2)) /* Timeout occurred */ |
#define | MCASP_ENOPACKETS (-(3)) /* No packets available for I/O */ |
#define | MCASP_EFREE (-(4)) /* Unable to free resources */ |
#define | MCASP_EALLOC (-(5)) /* Unable to alloc resource */ |
#define | MCASP_EABORT (-(6)) /* I/O was aborted before completed */ |
#define | MCASP_EBADMODE (-(7)) /* Illegal device mode */ |
#define | MCASP_EOF (-(8)) /* End-of-File was encountered */ |
#define | MCASP_ENOTIMPL (-(9)) /* Operation not implemented or supported */ |
#define | MCASP_EBADARGS (-(10)) /* Illegal arguments specified */ |
#define | MCASP_ETIMEOUTUNREC (-(11)) /* Unrecoverable timeout occurred */ |
#define | MCASP_EINUSE (-(12)) /* Device already in use */ |
#define | MCASP_EINVALIDVAL (-(13)) /* Invalid value encountered (Unexpected) */ |
#define | MCASP_COMPLETED (0) /* I/O completed successfully */ |
#define | MCASP_PENDING (1) /* I/O queued and pending */ |
#define | MCASP_FLUSHED 2 |
#define | MCASP_ABORTED 3 |
#define Mcasp_CACHE_LENGTH (128u) |
cache line length
#define Mcasp_NUMSERIALIZERS (16u) |
Number of serializers on mcasp
#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
#define MCASP_EBADIO (-(1)) /* Generic failure condition */ |
#define MCASP_ETIMEOUT (-(2)) /* Timeout occurred */ |
#define MCASP_ENOPACKETS (-(3)) /* No packets available for I/O */ |
#define MCASP_EFREE (-(4)) /* Unable to free resources */ |
#define MCASP_EALLOC (-(5)) /* Unable to alloc resource */ |
#define MCASP_EABORT (-(6)) /* I/O was aborted before completed */ |
#define MCASP_EOF (-(8)) /* End-of-File was encountered */ |
#define MCASP_ENOTIMPL (-(9)) /* Operation not implemented or supported */ |
#define MCASP_EBADARGS (-(10)) /* Illegal arguments specified */ |
#define MCASP_ETIMEOUTUNREC (-(11)) /* Unrecoverable timeout occurred */ |
#define MCASP_EINUSE (-(12)) /* Device already in use */ |
#define MCASP_EINVALIDVAL (-(13)) /* Invalid value encountered (Unexpected) */ |
#define MCASP_COMPLETED (0) /* I/O completed successfully */ |
#define MCASP_PENDING (1) /* I/O queued and pending */ |
#define MCASP_FLUSHED 2 |
#define MCASP_ABORTED 3 |
typedef void(* Mcasp_GblCallback) (Mcasp_errCbStatus errCbStat) |
Global error callback function protype.
This is the global error callback function for the McASP driver. This function is called directly called from ISR context in case of error.
typedef void(* Mcasp_Isr) (void *arg) |
Mcasp Interrupt service routine.
This is Function pointer to the McASP ISR. Interrupt registration takes place by hooking the ISR to the interrrupt number.
typedef QueueP_Elem Mcasp_QueueElem |
McASP queue element.
Doubly linked list for queue elements. Required for Mcasp_IOBuf structure.
typedef void(* MCASP_TiomCallback) (void *arg, MCASP_Packet *packet) |
EDMA TC callback function prototype This function is the call back function provided by the application during the mcaspCreateChannel(). This call back function is called every time a TX or RX transaction is completed. The arguments to this function are defined as below.
arg - This callback argument is passed to the driver by the application during mcaspCreateChan(). The driver would pass this argument as is to the
call back function when the TX or RX transaction is completed. The application can then use this argument as they chose in their implementation of the call back function. If the application does not want to use this call back argument, it can be set to NULL during mcaspCreateChan().
packet - This argument returns the MCASP_Packet * which was submitted as a part of mcaspSubmitChan(). Once the transaction is completed, the application can use this to find the details of the transaction which just completed such as the buffer address, size, cmd and other fields of MCASP_Packet.
enum Mcasp_chanMode_e |
enum Mcasp_IOcmd_e |
enum Mcasp_OpMode |
enum Mcasp_SerializerNum |
Enumeration for the MCASP serializer numbers.
enum Mcasp_WordLength |
Enumerated constant for wordlength supported by the MCASP device.
enum Mcasp_WordBitsSelect |
enum Mcasp_pllDomain |
enum Mcasp_BufferFormat |
Enum to specify the supported buffer formats.
Interleaved and non-interleaved is standard format, this enumeration captures the standard and custom data formats.
enum Mcasp_ioctlCmd |
Mcasp Ioctl commands.
Mcaspp Ioctl commands
Enumerator | |
---|---|
MCASP_CHAN_RESET | Reset Device, cmdArg = NONE Channel timeout, cmdArg = NONE |
MCASP_CHAN_TIMEDOUT | Channel reset, cmdArg = NONE |
MCASP_DEVICE_RESET | Reset Device, cmdArg = NONE |
Mcasp_IOCTL_DEVICE_RESET | Enable/Disable mute, cmdArg = (uint32_t *) value for AMUTE register |
Mcasp_IOCTL_CNTRL_AMUTE | Start Mcasp port, cmdArg = NONE |
Mcasp_IOCTL_START_PORT | Stop Mcasp port, cmdArg = NONE |
Mcasp_IOCTL_STOP_PORT | Query AMUTE register, cmdArg = (uint32_t *) variable to store value |
Mcasp_IOCTL_QUERY_MUTE | Loop job modification, cmdArg = (Mcasp_ChanParams *) |
Mcasp_IOCTL_CTRL_MODIFY_LOOPJOB | Mute on, cmdArg = NONE |
Mcasp_IOCTL_CTRL_MUTE_ON | Mute off, cmdArg = NONE |
Mcasp_IOCTL_CTRL_MUTE_OFF | Pause data transfer, cmdArg = NONE |
Mcasp_IOCTL_PAUSE | Resume data transfer, cmdArg = NONE |
Mcasp_IOCTL_RESUME | Set DIT mode, cmdArg = (uint32_t *) value for DITCTL register |
Mcasp_IOCTL_SET_DIT_MODE | Channel timeout, cmdArg = NONE |
Mcasp_IOCTL_CHAN_TIMEDOUT | Channel reset, cmdArg = NONE |
Mcasp_IOCTL_CHAN_RESET | Set channel format, cmdArg = (Mcasp_HwSetupData *) |
Mcasp_IOCTL_CNTRL_SET_FORMAT_CHAN | Get format channel info, cmdArg = (Mcasp_HwSetupdata *) |
Mcasp_IOCTL_CNTRL_GET_FORMAT_CHAN | Set GBL register values, cmdArg = (Mcasp_HwSetup *) |
Mcasp_IOCTL_CNTRL_SET_GBL_REGS | Set digital loop back mode, cmdArg = (bool *) |
Mcasp_IOCTL_SET_DLB_MODE | Abort all queued requests, cmdArg = NONE |
Mcasp_IOCTL_ABORT | IOCTL to Set the sample rate cmdArg = (uint32_t *) |
Mcasp_IOCTL_SET_SAMPLE_RATE | Ioctl to query the Mcasp specific information. cmdArg = (Mcasp_AudioDevData *) |
Mcasp_IOCTL_GET_DEVINFO | Ioctl to flush the receive FIFO |
Mcasp_IOCTL_FLUSH_RCV_FIFO | Ioctl command to modify the timeout used by the driver for certain wait operations. cmdArg = (uint32_t *) |
Mcasp_IOCTL_SET_TIMEOUT | Ioctl command to check if the driver is compiled in loop job mode or Not. cmdArg = (uint16_t *) TRUE = loop job mode,FALSE = loop job disabled |
Mcasp_IOCTL_QUERY_LOOPJOB_MODE | Ioctl command to collect error stats cmdArg = (Mcasp_errCbStatus *) |
Mcasp_IOCTL_CHAN_QUERY_ERROR_STATS | Ioctl command to reconfigure word width of the channel parameters: Mcasp_ChanParams.wordWidth. cmdArg = (Mcasp_ChanParams *).
|
Mcasp_IOCTL_CHAN_PARAMS_WORD_WIDTH | Ioctl command to read Tx channel bit clock divide ratio. cmdArg = (uint32_t *) value read from ACLKXCTL:CLKXDIV register. |
Mcasp_IOCTL_CNTRL_GET_FORMAT_CHAN_CLKXDIV | Ioctl command to write Tx channel bit clock divide ratio. cmdArg = (uint32_t *) value to write to ACLKXCTL:CLKXDIV register.
|
Mcasp_IOCTL_CNTRL_SET_FORMAT_CHAN_CLKXDIV |
int32_t mcaspBindDev | ( | void ** | devp, |
int32_t | devId, | ||
void * | devParams | ||
) |
int32_t mcaspUnBindDev | ( | void * | devp | ) |
int32_t mcaspCreateChan | ( | void ** | chanp, |
void * | devp, | ||
Mcasp_chanMode_e | mode, | ||
void * | chanParams, | ||
MCASP_TiomCallback | cbFxn, | ||
void * | cbArg | ||
) |
int32_t mcaspSubmitChan | ( | void * | chanp, |
MCASP_Packet * | ioPacket | ||
) |
int32_t mcaspDeleteChan | ( | void * | chanp | ) |
int32_t mcaspControlChan | ( | void * | chanp, |
Mcasp_ioctlCmd | cmd, | ||
void * | cmdArgs | ||
) |
const Mcasp_Params Mcasp_PARAMS |