Data Structures | Defines | Typedefs | Enumerations | Functions | Variables
AIF

Data Structures

struct  AIF_LinkConfigObj
 This structure contains the parameters for the initialization of a AIF2 link of the TMS320C6670. It also contains a reference to the CSL AIF object instance. More...
struct  AIF_DioConfigObj
 This structure contains the parameters for the initialization of a AIF2 link of the TMS320C6670. It also contains a reference to the CSL AIF object instance. More...
struct  AIF_PktDmaConfigObj
 This structure contains the parameters for the PKTDMA and QMSS setup. More...
struct  AIF_HfnSyncObj
 This structure contains the parameters for the hfn sync state. It could be used to detect when sync is established (syncStatusChange = 1 and hfnsyncState = 1) or when sync is lost (syncStatusChange = 1 and hfnsyncState = 0) The context is in the AIF_getException processing function where below parameters are updated before clearing the exceptions. More...
struct  AIF_EeCountObj
 This structure contains the pointers to the AIF2 exception counters. More...
struct  AIF_DataTraceObj
 This structure contains the parameters for the AIF2 Data Trace setup. More...
struct  AIF_LteRadTimerObj
 This structure contains the parameters for the LTE specific radio timer configuration. More...
struct  AIF_RadTimerObj
 This structure contains the parameters for the AIF2 radio timer configuration. More...
struct  AIF_AxCObj
 This structure contains specific parameters for a given AIF2 antenna container (AxC). More...
struct  AIF_ConfigObj
 This structure contains the parameters for the initialization of a AIF HW module of the TMS320C6670. it includes configuration objects for all the links. More...
struct  AIF_HwContextSaveInfo
 This structure defines the AIF data items that are used by the application. This tells the AIF save/restore functions where the Application main CSL initialization structure is located. More...
struct  AIF_HwContextSaveData
 This structure defines the global (DDR) storage structure that will preserve the state of AIF while the chip is asleep. More...

Defines

#define AIF_MAX_NUM_LINKS   (CSL_AIF2_LINK_5 + 1)
#define AIF_MAX_NUM_AXC   128
#define AIF_MAX_NUM_RADT   1
#define AIF2_CRC8_POLY   0xF
#define AIF2_CRC8_SEED   0xF
#define AIF2_DB_PE_DELAY_OBSAI   28
#define AIF2_DB_PE_DELAY_CPRI   0
#define AIF2_OBSAI_TYPE_CONTROL   0x00
#define AIF2_OBSAI_TYPE_WCDMA_FDD   0x02
#define AIF2_OBSAI_TYPE_LTE   0x0E
#define AIF2_OBSAI_TYPE_GENERIC   0x0F
#define AIF2_FRAME_COUNT_TC_WCDMA_FDD   4095
#define AIF2_SLOT_COUNT_TC_WCDMA_FDD   14
#define AIF2_CLOCK_COUNT_TC_WCDMA_FDD   204799
#define AIF2_CLOCK_COUNT_TC_FIRST_OFDM_SYM_OBSAI   22080
#define AIF2_CLOCK_COUNT_TC_REST_OFDM_SYM_OBSAI   21920
#define AIF2_CLOCK_COUNT_TC_EXTCP_OFDM_SYM_OBSAI   25600
#define AIF2_FRAME_COUNT_TC_PHY_TIMER   4095
#define AIF2_OBSAI_CLOCK_COUNT_TC_PHY_TIMER   3071999
#define AIF2_CLOCK_COUNT_TC_WCDMA_FDD_CPRI   163839
#define AIF2_CLOCK_COUNT_TC_FIRST_OFDM_SYM_CPRI   17664
#define AIF2_CLOCK_COUNT_TC_REST_OFDM_SYM_CPRI   17536
#define AIF2_CLOCK_COUNT_TC_EXTCP_OFDM_SYM_CPRI   20480
#define AIF2_CPRI_CLOCK_COUNT_TC_PHY_TIMER   2457599
#define AIF2_LTE_SYMBOL_NUM   7
#define AIF2_BASE_TX_QUE_NUM   512
#define AIF2_0_RX_DATA   0x108E0000
#define AIF_LINK_DATA_TYPE_DL   CSL_AIF2_LINK_DATA_TYPE_NORMAL
#define AIF2_OBSAI_MAX_NUM_AXC_PER_2X_LINK   (8)
#define AIF2_OBSAI_MAX_NUM_AXC_PER_4X_LINK   (16)
#define AIF2_OBSAI_MAX_NUM_AXC_PER_8X_LINK   (32)
#define AIF2_CPRI_MAX_NUM_AXC_PER_2X_LINK_7_15_BIT   (8)
#define AIF2_CPRI_MAX_NUM_AXC_PER_2X_LINK_8_16_BIT   (7)
#define AIF2_MAX_NUM_DIO_ENGINE   3
#define AIF2_CPRI_MAX_CW_SUBSTREAM   4
#define AIF2_NUM_WORDS_PER_QWORD   4
#define AIF_CPRI_PE_TO_TM_DELAY   28
#define AIF_OBSAI_PE_TO_TM_DELAY   22
#define AIF_TM_FIFO_FILL_MIN   4
#define AIF_SERDES_PROCESSING_DELAY   10
#define AIF_CPRI_RM_TO_TM_DELAY   60
#define AIF_OBSAI_RM_TO_TM_DELAY   38
#define AIF_UMTS_CHIP_SPEED_3840K   3840
#define AIF_UMTS_SAMPLE_SPEED_KHZ   (AIF_UMTS_CHIP_SPEED_3840K*8)
#define AIF_VBUS_CPU_RATIO   3
#define AIF_MAX_NUM_STREAMS   16
#define AIF_OUTDATA_OFFSET   0x02000000
#define AIF_LINK_BLOCK_SIZE   0x00400000
#define AIF_LINK_PHY_BLOCK_SIZE   2048
#define AIF_OUTPSFIFO_OFFSET   0x05000000
#define AIF_PS_OUT_DATA_BLOCK_SIZE   0x80000
#define AIF_INPSFIFO_OFFSET   0x04000000
#define AIF_PS_IN_DATA_BLOCK_SIZE   0x400000
#define AIF_PS_IN_FIFO_SIZE   8
#define AIF_PS_IN_FIFO_DEPTH   CSL_AIF2_INBOUND_PS_FIFO_EVENT_DEPTH_1
#define AIF_FSYNC_EVENT_LINK0_EDMA   4
#define AIF_CFG_BASE   (0x01f00000u)

Typedefs

typedef struct AIF_LinkConfigObj AIF_LinkConfigObj
 This structure contains the parameters for the initialization of a AIF2 link of the TMS320C6670. It also contains a reference to the CSL AIF object instance.
typedef struct AIF_DioConfigObj AIF_DioConfigObj
 This structure contains the parameters for the initialization of a AIF2 link of the TMS320C6670. It also contains a reference to the CSL AIF object instance.
typedef struct AIF_PktDmaConfigObj AIF_PktDmaConfigObj
 This structure contains the parameters for the PKTDMA and QMSS setup.
typedef struct AIF_HfnSyncObj AIF_HfnSyncObj
 This structure contains the parameters for the hfn sync state. It could be used to detect when sync is established (syncStatusChange = 1 and hfnsyncState = 1) or when sync is lost (syncStatusChange = 1 and hfnsyncState = 0) The context is in the AIF_getException processing function where below parameters are updated before clearing the exceptions.
typedef struct AIF_EeCountObj AIF_EeCountObj
 This structure contains the pointers to the AIF2 exception counters.
typedef struct AIF_DataTraceObj AIF_DataTraceObj
 This structure contains the parameters for the AIF2 Data Trace setup.
typedef struct AIF_LteRadTimerObj AIF_LteRadTimerObj
 This structure contains the parameters for the LTE specific radio timer configuration.
typedef struct AIF_RadTimerObj AIF_RadTimerObj
 This structure contains the parameters for the AIF2 radio timer configuration.
typedef struct AIF_AxCObj AIF_AxCObj
 This structure contains specific parameters for a given AIF2 antenna container (AxC).
typedef struct AIF_ConfigObj AIF_ConfigObj
 This structure contains the parameters for the initialization of a AIF HW module of the TMS320C6670. it includes configuration objects for all the links.

Enumerations

enum  AIF_Mode {
  AIF_WCDMA_MODE = 0, AIF_LTE_FDD_MODE = 1, AIF_LTE_WCDMA_MODE = 2, AIF_GENERICPACKET_MODE = 3,
  AIF_LTE_TDD_MODE = 4
}
 This enum describes the AIF mode supported by the AIF2 Lib. More...
enum  AIF_SampleRate {
  AIF_SRATE_1P92MHZ = 0, AIF_SRATE_3P84MHZ, AIF_SRATE_7P68MHZ, AIF_SRATE_15P36MHZ,
  AIF_SRATE_23P04MHZ, AIF_SRATE_30P72MHZ
}
 This enum describes the AIF2 Sampling rate per link. More...
enum  AIF_Com_Mode { AIF1_2_AIF2 = 0, AIF2_2_AIF2 = 1, AIF2_LOOPBACK = 2, AIF_COM_MAX }
 This enum describes the AIF types supported by ABT. More...
enum  AIF2_PackingMode
 This enum describes the AIF2 pack mode Interleaving usage for CPRI.
enum  AIF2_LteTddUlDlCfg
 This enum describes the LTE TDD UL-DL configuration. 00b = DL, 11b=UL, 01b=S Words are right justified with SF0 in LSB. SF 0 1 2 3 4 5 6 7 8 9 0 D S U U U D S U U U , 11 11 11 01 00 11 11 11 01 00, 0xFD3F4 1 D S U U D D S U U D , 00 11 11 01 00 00 11 11 01 00, 0x3D0F4 2 D S U D D D S U D D , 00 00 11 01 00 00 00 11 01 00, 0x0D034 3 D S U U U D D D D D , 00 00 00 00 00 11 11 11 01 00, 0x003F4 4 D S U U D D D D D D , 00 00 00 00 00 00 11 11 01 00, 0x000F4 5 D S U D D D D D D D , 00 00 00 00 00 00 00 11 01 00, 0x00034 6 D S U U U D S U U D , 00 11 11 01 00 11 11 11 01 00, 0x3D3F4 0xF3FCF.
enum  AIF2_LteTddSsfNcpCfg
 This enum describes the LTE TDD Special SF configuration for normal cyclic prefix. UL symbol = 11b, Dl symbol = 00b, GP symbol = 01 Words are right justified with DwPTS in LSB. SSF DwPTS GP UlPTS 0 3 10 1 , 11 01 01 01 01 01 01 01 01 01 01 00 00 00, 0xD555540 1 9 4 1 , 11 01 01 01 01 00 00 00 00 00 00 00 00 00, 0xD540000 2 10 3 1 , 11 01 01 01 00 00 00 00 00 00 00 00 00 00, 0xD500000 3 11 2 1 , 11 01 01 00 00 00 00 00 00 00 00 00 00 00, 0xD400000 4 12 1 1 , 11 01 00 00 00 00 00 00 00 00 00 00 00 00, 0xD000000 5 3 9 2 , 11 11 01 01 01 01 01 01 01 01 01 00 00 00, 0xF555540 6 9 3 2 , 11 11 01 01 01 00 00 00 00 00 00 00 00 00, 0xF540000 7 10 2 2 , 11 11 01 01 00 00 00 00 00 00 00 00 00 00, 0xF500000 8 11 1 2 , 11 11 01 00 00 00 00 00 00 00 00 00 00 00, 0xF400000.
enum  AIF2_LinkMode
 This enum describes the AIF2 link mode for dual mode usage.
enum  AIF_LteCpType
 This enum describes the Cyclic Prefix type for LTE.

Functions

void AIF_calcParameters (AIF_ConfigHandle hAif)
Uint32 AIF_calcAifTimingForTxNode (AIF_ConfigHandle hAif, CSL_Aif2LinkIndex linkIndex)
void AIF_enableException (AIF_ConfigHandle hAif)
void AIF_getException (AIF_ConfigHandle hAif)
void AIF_resetException (AIF_ConfigHandle hAif)
void AIF_printException (AIF_ConfigHandle hAif)
void AIF_printStatus (AIF_ConfigHandle hAif)
void AIF_captureException (AIF_ConfigHandle hAif, AIF_EeCountObj *snapPtr)
void AIF_enableDataTrace (AIF_ConfigHandle hAif, AIF_DataTraceHandle hDataTrace)
void AIF_disableDataTrace (AIF_ConfigHandle hAif)
void AIF_initFsync ()
void AIF_fsyncEvent2_7Count (Uint32 interruptFlag)
void AIF_dioEngineIsr (AIF_ConfigHandle hAif)
void AIF_hwContextSaveInit (AIF_HwContextSaveInfo *hSaveInfo)
void AIF_hwContextSave ()
void AIF_hwContextRestore (Uint32 currentBfn, Uint32 aif2_rsiso)
void AIF_initDio (AIF_ConfigHandle hAif)
Int32 AIF_initPktDma (AIF_ConfigHandle hAif)
void AIF_initHw (AIF_ConfigHandle hAif)
void AIF_startHw (AIF_ConfigHandle hAif)
void AIF_configureAtEvent (CSL_Aif2AtEvent *hAtEvent)
void AIF_enableAtEvent (CSL_Aif2AtEventIndex event)
void AIF_disableAtEvent (CSL_Aif2AtEventIndex event)
void AIF_setRadTimerTc (Uint32 clockNum, Uint8 symbolNum, Uint32 frameLsbNum, Uint8 lutIndexNum, Uint32 *radClockCountTc)
void AIF_setPhyTimerInit (Uint32 ClockNum, Uint32 FrameLsbNum, Uint32 FrameMsbNum)
void AIF_setDlRadTimerInit (Uint32 SymbolNum, Uint32 ClockNum, Uint32 FrameLsbNum, Uint32 FrameMsbNum, Bool FcbMinusOne)
void AIF_setUlRadTimerInit (Uint32 SymbolNum, Uint32 ClockNum, Uint32 FrameLsbNum, Uint32 FrameMsbNum, Bool FcbMinusOne)
void AIF_setRmLinkSetupParams (Int32 link, CSL_Aif2RmFifoThold RmFifoThold, Bool bEnableLcvControl, Uint16 losDetThreshold, Uint16 SyncThreshold, Uint16 FrameSyncThreshold, Uint16 UnsyncThreshold, Uint16 FrameUnsyncThreshold)
void AIF_setPeFrameTC (Int32 index, CSL_Aif2FrameCounter *cfg)
void AIF_setPeFrameMsgTc (Int32 indx, Uint16 val)
Uint32 AIF2_getVersion ()
const char * AIF2_getVersionStr ()
void AIF_resetFsync (AIF_ConfigHandle hAif)
void AIF_resetAif (AIF_ConfigHandle hAif)
void AIF_disablePeCh (AIF_ConfigHandle hAif, Uint32 peChanNum)
void AIF_disablePdCh (AIF_ConfigHandle hAif, Uint32 pdChanNum)
void AIF_enablePeCh (AIF_ConfigHandle hAif, Uint32 peChanNum)
void AIF_enablePdCh (AIF_ConfigHandle hAif, Uint32 pdChanNum)

Variables

Uint32 aifFsyncInitDone
 This flag indicates whether the event synchronization variables have been initialized.
Uint32 aifInitDone
 This flag indicates whether the Antenna Interface has been initialized.
CSL_Aif2Regs * aifRegs
 This structure points to the antenna interface registers and is used to access them within the ABTLib.
volatile Int32 aifFsyncEventCount [30]
 This array counts AIF2 AT events and is updated from AIF2 AT event cpu interrupts. aifFsyncEventCount[1]: 10ms tick - AT event 7 aifFsyncEventCount[2-7]: debug sync events for ABT ingress EDMA events - AT event 0 to 5.

Detailed Description

The AIF module is dedicated to the definition of generic elements for the C66x KeyStone AIF2 module and dedicated to the H/W initialization of the AIF2 module given the AIF2 object configuration parameters from the application user.


Define Documentation

#define AIF2_0_RX_DATA   0x108E0000

AIF2 DATA address for ABT usage 4k/link

#define AIF2_BASE_TX_QUE_NUM   512

missing parameters from the AIF2 CSL

LTE CPRI SYMBOL byte clock size for Extended CP

LTE OBSAI SYMBOL byte clock size for Extended CP

LTE CPRI first SYMBOL byte clock size for Nomal CP

LTE OBSAI first SYMBOL byte clock size for Nomal CP

LTE CPRI other SYMBOL byte clock size for Nomal CP

LTE OBSAI other SYMBOL byte clock size for Nomal CP

#define AIF2_CLOCK_COUNT_TC_WCDMA_FDD   204799

3GPP clock count TC for OBSAI (2x, 4x, 8x)

#define AIF2_CPRI_CLOCK_COUNT_TC_PHY_TIMER   2457599

Max number of CPRI control word sub-streams

Max number of AxC per link CPRI 15

Max number of AxC per link CPRI 16

#define AIF2_CRC8_POLY   0xF

Default CRC8 polynomial

#define AIF2_CRC8_SEED   0xF

Default CRC8 seed

#define AIF2_DB_PE_DELAY_CPRI   0

Delay between DB and PE for CPRI

#define AIF2_DB_PE_DELAY_OBSAI   28

Delay between DB and PE for OBSAI

#define AIF2_FRAME_COUNT_TC_PHY_TIMER   4095
#define AIF2_FRAME_COUNT_TC_WCDMA_FDD   4095

Frame terminal count for Wcdma Fdd

#define AIF2_LTE_SYMBOL_NUM   7

LTE parameters

#define AIF2_MAX_NUM_DIO_ENGINE   3

Max number of Dio engine

#define AIF2_NUM_WORDS_PER_QWORD   4

Max number of AxC for 2X link rate

Max number of AxC for 4X link rate

Max number of AxC for 8X link rate

#define AIF2_OBSAI_TYPE_CONTROL   0x00

OBSAI header type for control

#define AIF2_OBSAI_TYPE_GENERIC   0x0F

OBSAI header type for generic packet

#define AIF2_OBSAI_TYPE_LTE   0x0E

OBSAI header type for Lte

#define AIF2_OBSAI_TYPE_WCDMA_FDD   0x02

OBSAI header type for Wcdma Fdd

Slot terminal count for Wcdma Fdd

#define AIF_CFG_BASE   (0x01f00000u)

AIF loopback enable

#define AIF_CPRI_PE_TO_TM_DELAY   28

AIF timing delay between protocol encoder and tx mac for CPRI

#define AIF_CPRI_RM_TO_TM_DELAY   60

AIF redirection delay between Rx and Tx mac for CPRI

AIF FSYNC

#define AIF_INPSFIFO_OFFSET   0x04000000

AIF RAM inbound PS FIFO offset

#define AIF_LINK_BLOCK_SIZE   0x00400000

AIF RAM block size for one link of inbound or outband data

#define AIF_LINK_DATA_TYPE_DL   CSL_AIF2_LINK_DATA_TYPE_NORMAL

ABT inbound outbound data type depending on AIF version

#define AIF_LINK_PHY_BLOCK_SIZE   2048

AIF RAM block size for inbound/outbound CS RAM

#define AIF_MAX_NUM_AXC   128

Maximum number of AIF2 antenna containers

#define AIF_MAX_NUM_LINKS   (CSL_AIF2_LINK_5 + 1)

Maximum number of AIF2 links

#define AIF_MAX_NUM_RADT   1

Maximum number of AIF2 radio timers

#define AIF_MAX_NUM_STREAMS   16

AIF maximum number of streams

#define AIF_OBSAI_PE_TO_TM_DELAY   22

AIF timing delay between protocol encoder and tx mac for OBSAI

#define AIF_OBSAI_RM_TO_TM_DELAY   38

AIF redirection delay between Rx and Tx mac for OBSAI

#define AIF_OUTDATA_OFFSET   0x02000000

AIF RAM outbound data offset

#define AIF_OUTPSFIFO_OFFSET   0x05000000

AIF RAM outbound PS FIFO offset

#define AIF_PS_IN_DATA_BLOCK_SIZE   0x400000

AIF RAM inbound PS data block

#define AIF_PS_IN_FIFO_DEPTH   CSL_AIF2_INBOUND_PS_FIFO_EVENT_DEPTH_1

AIF Packet-switched inbound FIFO depth

#define AIF_PS_IN_FIFO_SIZE   8

AIF Packet-switched inbound FIFO size, number of messages the buffer can hold

#define AIF_PS_OUT_DATA_BLOCK_SIZE   0x80000

AIF RAM outbound PS data block

#define AIF_SERDES_PROCESSING_DELAY   10

AIF SerDes processing delay (Tx mac, line and Rx mac)

#define AIF_TM_FIFO_FILL_MIN   4

AIF minimum number of bytes that must be written to the tx mac fifo before it starts

#define AIF_UMTS_CHIP_SPEED_3840K   3840

AIF UMTS chip speed in KHz

AIF UMTS sample speed in KHz

#define AIF_VBUS_CPU_RATIO   3

AIF VBUS versus CPU speed ratio


Enumeration Type Documentation

This enum describes the AIF types supported by ABT.

Enumerator:
AIF1_2_AIF2 

AIF1 to AIF2 communication

AIF2_2_AIF2 

AIF2 to AIF2 communication

AIF2_LOOPBACK 

AIF2 to AIF2 communication

AIF_COM_MAX 

number of AIF communication type

enum AIF_Mode

This enum describes the AIF mode supported by the AIF2 Lib.

Enumerator:
AIF_WCDMA_MODE 

WCDMA mode

AIF_LTE_FDD_MODE 

LTE FDD mode

AIF_LTE_WCDMA_MODE 

LTE WCDMA DUAL mode

AIF_GENERICPACKET_MODE 

Generic packet mode

AIF_LTE_TDD_MODE 

LTE TDD mode

This enum describes the AIF2 Sampling rate per link.

Enumerator:
AIF_SRATE_1P92MHZ 

Sampling rate 1.92MHz

AIF_SRATE_3P84MHZ 

Sampling rate 3.84MHz

AIF_SRATE_7P68MHZ 

Sampling rate 7.68MHz

AIF_SRATE_15P36MHZ 

Sampling rate 15.36MHz

AIF_SRATE_23P04MHZ 

Sampling rate 23.04MHz

AIF_SRATE_30P72MHZ 

Sampling rate 30.72MHz


Function Documentation

Uint32 AIF2_getVersion ( )


AIF2_getVersion

Description
The function is used to get the version information of the AIF2 LLD.

Arguments

     

Return Value Uint32 (version ID)

Pre Condition
None.

Post Condition

Modifies

Example

     
const char* AIF2_getVersionStr ( )


AIF2_getVersionStr

Description
The function is used to get the version string for the AIF2 LLD

Arguments

     

Return Value pointer to version string

Pre Condition
None.

Post Condition

Modifies

Example

     
Uint32 AIF_calcAifTimingForTxNode ( AIF_ConfigHandle  hAif,
CSL_Aif2LinkIndex  linkIndex 
)


AIF_calcAifTimingForTxNode

Description
This function calculates the AIF timing parameters (pe2Offset, deltaOffset) for a given link based on the nodeTx and txWait parameters.

Arguments

        hAif   		Pointer to a AIF2_ConfigObj instance.
        linkIndex	Link number.
     

Return Value None

Pre Condition

Post Condition
None.

Modifies
H/W state

Example

        AIF2_ConfigObj aifObj;
        CSL_Aif2LinkIndex   linkIndex;
            AIF_calcAifTimingForTxNode(&aifObj, linkIndex);
     


AIF_calcParameters

Description
This function calculates some other AIF Parameters according to the pre-set parameters in AIF2_ConfigObj. This function should called before AIF_initHw().

Arguments

        hAif   Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
None.

Modifies
H/W state

Example

        AIF2_ConfigObj aifObj;
            AIF_calcParameters(&aifObj);
     
void AIF_captureException ( AIF_ConfigHandle  hAif,
AIF_EeCountObj snapPtr 
)


AIF_captureException

Description
This function captures the exception counts into a supplied destination storage

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
	   capturePtr  Pointer to the AIF_EeCountObj structure to capture the exception counters
     

Return Value None

Pre Condition
The AIF links enabled by the user application are configured.

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
			AIF_EeCountObj      capture;
            AIF_captureException(hAif, &capture);
     
void AIF_configureAtEvent ( CSL_Aif2AtEvent *  hAtEvent)


AIF_configureAtEvent

Description
This function is used prior to AIF_startHw to configure application specific AT events.

Arguments

       hAtEvent        Pointer to a CSL_Aif2AtEvent instance.
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            CSL_Aif2AtEvent* hAtEvent
            AIF_configureAtEvent(hAtEvent);
     


AIF2_dioEngineIsr

Description
This function counts occurrences of AT event 6 for each of the links. User application can use aif2DioIntCount[] to check on enabled and CPU-visible AT events.

Arguments

        hAif   Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
None

Modifies
aif2DioIntCount array

Example

        //Caution: if BIOS interrupt dispatcher is used, you must remove the "interrupt" keyword before the ISR
		// Used by ABT mechanism, for instance, to implement ping-pong on the TX direction
		interrupt void
		Aif2_RadT_Sevt6_ISR()
		{
		   AIF2_dioEngineIsr(hConfigAif);
		}
     
void AIF_disableAtEvent ( CSL_Aif2AtEventIndex  event)


AIF_disableAtEvent

Description
This function is used to disable AT event.

Arguments

       event        event of interest in CSL_Aif2AtEventIndex.
     

Return Value None

Pre Condition
Call to AIF_initHw().

Post Condition

Modifies
AIF2 configuration structure

Example

            CSL_Aif2AtEventIndex event
            AIF_disbleAtEvent(event);
     


AIF_disableDataTrace

Description
This function disables AIF2 data trace for OBSAI debug mode.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
            AIF_disableDataTrace(hAif, hDataTrace);
     
void AIF_disablePdCh ( AIF_ConfigHandle  hAif,
Uint32  pdChanNum 
)


AIF_disablePdCh

Description
This function is used to disable a given PD channel.

Arguments

        hAif   		Pointer to a AIF2_ConfigObj instance.
        peChanNum	Channel index number
     

Return Value None

Pre Condition

Post Condition
Reception of this Antenna Container is stopped.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            Uint32              pdChanNum;
            AIF_disablePdCh(hAif, pdChanNum);
     
void AIF_disablePeCh ( AIF_ConfigHandle  hAif,
Uint32  peChanNum 
)


AIF_disablePeCh

Description
This function is used to disable a given PE channel.

Arguments

        hAif   		Pointer to a AIF2_ConfigObj instance.
        peChanNum	Channel index number
     

Return Value None

Pre Condition

Post Condition
Transmission of this Antenna Container is stopped.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            Uint32              peChanNum;
            AIF_disablePeCh(hAif, peChanNum);
     
void AIF_enableAtEvent ( CSL_Aif2AtEventIndex  event)


AIF_enableAtEvent

Description
This function is used to enable AT event.

Arguments

       event        event of interest in CSL_Aif2AtEventIndex.
     

Return Value None

Pre Condition
Call to AIF_initHw().

Post Condition

Modifies
AIF2 configuration structure

Example

            CSL_Aif2AtEventIndex event
            AIF_enableAtEvent(event);
     
void AIF_enableDataTrace ( AIF_ConfigHandle  hAif,
AIF_DataTraceHandle  hDataTrace 
)


AIF_enableDataTrace

Description
This function enables AIF2 data trace for OBSAI debug mode.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
       hDataTrace  Pointer to a AIF2_DataTracObj instance.
     

Return Value None

Pre Condition
The AIF is started and Obsai antenna traffic is up.

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
            AIF_DataTraceHandle hDataTrace;
            AIF_enableDataTrace(hAif, hDataTrace);
     


AIF_enableException

Description
This function configures AIF2 HW registers to enable errors at alarms at AIF2 level.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
The AIF links enabled by the user application are configured.

Post Condition

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_enableException(hAif);
     
void AIF_enablePdCh ( AIF_ConfigHandle  hAif,
Uint32  pdChanNum 
)


AIF_enablePdCh

Description
This function is used to enable a given PD channel.

Arguments

        hAif   		Pointer to a AIF2_ConfigObj instance.
        pdChanNum	Channel index number
     

Return Value None

Pre Condition

Post Condition
Transmission of this Antenna Container is stopped.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            Uint32              pdChanNum;
            AIF_enablePdCh(hAif, pdChanNum);
     
void AIF_enablePeCh ( AIF_ConfigHandle  hAif,
Uint32  peChanNum 
)


AIF_enablePeCh

Description
This function is used to enable a given PE channel.

Arguments

        hAif   		Pointer to a AIF2_ConfigObj instance.
        peChanNum	Channel index number
     

Return Value None

Pre Condition

Post Condition
Transmission of this Antenna Container is stopped.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            Uint32              peChanNum;
            AIF_enablePeCh(hAif, peChanNum);
     
void AIF_fsyncEvent2_7Count ( Uint32  interruptFlag)


AIF_fsync1Event7Count

Description
This function counts occurrences of AT event 7. This is the 10ms tick. User application can then use aifFsyncEventCount[1] to pace its actions toward AIF2. Arguments

        None
     

Return Value None

Pre Condition

Post Condition
None

Modifies
aifFsyncEventCount array

Example 1

        //Caution: if BIOS interrupt dispatcher is used, you must remove the "interrupt" keyword before the ISR
		interrupt void
		Aif2_RadT_Sevt7_FSEVT1_ISR()
		{
			AIF2_fsync1Event7Count();
			fsevt1_userIsr();
		}
     

Example 2

        // for instance, wait 10ms for AIF RAM to be flushed
        while (aifFsyncEventCount[1] <= 2) {
              asm("    IDLE");
        }     
 * 
 */
#ifndef __AIF_FSYNC_C
extern
#endif
void 
AIF_fsync1Event7Count(
);

/**
 *   @n@b AIF_fsyncEvent2_7Count
 *
 *   @b Description
 *   @n This function counts occurrences of AT event 0 to 5.
 *      The ABT (one of the AIF2 lib mode) mechanism uses those events to trigger incoming EDMA channels
 *      This function, in that case, is only used for debug purpose to check 16-chip tick for each of the links
 *      User application can then use aifFsyncEventCount[2] to aifFsyncEventCount[7].
 *   @b Arguments
 *   @verbatim
        interruptFlags   Contains a copy of MEVTFLAG[combinedEvent]
     

Return Value None

Pre Condition

Post Condition
None

Modifies
aifFsyncEventCount array

Example

        //Caution: if BIOS interrupt dispatcher is used, you must remove the "interrupt" keyword before the ISR
		interrupt void
		Aif2_RadT_Sevt0_5_FSEVT2_7_ISR()
		{
			volatile Uint32 intFlag= IntcRegs->MEVTFLAG[3];

			while(intFlag)
			{
				IntcRegs->EVTCLR[3]= intFlag;
				AIF_fsyncEvent2_7Count(intFlag);
				//make sure all pending events are handled before return
				intFlag= IntcRegs->MEVTFLAG[3];
			}
		}
     


AIF_getException

Description
This function checks for AIF2 HW errors at alarms at AIF2 level.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
The AIF links enabled by the user application are configured.

Post Condition

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_getException(hAif);
     
void AIF_hwContextRestore ( Uint32  currentBfn,
Uint32  aif2_rsiso 
)


AIF_hwContextRestore

Description
This function causes the entire state of Aif2 to be restored following. hibernation. In non-reset isolation mode, AIF physical and radio timers (radt, ulradt) init frame values are being set based on currentBfn function parameter. This function supports the AIF2 reset isolation and non-reset isolation modes.

Arguments

		currentBfn	Init value for radio timers (radt, ulradt) init frame values
		aif2_rsiso  Specify whether AIF2 is in reset isolation mode
     

Return Value None

Pre Condition
AIF_hwContextSaveInit() must have been called prior to entering hibernation.

Post Condition
None.

Modifies
H/W restarted

Example

        AIF_HwContextSaveInfo saveInfo;
            AIF_hwContextSaveInit(&saveInfo);
            AIF_hwContextSave();
            ... hibernate
            ... wake up
            ... get current Bfn
            AIF_hwContextRestore(currentBfn);
     


AIF_hwContextSave

Description
This function causes AIF to be set to bypass prior to hibernation. AIF2 Bypass just means disabling DIO for WCDMA and disabling PktDMA channel for LTE to cut real incoming frame data and re-transmit it to the next DSP in the chain

Arguments

     

Return Value None

Pre Condition
AIF_hwContextSaveInit() must have been called prior to this function

Post Condition
None.

Modifies
H/W set to bypass

Example

        AIF_HwContextSaveInfo saveInfo;
            AIF_hwContextSaveInit(&saveInfo);
            AIF_hwContextSave();
     


AIF_hwContextSaveInit

Description
This function initializes the pointer to CSL structure required to save AIF configuration. Must be called prior to any prior to AIF_hwContextSave().

Arguments

        hSaveInfo   Pointer to a AIF_HibernateSaveInfo instance.
     

Return Value None

Pre Condition

Post Condition
None.

Modifies
H/W context save parameters

Example

        AIF_HwContextSaveInfo saveInfo;
            AIF_hwContextSaveInit(&saveInfo);
     
void AIF_initDio ( AIF_ConfigHandle  hAif)


AIF_initDio

Description
This function sets up the dioConfig[] structure given the user parameters.

Arguments

		hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
Call to AIF_calcParameters()

Post Condition
AIF2_ConfigObj instance has valid parameters for DIO engines

Modifies

Example

            AIF_initDio(hAif);
     
void AIF_initFsync ( )


AIF_initFsync

Description
This function initializes the Fsync event variables used by AIF2 driver software. It is called by AIF_startHw().

Arguments

 *   None
     

Return Value None

Pre Condition

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
            AIF_initFsync(hAif);
     
void AIF_initHw ( AIF_ConfigHandle  hAif)


AIF_initHw

Description
This function sets up the CSL structures for the 6 AIF links.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
The AIF links enabled by the user application are configured.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_initHw(hAif);
     


AIF_initPktDma

Description
This function sets up the pktDmaConfig structure given the user parameters. Tx and Rx Hw (free) queues are initialized, as well as AIF2 PKTDMA channels. It should be noted that for LTE, there is an option to not use this function and configure queues, descriptors, pktdma channels and rx flows outside of AIF2LLD.

Arguments

		hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
Call to AIF_calcParameters()

Post Condition
AIF2_ConfigObj instance has valid parameters for PFTDMA channels

Modifies

Example

            AIF_initPktDma(hAif);
     

eof Transmit config


AIF_printException

Description
This function prints out AIF2 HW errors at alarms at AIF2 level.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
The AIF links enabled by the user application are configured.

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
            AIF_printException(hAif);
     


AIF_printStatus

Description
This function calls AIF_getException and AIF_printException.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
The AIF links enabled by the user application are configured.

Post Condition

Modifies

Example

            AIF_ConfigHandle    hAif;
            AIF_printStatus(hAif);
     


AIF_resetAif

Description
This function is used to reset AIF to its default state.

Arguments

        hAif   Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
The AIF H/W is now in reset state.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_resetAif(hAif);
     


AIF_resetException

Description
This function resets AIF2LLD exception counters.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition
None.

Post Condition

Modifies
SW counters

Example

            AIF_ConfigHandle    hAif;
            AIF_resetException(hAif);
     


AIF_resetFsync

Description
This function resets the AIF2 AT event module

Arguments

        hAif   Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
The AIF2 H/W timers are halted and disabled.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_resetFsync(hAif);
     
void AIF_setDlRadTimerInit ( Uint32  SymbolNum,
Uint32  ClockNum,
Uint32  FrameLsbNum,
Uint32  FrameMsbNum,
Bool  FcbMinusOne 
)


AIF_setDlRadTimerInit

Description
This function is used to configure the DlRadTimerInit in AIF2LLD configuration structure

Arguments

		SymbolNum		AT event count symbol num
		ClockNum		AT event count clock num
		FrameLsbNum		AT event count frame lsb num
		FrameMsbNum		AT event count frame msb num
		FcbMinusOne		FCB - 1 flag
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setDlRadTimerInit(0, ClockNum, 0, 0, 0);
     
void AIF_setPeFrameMsgTc ( Int32  indx,
Uint16  val 
)


AIF_setPeFrameMsgTc

Description
This function is used to configure the PE Frame message terminal count in AIF2LLD configuration structure.

Arguments

		indx	AxC index
		val		PE Frame message terminal count
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setPeFrameMsgTc(0, AIF2_LTE20_FFT_SIZE + AIF2_LTE20_CYPRENORMAL1_SIZE);
     
void AIF_setPeFrameTC ( Int32  index,
CSL_Aif2FrameCounter *  cfg 
)


AIF_setPeFrameTC

Description
This function is used to configure PE frame and symbol terminal counting value to calculate sop and eop of packet for a given group in AIF2LLD configuration structure

Arguments

		index		index to one of the six sets of PE count value in order to  support up to 6 simultaneous LTE configurations
		cfg			PE frame and symbol terminal counting value to calculate sop and eop of packet
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

		CSL_Aif2FrameCounter cfg;
		
		cfg.FrameIndexSc = 0;
		cfg.FrameIndexTc = 13; 		// subframe processing
		cfg.FrameSymbolTc = 13;		// subframe processing
		AIF_setPeFrameTC(0,&cfg);
     
void AIF_setPhyTimerInit ( Uint32  ClockNum,
Uint32  FrameLsbNum,
Uint32  FrameMsbNum 
)


AIF_setPhyTimerInit

Description
This function is used to configure the PhyTimerInit in AIF2LLD configuration structure

Arguments

		clockNum		AT event count clock num
		frameLsbNum		AT event count frame lsb num
		frameMsbNum		AT event count frame msb num
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setPhyTimerInit(ClockNum, 0, 0);
     
void AIF_setRadTimerTc ( Uint32  clockNum,
Uint8  symbolNum,
Uint32  frameLsbNum,
Uint8  lutIndexNum,
Uint32 *  radClockCountTc 
)


AIF_setRadTimerTc

Description
This function is used to configure the RadTimerTc in AIF2LLD configuration structure

Arguments

		clockNum		AT event count clock num
		symbolNum		AT event count symbol num
		frameLsbNum		AT event count frame lsb num
		lutIndexNum		AT event count lut index num
		radClockCountTc	pointer to an array of clock terminal counts of size lutIndexNum
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setRadTimerTc(AIF2_CPRI_CLOCK_COUNT_TC_PHY_TIMER,139,AIF2_FRAME_COUNT_TC_WCDMA_FDD,AIF2_LTE_SYMBOL_NUM - 1);
     
void AIF_setRmLinkSetupParams ( Int32  link,
CSL_Aif2RmFifoThold  RmFifoThold,
Bool  bEnableLcvControl,
Uint16  losDetThreshold,
Uint16  SyncThreshold,
Uint16  FrameSyncThreshold,
Uint16  UnsyncThreshold,
Uint16  FrameUnsyncThreshold 
)


AIF_setRmLinkSetupParams

Description
This function is used to configure the RmLinkSetup threshold parameters for a given link number in AIF2LLD configuration structure

Arguments

		link					link to configure
		RmFifoThold				Rm fifo threshold word size for reading received data
		bEnableLcvControl		enable the Line Code Violation counter
		losDetThreshold			8b10b los detect threshold values in number of Line Code Violations
		SyncThreshold			Threshold value for consecutive valid blocks of bytes which result in state ST1
		FrameSyncThreshold		Threshold value for consecutive valid message groups which result in state ST3
		UnsyncThreshold			Threshold value for consecutive invalid blocks of bytes which result in state ST0
		FrameUnsyncThreshold	Threshold value for consecutive invalid message groups which result in state ST1
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setRmLinkSetupParams(CSL_AIF2_RM_FIFO_THOLD_16DUAL,FALSE,16,75,75,5,5);
     
Parameters:
linkwhich link to configure
RmFifoTholdsetup Rm fifo threshold word size for reading received data
bEnableLcvControlWriting a 1 to the bit will enable the Line Code Violation counter. THis 16 bit counter will saturate when it reaches a value of 0xffff. Writing a 0 to this bit will clear and disable the counter. The current counter value is available as status, lcv_cntr_value
losDetThresholdSets 8b10b los detect threshold values in number of Line Code Violations received during a master frame, OBSAI, or during a Hyperframe, CPRI. Writing to this location will automatically clear the num_los counter and num_los_det status bit. Range 0 to 65,535
SyncThresholdThreshold value for consecutive valid blocks of bytes which result in state ST1. Range 0 to 65,535
FrameSyncThresholdThreshold value for consecutive valid message groups which result in state ST3. Range 0 to 65,535
UnsyncThresholdThreshold value for consecutive invalid blocks of bytes which result in state ST0. Range 0 to 65,535
FrameUnsyncThresholdThreshold value for consecutive invalid message groups which result in state ST1. Range 0 to 65,535
void AIF_setUlRadTimerInit ( Uint32  SymbolNum,
Uint32  ClockNum,
Uint32  FrameLsbNum,
Uint32  FrameMsbNum,
Bool  FcbMinusOne 
)


AIF_setUlRadTimerInit

Description
This function is used to configure the UlRadTimerInit in AIF2LLD configuration structure

Arguments

		SymbolNum		AT event count symbol num
		ClockNum		AT event count clock num
		FrameLsbNum		AT event count frame lsb num
		FrameMsbNum		AT event count frame msb num
		FcbMinusOne		FCB - 1 flag
     

Return Value None

Pre Condition
Call to AIF_initHw(). AIF2 not started yet.

Post Condition

Modifies
AIF2 configuration structure

Example

            AIF_setUlRadTimerInit(0, ClockNum, 0, 0, 0);
     
void AIF_startHw ( AIF_ConfigHandle  hAif)


AIF_startHw

Description
This function configures AIF2 HW registers for the 6 AIF link given user AIF2 configuration. HW is then started, waiting for the selected synchronization.

Arguments

       hAif        Pointer to a AIF2_ConfigObj instance.
     

Return Value None

Pre Condition

Post Condition
The AIF links enabled by the user application are configured.

Modifies
H/W state

Example

            AIF_ConfigHandle    hAif;
            AIF_startHw(hAif);
     

Variable Documentation

volatile Int32 aifFsyncEventCount[30]

This array counts AIF2 AT events and is updated from AIF2 AT event cpu interrupts. aifFsyncEventCount[1]: 10ms tick - AT event 7 aifFsyncEventCount[2-7]: debug sync events for ABT ingress EDMA events - AT event 0 to 5.

FSYNC event and error counts

This flag indicates whether the event synchronization variables have been initialized.

Initialization flag

CSL_Aif2Regs* aifRegs

This structure points to the antenna interface registers and is used to access them within the ABTLib.

AIF registers


Copyright 2014, Texas Instruments Incorporated