PDK API Guide for J721E
mcasp_drv.h File Reference

Introduction

McASP driver interface definition file.

         This file contains the interfaces, data types and symbolic
         definitions that are needed by the application to utilize the
         services of the McASP device driver.

         (C) Copyright 2019, Texas Instruments, Inc

Go to the source code of this 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
 

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
 

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...
 

Enumerations

enum  Mcasp_chanMode_e { MCASP_INPUT = 0x0001, MCASP_OUTPUT = 0x0002, MCASP_INOUT = (MCASP_INPUT | MCASP_OUTPUT) }
 enumerated constants for the channel modes supported by Mcasp More...
 
enum  Mcasp_IOcmd_e { MCASP_READ = 0, MCASP_WRITE = 1, MCASP_ABORT = 2, MCASP_FLUSH = 3 }
 enumerated constants for the commands supported by Mcasp More...
 
enum  Mcasp_OpMode { Mcasp_OpMode_TDM = 0, Mcasp_OpMode_DIT = 1 }
 enumerated constants for the Transfer modes supported by Mcasp More...
 
enum  Mcasp_SerializerNum {
  Mcasp_SerializerNum_0 = 0, Mcasp_SerializerNum_1 = 1, Mcasp_SerializerNum_2 = 2, Mcasp_SerializerNum_3 = 3,
  Mcasp_SerializerNum_4 = 4, Mcasp_SerializerNum_5 = 5, Mcasp_SerializerNum_6 = 6, Mcasp_SerializerNum_7 = 7,
  Mcasp_SerializerNum_8 = 8, Mcasp_SerializerNum_9 = 9, Mcasp_SerializerNum_10 = 10, Mcasp_SerializerNum_11 = 11,
  Mcasp_SerializerNum_12 = 12, Mcasp_SerializerNum_13 = 13, Mcasp_SerializerNum_14 = 14, Mcasp_SerializerNum_15 = 15
}
 Enumeration for the MCASP serializer numbers. More...
 
enum  Mcasp_WordLength {
  Mcasp_WordLength_8 = 8u, Mcasp_WordLength_12 = 12u, Mcasp_WordLength_16 = 16u, Mcasp_WordLength_20 = 20u,
  Mcasp_WordLength_24 = 24u, Mcasp_WordLength_32 = 32u
}
 Enumerated constant for wordlength supported by the MCASP device. More...
 
enum  Mcasp_WordBitsSelect { Mcasp_WordBitsSelect_LSB = 0u, Mcasp_WordBitsSelect_MSB = 1u }
 Enumerated constant for selecting MSB/LSB word in the slot bits. More...
 
enum  Mcasp_pllDomain { Mcasp_pllDomain_0 = 0, Mcasp_pllDomain_1 = 1, Mcasp_pllDomain_NONE = 2 }
 PLL domain to be used by the device. More...
 
enum  Mcasp_BufferFormat {
  Mcasp_BufferFormat_1SER_1SLOT, Mcasp_BufferFormat_1SER_MULTISLOT_NON_INTERLEAVED, Mcasp_BufferFormat_1SER_MULTISLOT_INTERLEAVED, Mcasp_BufferFormat_MULTISER_1SLOT_SER_INTERLEAVED,
  Mcasp_BufferFormat_MULTISER_1SLOT_SER_NON_INTERLEAVED, Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_1, Mcasp_BufferFormat_MULTISER_MULTISLOT_SEMI_INTERLEAVED_2
}
 Enum to specify the supported buffer formats. More...
 
enum  Mcasp_ioctlCmd {
  MCASP_CHAN_RESET = 0, MCASP_CHAN_TIMEDOUT = 1, MCASP_DEVICE_RESET = 2, Mcasp_IOCTL_DEVICE_RESET = 128,
  Mcasp_IOCTL_CNTRL_AMUTE, Mcasp_IOCTL_START_PORT, Mcasp_IOCTL_STOP_PORT, Mcasp_IOCTL_QUERY_MUTE,
  Mcasp_IOCTL_CTRL_MODIFY_LOOPJOB, Mcasp_IOCTL_CTRL_MUTE_ON, Mcasp_IOCTL_CTRL_MUTE_OFF, Mcasp_IOCTL_PAUSE,
  Mcasp_IOCTL_RESUME, Mcasp_IOCTL_SET_DIT_MODE, Mcasp_IOCTL_CHAN_TIMEDOUT, Mcasp_IOCTL_CHAN_RESET,
  Mcasp_IOCTL_CNTRL_SET_FORMAT_CHAN, Mcasp_IOCTL_CNTRL_GET_FORMAT_CHAN, Mcasp_IOCTL_CNTRL_SET_GBL_REGS, Mcasp_IOCTL_SET_DLB_MODE,
  Mcasp_IOCTL_ABORT, Mcasp_IOCTL_SET_SAMPLE_RATE, Mcasp_IOCTL_GET_DEVINFO, Mcasp_IOCTL_FLUSH_RCV_FIFO,
  Mcasp_IOCTL_SET_TIMEOUT, Mcasp_IOCTL_QUERY_LOOPJOB_MODE, Mcasp_IOCTL_CHAN_QUERY_ERROR_STATS, Mcasp_IOCTL_CHAN_PARAMS_WORD_WIDTH,
  Mcasp_IOCTL_CNTRL_GET_FORMAT_CHAN_CLKXDIV, Mcasp_IOCTL_CNTRL_SET_FORMAT_CHAN_CLKXDIV
}
 Mcasp Ioctl commands. More...
 

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