AM64x MCU+ SDK
10.01.00
The Fast Serial Interface (FSI) driver provides API to program the FSI module. FSI is a serial communication peripheral capable of reliable and robust high-speed communications. FSI is used to transfer/receive data frame with several available configurations e.g frame size, bandwidth etc, signaling events completion via interrupts or status registers.
Features Supported
Supports programmable packet data length of 1-to-16 words where each word consists of 16-bits
Supports programmable frame tagging (0000-to-1111) for message filtering
Supports programmable data-lines( 1-or-2) for communication
Supports Double Data Rate (DDR) communication
Supports programmable interrupts via 2 interrupt lines per FSI core
Features NOT Supported
Multi-Peripheral configuration
clkstop_req/ack functionality. Software must ensure that the FSI IP's on both host and remote device are idle before triggering clkstop_req.
SysConfig Features
Note It is strongly recommend to use SysConfig where it is available instead of using direct SW API calls. This will help simplify the SW application and also catch common mistakes early in the development cycle.
Selection of instances present in the device
Configuring pinmux based on selected instance and pin configuration
Important Usage Guidelines
Note: FSI-RX and FSI-TX are completely independent and separate module. For communication, both needs to be configured separately.
Example Usage
Include the below file to access the APIs
FSI tx config
FSI rx config
FSI configuration to enable interrupt
static void Fsi_appTxCallback(void *args)
{
uint32_t txBaseAddr = (uint32_t) args;
return ;
}
static void Fsi_appRxCallback(void *args)
{
uint32_t rxBaseAddr = (uint32_t) args;
return ;
}
static int32_t Fsi_appIntrInit(uint32_t txBaseAddr, uint32_t rxBaseAddr)
{
int32_t status;
uint32_t txIntrNum, rxIntrNum;
txIntrNum = CONFIG_FSI_TX0_INTR1;
txHwiPrms.
args = (
void *) txBaseAddr;
rxIntrNum = CONFIG_FSI_RX0_INTR1;
rxHwiPrms.
args = (
void *) rxBaseAddr;
return status;
}
static void Fsi_appIntrDeInit(uint32_t txBaseAddr, uint32_t rxBaseAddr)
{
return ;
}
API
APIs for FSI
int32_t FSI_setRxSoftwareFrameSize(uint32_t base, uint16_t nWords)
This API sets the RX frame size if frame type is user/software defined frame.
int32_t FSI_setRxBufferPtr(uint32_t base, uint16_t bufPtrOff)
This API sets the value for receive buffer pointer at desired location.
int32_t FSI_enableRxInterrupt(uint32_t base, FSI_InterruptNum intNum, uint16_t intFlags)
This API enables user to generate interrupt on occurrence of RX events.
void HwiP_destruct(HwiP_Object *obj)
Cleanup, delete, destruct a Hwi object.
Parameters passed during HwiP_construct.
Definition: HwiP.h:74
#define FSI_INT1
Definition: fsi/v0/fsi.h:138
int32_t FSI_disableRxInterrupt(uint32_t base, FSI_InterruptNum intNum, uint16_t intFlags)
This API enables user to disable interrupt generation on RX events.
int32_t FSI_performRxInitialization(uint32_t base)
This API initializes FSI RX module.
int32_t FSI_clearRxEvents(uint32_t base, uint16_t evtFlags)
This API enables user to clear RX event/error flags.
int32_t HwiP_construct(HwiP_Object *obj, HwiP_Params *params)
Create a Hwi object.
int32_t FSI_clearTxEvents(uint32_t base, uint16_t evtFlags)
This API enables user to clear TX error flags.
int32_t FSI_setTxSoftwareFrameSize(uint32_t base, uint16_t nWords)
This API sets the frame size if frame type is user/software defined frame.
int32_t FSI_setTxFrameType(uint32_t base, FSI_FrameType frameType)
This API sets frame type for transmission.
void HwiP_Params_init(HwiP_Params *params)
Set default values to HwiP_Params.
#define FSI_TX_EVTMASK
Mask of all TX Event types.
Definition: fsi_tx.h:110
#define FSI_RX_EVT_DATA_FRAME
Definition: fsi_rx.h:119
#define FSI_RX_EVTMASK
Mask of all RX Events, ORing all event defines.
Definition: fsi_rx.h:125
#define FSI_FRAME_TYPE_NWORD_DATA
Definition: fsi/v0/fsi.h:177
int32_t FSI_resetTxModule(uint32_t base, FSI_TxSubmoduleInReset submodule)
This API resets clock or ping timeout counter or entire TX module.
int32_t FSI_performTxInitialization(uint32_t base, uint16_t prescalar)
This API initializes FSI TX module.
void SemaphoreP_destruct(SemaphoreP_Object *obj)
Cleanup, delete, destruct a semaphore object.
int32_t FSI_disableTxInterrupt(uint32_t base, FSI_InterruptNum intNum, uint16_t intFlags)
This API enables user to disable generation interrupt on occurrence of FSI TX events.
#define SystemP_SUCCESS
Return status when the API execution was successful.
Definition: SystemP.h:56
#define FSI_TX_MAIN_CORE_RESET
Definition: fsi_tx.h:133
int32_t FSI_setTxFrameTag(uint32_t base, FSI_FrameTag frameTag)
This API sets frame tag for transmission.
int32_t FSI_resetRxModule(uint32_t base, FSI_RxSubmoduleInReset submodule)
This API resets frame watchdog, ping watchdog or entire RX module.
int32_t FSI_setTxUserDefinedData(uint32_t base, uint16_t userDefData)
This API sets user defined data for transmission It is an extra data field (8 bit) apart from regular...
HwiP_FxnCallback callback
Definition: HwiP.h:77
int32_t FSI_enableTxInterrupt(uint32_t base, FSI_InterruptNum intNum, uint16_t intFlags)
This API enables user to generate interrupt on occurrence of FSI_TxEventList events.
int32_t FSI_clearRxModuleReset(uint32_t base, FSI_RxSubmoduleInReset submodule)
This API clears resets on frame watchdog, ping watchdog or entire RX module.
void SemaphoreP_post(SemaphoreP_Object *obj)
Post a semaphore object or unlock a mutex.
void * args
Definition: HwiP.h:78
int32_t FSI_setTxDataWidth(uint32_t base, FSI_DataWidth dataWidth)
This API sets Data width for transmission.
int32_t SemaphoreP_constructBinary(SemaphoreP_Object *obj, uint32_t initValue)
Create a binary semaphore object.
#define FSI_RX_MAIN_CORE_RESET
Definition: fsi_rx.h:148
#define DebugP_assert(expression)
Function to call for assert check.
Definition: DebugP.h:177
uint32_t intNum
Definition: HwiP.h:76
int32_t FSI_clearTxModuleReset(uint32_t base, FSI_TxSubmoduleInReset submodule)
This API clears reset on clock or ping timeout counter or entire TX module.
#define FSI_TX_EVT_FRAME_DONE
Definition: fsi_tx.h:96
int32_t FSI_setRxDataWidth(uint32_t base, FSI_DataWidth dataWidth)
This API selects number of data lines used for receiving.