iLLD_TC27xC  1.0
Channel functions
Collaboration diagram for Channel functions:

Functions

IFX_INLINE boolean IfxPsi5_Psi5_startupChannel (IfxPsi5_Psi5_Channel *channel, IfxPsi5_Psi5_StartupOptions *options)
 start the channel with the selected options More...
 
IFX_EXTERN boolean IfxPsi5_Psi5_initChannel (IfxPsi5_Psi5_Channel *channel, IfxPsi5_Psi5_ChannelConfig *config)
 Initialize the channel with the supplied configuration. More...
 
IFX_EXTERN void IfxPsi5_Psi5_initChannelConfig (IfxPsi5_Psi5_ChannelConfig *config, IfxPsi5_Psi5 *psi5)
 Get the current channel configuration (e.g. sample settings) More...
 
IFX_EXTERN boolean IfxPsi5_Psi5_readChannelFrame (IfxPsi5_Psi5_Channel *channel, IfxPsi5_Psi5_Frame *frame)
 Gets the received psi5 frame for the channel. More...
 
IFX_EXTERN boolean IfxPsi5_Psi5_readChannelSerialMessage (IfxPsi5_Psi5_Channel *channel, IfxPsi5_Slot slot, IfxPsi5_Psi5_SerialMessage *message)
 Get the received serial message for the channel. More...
 
IFX_EXTERN boolean IfxPsi5_Psi5_sendChannelData (IfxPsi5_Psi5_Channel *channel, uint64 data)
 Transmit the data through the channel. More...
 

Detailed Description

Function Documentation

IFX_EXTERN boolean IfxPsi5_Psi5_initChannel ( IfxPsi5_Psi5_Channel channel,
IfxPsi5_Psi5_ChannelConfig config 
)

Initialize the channel with the supplied configuration.

Parameters
channelpointer to the PSI5 channel
configpointer to the PSI5 channel configuration
Returns
TRUE on success & FALSE if configuration not valid

A coding example can be found in IfxPsi5_Psi5_readChannelFrame

Definition at line 119 of file IfxPsi5_Psi5.c.

IFX_EXTERN void IfxPsi5_Psi5_initChannelConfig ( IfxPsi5_Psi5_ChannelConfig config,
IfxPsi5_Psi5 psi5 
)

Get the current channel configuration (e.g. sample settings)

Parameters
configpointer to the PSI5 channel configuration
psi5pointer to the PSI5 module
Returns
None

A coding example can be found in IfxPsi5_Psi5_readChannelFrame

Definition at line 269 of file IfxPsi5_Psi5.c.

IFX_EXTERN boolean IfxPsi5_Psi5_readChannelFrame ( IfxPsi5_Psi5_Channel channel,
IfxPsi5_Psi5_Frame frame 
)

Gets the received psi5 frame for the channel.

Parameters
channelpointer to the PSI5 channel
framepointer to the PSI5 frame buffer
Returns
TRUE if successful; FALSE if no frame available
// create module config
IfxPsi5_Psi5_Config psi5Config;
IfxPsi5_Psi5_initModuleConfig(&psi5Config, &MODULE_PSI5);
// initialize module
IfxPsi5_Psi5_initModule(&psi5, &psi5Config);
// create channel config
IfxPsi5_Psi5_ChannelConfig psi5ChannelConfig;
IfxPsi5_Psi5_initChannelConfig(&psi5ChannelConfig, &psi5);
psi5ChannelConfig.watchdogTimerLimit[0] = 0x32; // initial delay before slot 0 starts
psi5ChannelConfig.watchdogTimerLimit[1] = 0x90;
psi5ChannelConfig.watchdogTimerLimit[2] = 0x10;
psi5ChannelConfig.watchdogTimerLimit[3] = 0x10;
psi5ChannelConfig.watchdogTimerLimit[4] = 0x10;
psi5ChannelConfig.watchdogTimerLimit[5] = 0x10;
psi5ChannelConfig.watchdogTimerLimit[6] = 0x10;
psi5ChannelConfig.sendControl.payloadLength = 15;
psi5ChannelConfig.sendControl.bitStuffingEnabled = TRUE;
psi5ChannelConfig.sendControl.ssrPayloadLength = 0;
psi5ChannelConfig.sendControl.sorPayloadLength = 0;
psi5ChannelConfig.sendControl.crcGenerationEnabled = TRUE;
for(int slot=0; slot<6; ++slot) {
psi5ChannelConfig.receiveControl.payloadLength[slot] = 8;
if( slot == 0 )
psi5ChannelConfig.receiveControl.frameExpectation[slot] = IfxPsi5_FrameExpectation_Expected;
else
psi5ChannelConfig.receiveControl.frameExpectation[slot] = IfxPsi5_FrameExpectation_NotExpected;
}
// initialize channels
for(int chn=0; chn<IFXPSI5_NUM_CHANNELS; ++chn) {
psi5ChannelConfig.channelId = (IfxPsi5_ChannelId)chn;
IfxPsi5_Psi5_initChannel(&psi5Channel[chn], &psi5ChannelConfig);
}
uint32 data = 0x4321;
if(IfxPsi5_Psi5_sendChannelData(&psi5Channel, data) == FALSE)
{
printf("\n TPOI is set; Transfer not possible\n");
};
// add the code below to initiate the sensor to transmit frames
// ...
// end of code to initiate the sensor to transmit frames
// uncomment the below code after the adding the code to initiate the sensor to transmit frames
// for(int i=0; i<5; ++i) {
// IfxPsi5_Psi5_Frame frame;
// for(int chn=0; chn<IFXPSI5_NUM_CHANNELS; ++chn) {
// while( !IfxPsi5_Psi5_readChannelFrame(&psi5Channel[chn], &frame) );
// }
// printf("Chn%d: 0x%08x 0x%08x\n",(int)psi5Channel[chn].channelId, frame.rdm.lowWord, frame.rdm.highWord);
// }

Definition at line 534 of file IfxPsi5_Psi5.c.

IFX_EXTERN boolean IfxPsi5_Psi5_readChannelSerialMessage ( IfxPsi5_Psi5_Channel channel,
IfxPsi5_Slot  slot,
IfxPsi5_Psi5_SerialMessage message 
)

Get the received serial message for the channel.

Parameters
channelpointer to the PSI5 channel
slotSlot Id
messagepointer to the PSI5 serial message buffer
Returns
TRUE if successful; FALSE if no serial message available

Definition at line 552 of file IfxPsi5_Psi5.c.

IFX_EXTERN boolean IfxPsi5_Psi5_sendChannelData ( IfxPsi5_Psi5_Channel channel,
uint64  data 
)

Transmit the data through the channel.

Parameters
channelpointer to the PSI5 channel
datadata to be sent
Returns
TRUE if successful; FALSE otherwise

A coding example can be found in IfxPsi5_Psi5_readChannelFrame

Definition at line 578 of file IfxPsi5_Psi5.c.

IFX_INLINE boolean IfxPsi5_Psi5_startupChannel ( IfxPsi5_Psi5_Channel channel,
IfxPsi5_Psi5_StartupOptions options 
)

start the channel with the selected options

Parameters
channelpointer to the PSI5 channel
optionsstartup related options
Returns
TRUE if successful; FALSE otherwise

A coding example can be found in IfxPsi5_Psi5_readChannelFrame

Definition at line 514 of file IfxPsi5_Psi5.h.