# tcp3d_drv.h File Reference

Header file for the TCP3 Decoder Driver. The file exposes the data structures and exported API which are available for use by the driver users. More...

`#include <tcp3d_drv_types.h>`
`#include <ti/sdo/edma3/drv/edma3_drv.h>`
`#include <ti/csl/cslr_tpcc.h>`
`#include <ti/csl/cslr_tcp3d_cfg.h>`
`#include <ti/csl/cslr_tcp3d_dma.h>`
`#include "tcp3dver.h"`

## Data Structures

struct | Tcp3d_SizeCfg
| Parameters which determine buffer sizes. More...
struct | Tcp3d_MemBuffer
| Memory Buffer Structure. More...
struct | Tcp3d_CtrlParams
| The TCP3 decoder initialization parameters structure holds all the information concerning the user channel. These values are used to generate the control configuration register values for the TCP3D. More...
struct | Tcp3d_InCfgParams
| The TCP3D runtime parameters structure holds all the information that could be changed per code block. These values are used to generate the appropriate input configuration register values for the TCP3D. More...
struct | Tcp3d_Config
| Structure to store TCP3 decoder specific values to identify its instance configuration information. This is created to facilitate the application to choose TCP3 decoder (either TCP3D_A or TCP3D_B) for which the driver will be configured. More...
struct | Tcp3d_Instance
| TCP3D Driver instance structure. More...
struct | Tcp3d_InitParams
| TCP3D Driver Initialization parameters structure. More...
struct | Tcp3d_Sts
| TCP3D Driver Status structure. More...
struct | Tcp3d_Ctrl
| TCP3D Driver Control structure. More...

## Defines

#define | TCP3D_DRV_MAX_NUM_INSTANCES (CSL_TCP3D_PER_CNT)
| Used for indexing the Status Channel.
#define | TCP3D_DRV_MAX_CH_PER_PATH (2u)
| This is the TCP3D Driver maximum channels required per each PING and PONG paths. Channel Index values are defined to get references to the pingCh[] or pongCh[] arrays in the driver instance.
#define | TCP3D_DRV_CH_IDX_REVT (0u)
| Used for indexing the Status Channel.
#define | TCP3D_DRV_CH_IDX_L2P (1u)
| Used for indexing the L2 to PaRAM Channel.
#define | TCP3D_DRV_LINK_CB (5u)
| Maximum Link channels required per code block for swapping from pseudo PaRAM memory during run-time.
#define | TCP3D_DRV_LINK_CTRL (4u)
| Number of Link channels used for control/reload operations.
#define | TCP3D_DRV_LINK_NOTIFY (2u)
| Number of Link channels used for notification use.
#define | TCP3D_DRV_MAX_LINK_CH
| This is the TCP3D Driver maximum link channels required for both PING and PONG paths.
#define | TCP3D_DRV_NUM_BUF (2u)
| This define gives the number of buffers required for TCP3D Driver.
#define | TCP3D_DRV_INST_BUFN (0u)
| This is used for getting the instance buffer index.
#define | TCP3D_DRV_PSEUDO_PARAM_BUFN (1u)
| This is used for getting the pseudo param buffer index.
#define | TCP3D_DRV_START_PING (1u)
| This is the start flag for PING.
#define | TCP3D_DRV_START_PONG (2u)
| This is the start flag for PONG.
#define | TCP3D_DRV_START_AUTO (3u)
| This is the start flag for AUTO.

## Typedefs

typedef enum Tcp3d_BufClass | Tcp3d_BufClass
| Memory Buffer class definitions.
typedef enum Tcp3d_Result | Tcp3d_Result
| Driver return values to application.
typedef enum Tcp3d_State | Tcp3d_State
| Driver state indication.
typedef enum Tcp3d_CtrlCmd | Tcp3d_CtrlCmd
| Driver Control Commands.
typedef enum Tcp3d_StsCmd | Tcp3d_StsCmd
| Driver Status query Commands.
typedef struct Tcp3d_SizeCfg | Tcp3d_SizeCfg
| Parameters which determine buffer sizes.
typedef struct Tcp3d_MemBuffer | Tcp3d_MemBuffer
| Memory Buffer Structure.
typedef struct Tcp3d_CtrlParams | Tcp3d_CtrlParams
| The TCP3 decoder initialization parameters structure holds all the information concerning the user channel. These values are used to generate the control configuration register values for the TCP3D.
typedef struct Tcp3d_InCfgParams | Tcp3d_InCfgParams
| The TCP3D runtime parameters structure holds all the information that could be changed per code block. These values are used to generate the appropriate input configuration register values for the TCP3D.
typedef struct Tcp3d_Config | Tcp3d_Config
| Structure to store TCP3 decoder specific values to identify its instance configuration information. This is created to facilitate the application to choose TCP3 decoder (either TCP3D_A or TCP3D_B) for which the driver will be configured.
typedef struct Tcp3d_Instance | Tcp3d_Instance
| TCP3D Driver instance structure.
typedef struct Tcp3d_InitParams | Tcp3d_InitParams
| TCP3D Driver Initialization parameters structure.
typedef struct Tcp3d_Sts | Tcp3d_Sts
| TCP3D Driver Status structure.
typedef struct Tcp3d_Ctrl | Tcp3d_Ctrl
| TCP3D Driver Control structure.

## Enumerations

enum | Tcp3d_BufClass { Tcp3d_BufClass_EXTERNAL = 0, Tcp3d_BufClass_INTERNAL, Tcp3d_BufClass_L2RAM, Tcp3d_BufClass_L2SRAM, Tcp3d_BufClass_MSMC }
| Memory Buffer class definitions. More...
enum | Tcp3d_Result { TCP3D_DRV_NO_ERR, TCP3D_DRV_FAIL, TCP3D_DRV_INPUT_LIST_FULL, TCP3D_DRV_INVALID_INSTANCE_NUMBER, TCP3D_DRV_INVALID_PARAMETER, TCP3D_DRV_INVALID_STATE, TCP3D_DRV_INVALID_BUFF, TCP3D_DRV_INVALID_EDMA_CH, TCP3D_DRV_FAIL_EDMA_PARAM_INIT, TCP3D_DRV_FAIL_EDMA_ENABLE_CHANNEL, TCP3D_DRV_FAIL_EDMA_GET_PARAM_ADDR
}
| Driver return values to application. More...
enum | Tcp3d_State { TCP3D_DRV_STATE_INIT = 0, TCP3D_DRV_STATE_RUNNING, TCP3D_DRV_STATE_PAUSE }
| Driver state indication. More...
enum | Tcp3d_CtrlCmd { TCP3D_DRV_SET_REVT_INT, TCP3D_DRV_CLR_REVT_INT, TCP3D_DRV_SET_L2P_INT, TCP3D_DRV_SET_PING_PAUSE_INT, TCP3D_DRV_SET_PONG_PAUSE_INT, TCP3D_DRV_SET_PING_L2P_INT, TCP3D_DRV_SET_PONG_L2P_INT }
| Driver Control Commands. More...
enum | Tcp3d_StsCmd { TCP3D_DRV_GET_STATE, TCP3D_DRV_GET_PING_OUT_IDX, TCP3D_DRV_GET_PONG_OUT_IDX, TCP3D_DRV_GET_MIN_OUT_IDX }
| Driver Status query Commands. More...

## Functions

Tcp3d_Result | Tcp3d_getNumBuf (IN Tcp3d_SizeCfg *cfg, OUT int16_t *nbufs)
Tcp3d_Result | Tcp3d_getBufDesc (IN Tcp3d_SizeCfg *cfg, OUT Tcp3d_MemBuffer bufs[])
Tcp3d_Result | Tcp3d_reset (IN Tcp3d_Instance *tcp3dInst, IN uint32_t codeBlocks)
Tcp3d_Result | Tcp3d_init (IN Tcp3d_MemBuffer bufs[], IN Tcp3d_InitParams *drvInitParams)
Tcp3d_Result | Tcp3d_deInit (IN Tcp3d_Instance *tcp3dInst)
Tcp3d_Result | Tcp3d_enqueueCodeBlock (IN Tcp3d_Instance *tcp3dInst, IN uint32_t blockLength, IN uint32_t *inputConfigPtr, IN int8_t *llrPtr, IN uint32_t llrOffset, IN uint32_t *hdPtr, IN int8_t *sdPtr, IN uint32_t sdOffset, IN uint32_t *statusPtr, IN uint8_t ntfEventFlag)
Tcp3d_Result | Tcp3d_start (IN Tcp3d_Instance *inst, IN uint8_t startMode)
Tcp3d_Result | Tcp3d_status (IN Tcp3d_Instance *inst, INOUT Tcp3d_Sts *drvStatus)
Tcp3d_Result | Tcp3d_control (IN Tcp3d_Instance *inst, IN Tcp3d_Ctrl *drvCtrl)
void | Tcp3d_prepControlRegs (IN Tcp3d_CtrlParams *ctrl, OUT uint32_t *modeReg, OUT uint32_t *endReg, OUT uint32_t *exeRegP0, OUT uint32_t *exeRegP1)
void | Tcp3d_prepFixedConfigRegs (IN Tcp3d_InCfgParams *const RESTRICT inCfgParams, OUT uint32_t *const RESTRICT outICRegs)
void | Tcp3d_prepConfigRegs (IN uint8_t mode, IN Tcp3d_InCfgParams *const RESTRICT inCfgParams, OUT uint32_t *const RESTRICT outICRegs, IN uint32_t *const RESTRICT tempICRegs, IN uint8_t copyFixedReg)
void | Tcp3d_prepBlockSizeDepConfigRegs (IN uint8_t mode, OUT uint32_t *const RESTRICT outICRegs, IN uint8_t numsw0, IN uint16_t blockLen, IN uint8_t sw0LenSel, IN uint8_t sw2LenSel, IN uint8_t sw1Len, IN uint16_t *const RESTRICT itgParam)
void | Tcp3d_prepBetaStateConfigRegs (IN uint8_t mode, OUT uint32_t *const RESTRICT outICRegs, IN int8_t *const RESTRICT betaMap0, IN int8_t *const RESTRICT betaMap1)
void | Tcp3d_betaStates (IN int8_t *const RESTRICT tailBits, IN int32_t signChange, IN int32_t Kt, OUT int8_t *const RESTRICT beta0Ptr, OUT int8_t *const RESTRICT beta1Ptr)
uint32_t | Tcp3d_getVersion (void)
const char * | Tcp3d_getVersionStr (void)

## Detailed Description

Header file for the TCP3 Decoder Driver. The file exposes the data structures and exported API which are available for use by the driver users.

  NOTE: (C) Copyright 2011 Texas Instruments, Inc.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Copyright 2012, Texas Instruments Incorporated