![]() |
![]() |
McBSP driver interface definition file. More...
#include <ti/csl/cslr_device.h>#include <ti/csl/cslr_mcbsp.h>#include "mcbspver.h"Data Structures | |
| struct | Mcbsp_srgConfig_t |
| McBSP sample rate generator configuration structure. More... | |
| struct | Mcbsp_DataConfig_t |
| Mcbsp TX/RX section configuration structure. More... | |
| struct | Mcbsp_McrSetup_t |
| Mcbsp multi channel control settings. More... | |
| struct | Mcbsp_ClkSetup_t |
| Mcbsp clock settings setup structure. More... | |
| struct | Mcbsp_HwInfo_Unpadded |
| Mcbsp Hardware specific information Object. More... | |
| struct | Mcbsp_TempBuffer_t |
| Loop job buffer structure. This structure defines the format of the Loop job buffer. More... | |
| struct | Mcbsp_ChanParams_t |
| McBSP channel setup params. More... | |
| struct | Mcbsp_Params_t |
| McBSP device create params. More... | |
| struct | Mcbsp_QueueElem_t |
| McBSP queue element. More... | |
| struct | Mcbsp_IOBuf_t |
| McBSP frame object params. More... | |
Defines | |
| #define | Mcbsp_POLLED_RETRYCOUNT (0xFFFFu) |
| #define | MCBSP_CACHE_LENGTH (128u) |
| #define | MCBSP_MAX_CACHE_ALIGN (128u) |
| #define | MCBSP_COMPILE_TIME_SIZE_CHECK(postulate) |
| #define | MCBSP_MODE_INPUT 0x0001 |
| McBSP Create Modes. | |
| #define | MCBSP_MODE_OUTPUT 0x0002 |
| #define | MCBSP_MODE_INOUT (MCBSP_MODE_INPUT | MCBSP_MODE_OUTPUT) |
| #define | MCBSP_STATUS_COMPLETED 0 |
| McBSP Driver Status Codes. | |
| #define | MCBSP_STATUS_PENDING 1 |
| #define | MCBSP_STATUS_FLUSHED 2 |
| #define | MCBSP_STATUS_ABORTED 3 |
| #define | MCBSP_ERR_BADIO -1 |
| McBSP Driver Error Codes. | |
| #define | MCBSP_ERR_TIMEOUT -2 |
| #define | MCBSP_ERR_NOIOBUFFERS -3 |
| #define | MCBSP_ERR_FREE -4 |
| #define | MCBSP_ERR_ALLOC -5 |
| #define | MCBSP_ERR_ABORT -6 |
| #define | MCBSP_ERR_BADMODE -7 |
| #define | MCBSP_ERR_EOF -8 |
| #define | MCBSP_ERR_NOTIMPL -9 |
| #define | MCBSP_ERR_BADARGS -10 |
| #define | MCBSP_ERR_TIMEOUTUNREC -11 |
| #define | MCBSP_ERR_INUSE -12 |
| #define | Mcbsp_IOBuf_Cmd_READ 0 |
| McBSP Driver Buffer Frame Command Codes. | |
| #define | Mcbsp_IOBuf_Cmd_WRITE 1 |
| #define | Mcbsp_IOBuf_Cmd_ABORT 2 |
| #define | Mcbsp_IOBuf_Cmd_FLUSH 3 |
| #define | MCBSP_CTRL_CHAN_RESET 0 |
| McBSP Driver Command Codes Reserved for Control. | |
| #define | MCBSP_CTRL_CHAN_TIMEDOUT 1 |
| #define | MCBSP_CTRL_DEVICE_RESET 2 |
Typedefs | |
| typedef enum Mcbsp_DevMode_t | Mcbsp_DevMode |
| Mcbsp device operational mode. | |
| typedef enum Mcbsp_OpMode_t | Mcbsp_OpMode |
| Mcbsp driver operational mode. | |
| typedef enum Mcbsp_EmuMode_t | Mcbsp_EmuMode |
| Mcbsp Emulation mode settings. | |
| typedef enum Mcbsp_Loopback_t | Mcbsp_Loopback |
| McBSP digital loopback mode selection. | |
| typedef enum Mcbsp_Rxjust_t | Mcbsp_Rxjust |
| ENUM for receive data justification settings. | |
| typedef enum Mcbsp_DxEna_t | Mcbsp_DxEna |
| Transmit pin mode configuration. | |
| typedef enum Mcbsp_ClkSPol_t | Mcbsp_ClkSPol |
| Polarity of the CLKS pin. | |
| typedef enum Mcbsp_SrgClk_t | Mcbsp_SrgClk |
| SRG clock source. | |
| typedef enum Mcbsp_BufferFormat_t | Mcbsp_BufferFormat |
| Enum to specify the supported buffer formats. | |
| typedef enum Mcbsp_Phase_t | Mcbsp_Phase |
| Mcbsp PHASE control enums. | |
| typedef enum Mcbsp_WordLength_t | Mcbsp_WordLength |
| Mcbsp supported wordlength. | |
| typedef enum Mcbsp_FrmSync_t | Mcbsp_FrmSync |
| Frame sync ignore status enum. | |
| typedef enum Mcbsp_DataDelay_t | Mcbsp_DataDelay |
| Enum to select Data delay in bits. | |
| typedef enum Mcbsp_Compand_t | Mcbsp_Compand |
| Enum to select the companding law. | |
| typedef enum Mcbsp_BitReversal_t | Mcbsp_BitReversal |
| McBSP 32-bit reversal feature. | |
| typedef enum Mcbsp_FsClkMode_t | Mcbsp_FsClkMode |
| Frame sync clock source. | |
| typedef enum Mcbsp_TxRxClkMode_t | Mcbsp_TxRxClkMode |
| Clock source selection ENUM. | |
| typedef enum Mcbsp_ClkPol_t | Mcbsp_ClkPol |
| Clock polarity. | |
| typedef enum Mcbsp_FsPol_t | Mcbsp_FsPol |
| Frame sync polarity. | |
| typedef enum Mcbsp_IntMode_t | Mcbsp_IntMode |
| MCBSP Interrupt mode. | |
| typedef enum Mcbsp_McmMode_t | Mcbsp_McmMode |
| Transmit multichannel selection mode bit. | |
| typedef enum Mcbsp_PartitionSel_t | Mcbsp_PartitionSel |
| Partition A/B block channel selection bit. | |
| typedef enum Mcbsp_PartitionMode_t | Mcbsp_PartitionMode |
| Multichannel partition mode selection. | |
| typedef struct Mcbsp_srgConfig_t | Mcbsp_srgConfig |
| McBSP sample rate generator configuration structure. | |
| typedef struct Mcbsp_DataConfig_t | Mcbsp_DataConfig |
| Mcbsp TX/RX section configuration structure. | |
| typedef struct Mcbsp_McrSetup_t | Mcbsp_McrSetup |
| Mcbsp multi channel control settings. | |
| typedef struct Mcbsp_ClkSetup_t | Mcbsp_ClkSetup |
| Mcbsp clock settings setup structure. | |
| typedef struct Mcbsp_TempBuffer_t | Mcbsp_TempBuffer |
| Loop job buffer structure. This structure defines the format of the Loop job buffer. | |
| typedef void(* | Mcbsp_GblErrCallback )(uint32_t Arg1, uint32_t Arg2, uint32_t Arg3) |
| Global error callback function protype. | |
| typedef struct Mcbsp_ChanParams_t | Mcbsp_ChanParams |
| McBSP channel setup params. | |
| typedef struct Mcbsp_Params_t | Mcbsp_Params |
| McBSP device create params. | |
| typedef struct Mcbsp_QueueElem_t | Mcbsp_QueueElem |
| McBSP queue element. | |
| typedef struct Mcbsp_IOBuf_t | Mcbsp_IOBuf |
| McBSP frame object params. | |
| typedef void(* | Mcbsp_CallbackFxn )(void *arg, Mcbsp_IOBuf *ioBuf) |
| MCBSP driver callback function. | |
| typedef enum Mcbsp_IOCTL_t | Mcbsp_IOCTL |
| McBSP Ioctl commands. | |
Enumerations | |
| enum | Mcbsp_DevMode_t { Mcbsp_DevMode_McBSP = (0u) } |
Mcbsp device operational mode. More... | |
| enum | Mcbsp_OpMode_t { Mcbsp_OpMode_POLLED = 0, Mcbsp_OpMode_INTERRUPT, Mcbsp_OpMode_DMAINTERRUPT } |
Mcbsp driver operational mode. More... | |
| enum | Mcbsp_EmuMode_t { Mcbsp_EmuMode_SOFT_ABORT = (0u), Mcbsp_EmuMode_SOFT_STOP = (1u), Mcbsp_EmuMode_FREE = (2u) } |
Mcbsp Emulation mode settings. More... | |
| enum | Mcbsp_Loopback_t { Mcbsp_Loopback_DISABLE = 0, Mcbsp_Loopback_ENABLE = 1 } |
McBSP digital loopback mode selection. More... | |
| enum | Mcbsp_Rxjust_t { Mcbsp_RxJust_RZF = (0u), Mcbsp_RxJust_RSE = (1u), Mcbsp_RxJust_RxJUST_LZF = (2u) } |
ENUM for receive data justification settings. More... | |
| enum | Mcbsp_DxEna_t { Mcbsp_DxEna_OFF = (0), Mcbsp_DxEna_ON = (1u) } |
Transmit pin mode configuration. More... | |
| enum | Mcbsp_ClkSPol_t { Mcbsp_ClkSPol_RISING_EDGE = 0, Mcbsp_ClkSPol_FALLING_EDGE = 1 } |
Polarity of the CLKS pin. More... | |
| enum | Mcbsp_SrgClk_t { Mcbsp_SrgClk_CLKS = (0u), Mcbsp_SrgClk_CLKCPU = (1u), Mcbsp_SrgClk_CLKR = (2u), Mcbsp_SrgClk_CLKX = (3u) } |
SRG clock source. More... | |
| enum | Mcbsp_BufferFormat_t |
Enum to specify the supported buffer formats. More... | |
| enum | Mcbsp_Phase_t { Mcbsp_Phase_SINGLE = (0u), Mcbsp_Phase_DUAL = (1u) } |
Mcbsp PHASE control enums. More... | |
| enum | Mcbsp_WordLength_t { Mcbsp_WordLength_8 = 8u, Mcbsp_WordLength_12 = 12u, Mcbsp_WordLength_16 = 16u, Mcbsp_WordLength_20 = 20u, Mcbsp_WordLength_24 = 24u, Mcbsp_WordLength_32 = 32u } |
Mcbsp supported wordlength. More... | |
| enum | Mcbsp_FrmSync_t { Mcbsp_FrmSync_DETECT = (0u), Mcbsp_FrmSync_IGNORE = (1u) } |
Frame sync ignore status enum. More... | |
| enum | Mcbsp_DataDelay_t { Mcbsp_DataDelay_0_BIT = (0u), Mcbsp_DataDelay_1_BIT = (1u), Mcbsp_DataDelay_2_BIT = (2u) } |
Enum to select Data delay in bits. More... | |
| enum | Mcbsp_Compand_t { Mcbsp_Compand_OFF_MSB_FIRST = (0u), Mcbsp_Compand_OFF_LSB_FIRST = (1u), Mcbsp_Compand_MULAW = (2u), Mcbsp_Compand_ALAW = (3u) } |
Enum to select the companding law. More... | |
| enum | Mcbsp_BitReversal_t { Mcbsp_BitReversal_DISABLE = (0u), Mcbsp_BitReversal_ENABLE = (1u) } |
McBSP 32-bit reversal feature. More... | |
| enum | Mcbsp_FsClkMode_t { Mcbsp_FsClkMode_EXTERNAL = (0u), Mcbsp_FsClkMode_INTERNAL = (1u), Mcbsp_FsClkMode_DXR_XSR = (2u) } |
Frame sync clock source. More... | |
| enum | Mcbsp_TxRxClkMode_t { Mcbsp_TxRxClkMode_EXTERNAL = (0u), Mcbsp_TxRxClkMode_INTERNAL = (1u) } |
Clock source selection ENUM. More... | |
| enum | Mcbsp_ClkPol_t { Mcbsp_ClkPol_RISING_EDGE = (0u), Mcbsp_ClkPol_FALLING_EDGE = (1u), Mcbsp_ClkPol_SRG_RISING_EDGE = (0u), Mcbsp_ClkPol_SRG_FALLING_EDGE = (1u) } |
Clock polarity. More... | |
| enum | Mcbsp_FsPol_t { Mcbsp_FsPol_ACTIVE_HIGH = (0u), Mcbsp_FsPol_ACTIVE_LOW = (1u) } |
Frame sync polarity. More... | |
| enum | Mcbsp_IntMode_t { Mcbsp_IntMode_ON_READY = (0u), Mcbsp_IntMode_ON_EOB = (1u), Mcbsp_IntMode_ON_FSYNC = (2u), Mcbsp_IntMode_ON_SYNCERR = (3u) } |
MCBSP Interrupt mode. More... | |
| enum | Mcbsp_McmMode_t { Mcbsp_McmMode_ALL_CHAN_ENABLED_UNMASKED = (0u), Mcbsp_McmMode_ALL_CHAN_DISABLED_UNMASKED = (1u), Mcbsp_McmMode_ALL_CHAN_ENABLED_MASKED = (2u), Mcbsp_McmMode_ALL_CHAN_DISABLED_MASKED = (3u) } |
Transmit multichannel selection mode bit. More... | |
| enum | Mcbsp_PartitionSel_t { Mcbsp_PartitionMode_CHAN_0_15 = (0u), Mcbsp_PartitionMode_CHAN_16_31 = (0u), Mcbsp_PartitionMode_CHAN_32_47 = (1u), Mcbsp_PartitionMode_CHAN_48_63 = (1u), Mcbsp_PartitionMode_CHAN_64_79 = (2u), Mcbsp_PartitionMode_CHAN_80_95 = (2u), Mcbsp_PartitionMode_CHAN_96_111 = (3u), Mcbsp_PartitionMode_CHAN_112_127 = (3u) } |
Partition A/B block channel selection bit. More... | |
| enum | Mcbsp_PartitionMode_t { Mcbsp_PartitionMode_2 = (0u), Mcbsp_PartitionMode_8 = (1u) } |
Multichannel partition mode selection. More... | |
| enum | Mcbsp_IOCTL_t { Mcbsp_IOCTL_START = 128, Mcbsp_IOCTL_SAMPLE_RATE_CHANGE, Mcbsp_IOCTL_STOP, Mcbsp_IOCTL_SRGR_START, Mcbsp_IOCTL_SRGR_STOP, Mcbsp_IOCTL_FSGR_START, Mcbsp_IOCTL_FSGR_STOP, Mcbsp_IOCTL_SET_TIMEOUT, Mcbsp_IOCTL_MUTE_ON, Mcbsp_IOCTL_MUTE_OFF, Mcbsp_IOCTL_PAUSE, Mcbsp_IOCTL_RESUME, Mcbsp_IOCTL_CHAN_RESET, Mcbsp_IOCTL_DEVICE_RESET, Mcbsp_IOCTL_SET_CLKMODE, Mcbsp_IOCTL_SET_FRMSYNCMODE, Mcbsp_IOCTL_CONFIG_SRGR, Mcbsp_IOCTL_SET_BCLK_POL, Mcbsp_IOCTL_SET_FRMSYNC_POL, Mcbsp_IOCTL_MODIFY_LOOPJOB, Mcbsp_IOCTL_SYNCERR_INT_ENABLE, Mcbsp_IOCTL_LOOPBACK, Mcbsp_IOCTL_CANCEL_PENDING_IO } |
McBSP Ioctl commands. More... | |
Functions | |
| int32_t | mcbspInit (void) |
| int32_t | mcbspBindDev (void **devp, int32_t devid, void *devParams) |
| Allocates and configures the McBSP instance specified by devid. | |
| int32_t | mcbspUnBindDev (void *devp) |
| Closes the McBSP device instance from use. This API is called by the application when it no longer requires the device instance. Note that all the channels have to be closed for the device instance to be deleted sucessfully. | |
| int32_t | mcbspCreateChan (void **chanp, void *devp, int32_t mode, void *chanParams, Mcbsp_CallbackFxn cbFxn, void *cbArg) |
| Creates a communication channel in specified mode to communicate data between the application and the McBSP device instance. This function sets the required hardware configurations for the data transactions. It returns configured channel handle to application which will be used in all further transactions with the channel. | |
| int32_t | mcbspDeleteChan (void *chanp) |
| frees a channel and all it's associated resources. | |
| int32_t | mcbspSubmitChan (void *chanp, Mcbsp_IOBuf *const ioBuf) |
| Submit a I/O buffer to a channel for processing. | |
| int32_t | mcbspControlChan (void *chanp, Mcbsp_IOCTL cmd, void *arg) |
| Implements the IOCTLS for McBSP driver. | |
| void | mcbspGblXmtIsr (void *hChan) |
| McBSP Tx ISR function. | |
| void | mcbspGblRcvIsr (void *hChan) |
| McBSP Rx ISR function. | |
McBSP 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 McBSP device driver.
(C) Copyright 2012, Texas Instruments, Inc
| #define MCBSP_CACHE_LENGTH (128u) |
Defines the Maximum length of cache line that is possible.
| #define MCBSP_COMPILE_TIME_SIZE_CHECK | ( | postulate | ) |
do { \ typedef struct { \ uint8_t McbspNegativeSizeIfPostulateFalse[((int)(postulate))*2 - 1]; \ } McbspPostulateCheck_t; \ } \ while (0)
This macro generates compiler error if postulate is false, so allows 0 overhead compile time size check. This "works" when the expression contains sizeof() which otherwise doesn't work with preprocessor.
| #define MCBSP_CTRL_CHAN_RESET 0 |
McBSP Driver Command Codes Reserved for Control.
Mcbsp driver command codes reserved for control.
Reset channel only
| #define MCBSP_CTRL_CHAN_TIMEDOUT 1 |
Channel timeout occured
| #define MCBSP_CTRL_DEVICE_RESET 2 |
Reset entire device
| #define MCBSP_ERR_ABORT -6 |
I/O was aborted before completed
| #define MCBSP_ERR_ALLOC -5 |
Unable to allocate resource
| #define MCBSP_ERR_BADARGS -10 |
Invalid arguments specified
| #define MCBSP_ERR_BADIO -1 |
McBSP Driver Error Codes.
Mcbsp driver error codes.
Generic failure condition
| #define MCBSP_ERR_BADMODE -7 |
Invalid device mode
| #define MCBSP_ERR_EOF -8 |
End-of-File was encountered
| #define MCBSP_ERR_FREE -4 |
Unable to free resources
| #define MCBSP_ERR_INUSE -12 |
Device already in use
| #define MCBSP_ERR_NOIOBUFFERS -3 |
No buffers available for I/O
| #define MCBSP_ERR_NOTIMPL -9 |
Operation not implemented or supported
| #define MCBSP_ERR_TIMEOUT -2 |
Timeout occurred
| #define MCBSP_ERR_TIMEOUTUNREC -11 |
Unrecoverable timeout occurred
| #define Mcbsp_IOBuf_Cmd_ABORT 2 |
Abort command
| #define Mcbsp_IOBuf_Cmd_FLUSH 3 |
Flush command
| #define Mcbsp_IOBuf_Cmd_READ 0 |
McBSP Driver Buffer Frame Command Codes.
Mcbsp driver frame command codes.
Read command
| #define Mcbsp_IOBuf_Cmd_WRITE 1 |
Write command
| #define MCBSP_MAX_CACHE_ALIGN (128u) |
Defines the Maximum cache line size for alignment.
| #define MCBSP_MODE_INOUT (MCBSP_MODE_INPUT | MCBSP_MODE_OUTPUT) |
Defines the mode as input and output.
| #define MCBSP_MODE_INPUT 0x0001 |
McBSP Create Modes.
Mcbsp driver create functions take a mode parameter.
Defines the mode as input.
| #define MCBSP_MODE_OUTPUT 0x0002 |
Defines the mode as output.
| #define Mcbsp_POLLED_RETRYCOUNT (0xFFFFu) |
This macro specifies the default retry count to be used by the Mcbsp driver when polling for any hardware bit to be set or reset.
| #define MCBSP_STATUS_ABORTED 3 |
Defines the status as request aborted. Non-completed read or write requests return w/ MCBSP_STATUS_ABORTED.
| #define MCBSP_STATUS_COMPLETED 0 |
McBSP Driver Status Codes.
Mcbsp driver status codes.
Defines the status as completed successfully.
| #define MCBSP_STATUS_FLUSHED 2 |
Defines the status as request flushed. Queued writes will be completed w/ MCBSP_STATUS_COMPLETED. Queued read requests return w/ MCBSP_STATUS_FLUSHED.
| #define MCBSP_STATUS_PENDING 1 |
Defines the status as queued and pending.
| typedef enum Mcbsp_BitReversal_t Mcbsp_BitReversal |
McBSP 32-bit reversal feature.
This ENUM allows the user to select the option of BIT reversal. McBSP 32-bit reversal feature
| typedef enum Mcbsp_BufferFormat_t Mcbsp_BufferFormat |
Enum to specify the supported buffer formats.
Interleaved and non-interleaved is standard format, this enumeration captures the standard and custom data formats. Mcbsp supported buffer formats
| typedef void(* Mcbsp_CallbackFxn)(void *arg, Mcbsp_IOBuf *ioBuf) |
MCBSP driver callback function.
This is the driver's callback function. The driver will call a function of this type whenever an I/O operation is over.
| typedef struct Mcbsp_ChanParams_t Mcbsp_ChanParams |
McBSP channel setup params.
This structure holds configuration to be used for creating a channel of the Mcbsp. These parameters need to be specified during the creation of the channel. Mcbsp Channel setup parameters
| typedef enum Mcbsp_ClkPol_t Mcbsp_ClkPol |
Clock polarity.
Use this symbol to set XMT or RCV clock polarity as rising or falling edge Clock polarity
| typedef struct Mcbsp_ClkSetup_t Mcbsp_ClkSetup |
Mcbsp clock settings setup structure.
This structure contains the information required to configure the clocks for the Mcbsp.Both the frame sync settings and the bit clock settings can be configured in this structure. Mcbsp clock settings setup structure
| typedef enum Mcbsp_ClkSPol_t Mcbsp_ClkSPol |
Polarity of the CLKS pin.
Enum to Set the polarity of the CLKS pin used to generate Frame Sync and bit clock Polarity of the CLKS pin
| typedef enum Mcbsp_Compand_t Mcbsp_Compand |
Enum to select the companding law.
Use this Enum to select the appropriate companding rule applicable. Enum to select the companding law
| typedef struct Mcbsp_DataConfig_t Mcbsp_DataConfig |
Mcbsp TX/RX section configuration structure.
This strcuture specifies the configuration for the McBSP data stream including the whether it is single phase or dual phase, number of frames,the word length in each phase and data delay etc. Mcbsp TX/RX section configuration structure.
| typedef enum Mcbsp_DataDelay_t Mcbsp_DataDelay |
Enum to select Data delay in bits.
Use this Enum to set XMT/RCV Data Delay (in bits) Enum to select Data delay in bits
| typedef enum Mcbsp_DevMode_t Mcbsp_DevMode |
Mcbsp device operational mode.
This enum is used to define the operational mode of the mcbsp device like normal mcbsp device. Mcbsp device operational mode.
| typedef enum Mcbsp_DxEna_t Mcbsp_DxEna |
Transmit pin mode configuration.
DX pin settings used for setting the pin in high impedance mode. DX pin High impedance enable/disable option
| typedef enum Mcbsp_EmuMode_t Mcbsp_EmuMode |
Mcbsp Emulation mode settings.
Use this symbol to set the Emulation Mode to Free mode or any other mode.
| typedef enum Mcbsp_FrmSync_t Mcbsp_FrmSync |
Frame sync ignore status enum.
| typedef enum Mcbsp_FsClkMode_t Mcbsp_FsClkMode |
Frame sync clock source.
Use this ENUM to set the frame sync clock source as internal or external Frame sync clock source
| typedef enum Mcbsp_FsPol_t Mcbsp_FsPol |
Frame sync polarity.
Use this symbol to set frame sync polarity as active-high or active-low Frame sync polarity
| typedef void(* Mcbsp_GblErrCallback)(uint32_t Arg1, uint32_t Arg2, uint32_t Arg3) |
Global error callback function protype.
This is the global error callback function for the McBSP driver. This function is called directly called from ISR context in case of error.
| typedef enum Mcbsp_IntMode_t Mcbsp_IntMode |
MCBSP Interrupt mode.
Use this symbol to set Interrupt mode (i.e. source of interrupt generation).This symbol is used on both RCV and XMT for RINT and XINT generation mode. MCBSP Interrupt mode
| typedef struct Mcbsp_IOBuf_t Mcbsp_IOBuf |
McBSP frame object params.
Mcbsp_IOBuf structures are managed by the driver. MCBSP buffers are the basis for all I/O operations. 'cmd' field contains the command id for the driver. 'status' is filled in by the driver and contains the status of the commmand. Mcbsp frame object params
| typedef enum Mcbsp_IOCTL_t Mcbsp_IOCTL |
McBSP Ioctl commands.
List of all the ioctl commands supported by the Mcbsp driver. McBSP Ioctl commands list
| typedef enum Mcbsp_Loopback_t Mcbsp_Loopback |
McBSP digital loopback mode selection.
Enum to select the enable/disable of Loopback mode of the mcbsp. McBSP digital loopback mode selection
| typedef enum Mcbsp_McmMode_t Mcbsp_McmMode |
Transmit multichannel selection mode bit.
MCM determines whether all channels or only selected channels are enabled and unmasked for transmission/reception. Transmit multichannel selection mode bit.
| typedef struct Mcbsp_McrSetup_t Mcbsp_McrSetup |
Mcbsp multi channel control settings.
structure to configure the multi channel settings for the mcbsp.used when the multi channel configuration is to be enabled. Mcbsp multi channel control settings
| typedef enum Mcbsp_OpMode_t Mcbsp_OpMode |
Mcbsp driver operational mode.
Enumeration of the different modes of operation available for the Mcbsp device driver.(Mcbsp driver supports only EDMA mode). Mcbsp driver operational mode
| typedef struct Mcbsp_Params_t Mcbsp_Params |
McBSP device create params.
This structure holds the configuration to be used for the creation of the Mcbsp device instance.This configuration need to be supplied during the creation of the device instance. McBSP device setup params
| typedef enum Mcbsp_PartitionMode_t Mcbsp_PartitionMode |
Multichannel partition mode selection.
Multichannel mode allows selection of either an 2 partition mode or 8 partition mode.This enum allows the user to select the required partition mode of choice. Multichannel partition mode selction
| typedef enum Mcbsp_PartitionSel_t Mcbsp_PartitionSel |
Partition A/B block channel selection bit.
Partition A/B block selection bit.
| typedef enum Mcbsp_Phase_t Mcbsp_Phase |
Mcbsp PHASE control enums.
| typedef struct Mcbsp_QueueElem_t Mcbsp_QueueElem |
McBSP queue element.
Doubly linked list for queue elements. Required for Mcbsp_IOBuf structure.
| typedef enum Mcbsp_Rxjust_t Mcbsp_Rxjust |
ENUM for receive data justification settings.
Use this symbol for setting up RCV sign-extension and justification mode Enumeration for the Receive data justification
| typedef enum Mcbsp_SrgClk_t Mcbsp_SrgClk |
SRG clock source.
Use this symbol to select input clock source for Sample Rate Generator SRG clock source selection
| typedef struct Mcbsp_srgConfig_t Mcbsp_srgConfig |
McBSP sample rate generator configuration structure.
Configurations for the Sample rate generator to generate the BCLK and Frame Sync signals are specified using this structure. McBSP sample rate generator configuration structure
| typedef struct Mcbsp_TempBuffer_t Mcbsp_TempBuffer |
Loop job buffer structure. This structure defines the format of the Loop job buffer.
| typedef enum Mcbsp_TxRxClkMode_t Mcbsp_TxRxClkMode |
Clock source selection ENUM.
Use this symbol to set the clock source as internal or external Clock source selection ENUM
| typedef enum Mcbsp_WordLength_t Mcbsp_WordLength |
Mcbsp supported wordlength.
Enumerated constant for wordlength supported by the MCBSP device Mcbsp supported wordlength.
| enum Mcbsp_BitReversal_t |
McBSP 32-bit reversal feature.
This ENUM allows the user to select the option of BIT reversal.
| enum Mcbsp_BufferFormat_t |
Enum to specify the supported buffer formats.
Interleaved and non-interleaved is standard format, this enumeration captures the standard and custom data formats.
| enum Mcbsp_ClkPol_t |
Clock polarity.
Use this symbol to set XMT or RCV clock polarity as rising or falling edge
| enum Mcbsp_ClkSPol_t |
| enum Mcbsp_Compand_t |
Enum to select the companding law.
Use this Enum to select the appropriate companding rule applicable.
| enum Mcbsp_DataDelay_t |
| enum Mcbsp_DevMode_t |
| enum Mcbsp_DxEna_t |
| enum Mcbsp_EmuMode_t |
Mcbsp Emulation mode settings.
Use this symbol to set the Emulation Mode to Free mode or any other mode.
| enum Mcbsp_FrmSync_t |
| enum Mcbsp_FsClkMode_t |
| enum Mcbsp_FsPol_t |
| enum Mcbsp_IntMode_t |
MCBSP Interrupt mode.
Use this symbol to set Interrupt mode (i.e. source of interrupt generation).This symbol is used on both RCV and XMT for RINT and XINT generation mode.
| enum Mcbsp_IOCTL_t |
McBSP Ioctl commands.
List of all the ioctl commands supported by the Mcbsp driver.
| enum Mcbsp_Loopback_t |
| enum Mcbsp_McmMode_t |
Transmit multichannel selection mode bit.
MCM determines whether all channels or only selected channels are enabled and unmasked for transmission/reception.
| enum Mcbsp_OpMode_t |
Multichannel partition mode selection.
Multichannel mode allows selection of either an 2 partition mode or 8 partition mode.This enum allows the user to select the required partition mode of choice.
| enum Mcbsp_PartitionSel_t |
Partition A/B block channel selection bit.
| enum Mcbsp_Phase_t |
| enum Mcbsp_Rxjust_t |
ENUM for receive data justification settings.
Use this symbol for setting up RCV sign-extension and justification mode
| enum Mcbsp_SrgClk_t |
SRG clock source.
Use this symbol to select input clock source for Sample Rate Generator
| enum Mcbsp_TxRxClkMode_t |
| enum Mcbsp_WordLength_t |
Mcbsp supported wordlength.
Enumerated constant for wordlength supported by the MCBSP device
| int32_t mcbspBindDev | ( | void ** | devp, | |
| int32_t | devid, | |||
| void * | devParams | |||
| ) |
Allocates and configures the McBSP instance specified by devid.
Acquires the Handle of the McBSP and configure the McBSP by default for the following things. o Data output for audio playback o Data input for audio recording o Configure the McBSP in DSP/TDM data format mode of the audio codec. o Configure the McBSP to receive the Frame Sync and bit clock externally for both receiver and transmitter. o McBSP can also be configured to generate Frame Sync and bit clock internally by enabling sample rate generator and frame sync generator blocks respectively depending on the fields set in the device parameter structure which shall be passed to mcbspBindDev() function as one of the parameter.
| devp | [OUT] pointer to hold allocated instance object ptr | |
| devid | [IN] instance number of the mcbsp | |
| devParams | [IN] user supplied data params. |
MCBSP_ERR_BADARGS if not successful MCBSP_ERR_ALLOC
devp should be non NULL and valid pointer, devId should be < CSL_MCBSP_PER_CNT devParams should be non NULL and valid pointer,
Not implemented
| int32_t mcbspControlChan | ( | void * | chanp, | |
| Mcbsp_IOCTL | cmd, | |||
| void * | arg | |||
| ) |
Implements the IOCTLS for McBSP driver.
ControlChan() implements recieved IOCTL commands from the application and executes them accordingly.
| chanp | [IN] Pointer to channel | |
| cmd | [IN] specific IOCTL command | |
| arg | [IN] arguments required for specific commands |
| int32_t mcbspCreateChan | ( | void ** | chanp, | |
| void * | devp, | |||
| int32_t | mode, | |||
| void * | chanParams, | |||
| Mcbsp_CallbackFxn | cbFxn, | |||
| void * | cbArg | |||
| ) |
Creates a communication channel in specified mode to communicate data between the application and the McBSP device instance. This function sets the required hardware configurations for the data transactions. It returns configured channel handle to application which will be used in all further transactions with the channel.
Pre-requisites: 1. Valid chanParams structure This takes much information pertaining to mcbsp channel configuration such as how many slots are used for this channel what are their communication parameters, clock settings etc. 2. Valid device pointer
| chanp | [IN] Channel Handler | |
| devp | [IN] Device pointer | |
| mode | [IN] channel mode -> input or output | |
| chanParams | [IN] channel parameters from user | |
| cbFxn | [IN] callback function pointer | |
| cbArg | [IN] callback function Arguments |
| int32_t mcbspDeleteChan | ( | void * | chanp | ) |
frees a channel and all it's associated resources.
Frees the EDMA resources including EDMA master channel and link PaRAM entries held by the channel.it also unregisters all the interrupt handlers.
| chanp | [IN] Handle to the channel |
chanp should be non NULL and valid pointer,
Not implemented
| void mcbspGblRcvIsr | ( | void * | hChan | ) |
McBSP Rx ISR function.
This Function is the interrupt service routine for the Mcbsp RX event.
| hChan | [IN] Handle to the channel |
| void mcbspGblXmtIsr | ( | void * | hChan | ) |
McBSP Tx ISR function.
This Function is the interrupt service routine for the Mcbsp TX event.
| hChan | [IN] Handle to the channel |
| int32_t mcbspInit | ( | void | ) |
Description
This is the MCBSP Driver Initialization API which needs to be invoked by the users to initialize the MCBSP peripheral. This call is *mandatory* and should be called before calling any of the other driver API's.
This should only be called *ONCE* for the device.
| MCBSP_STATUS_COMPLETED | if successful | |
| MCBSP_ERR_BADARGS | if not successful MCBSP_ERR_ALLOC |
| int32_t mcbspSubmitChan | ( | void * | chanp, | |
| Mcbsp_IOBuf *const | ioBuf | |||
| ) |
Submit a I/O buffer to a channel for processing.
The application calls this function to cause the driver to process the Mcbsp_IOBuf for read/write/flush/abort operations.
| chanp | [IN] Pointer to channel | |
| ioBuf | [IN] Pointer to buffer to be submitted |
| int32_t mcbspUnBindDev | ( | void * | devp | ) |
Closes the McBSP device instance from use. This API is called by the application when it no longer requires the device instance. Note that all the channels have to be closed for the device instance to be deleted sucessfully.
| devp | [IN] Handle to the device created. |
devp should be non NULL and valid pointer,
Not implemented