QSPI multiple slave

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
BDhola
Level 1
Level 1
First question asked First reply posted 5 sign-ins

Hi Guys, 

I am implementinng multiple slave  Functionality on TC222. 

I  dont know how to   initialize master channel  when we have more then 1 Slave.

Can any one guide me. 

Here is my source  code for youre reference to initialize master channel for one slave.

/* QSPI1 Master channel initialization
* This function initializes the QSPI1 Master channel.
*/
void initQSPI1MasterChannel(void)
{
IfxQspi_SpiMaster_ChannelConfig spiMasterChannelConfig; /* Define a Master Channel configuration */

/* Initialize the configuration with default values */
IfxQspi_SpiMaster_initChannelConfig(&spiMasterChannelConfig, &g_qspi1.spiMaster);

spiMasterChannelConfig.base.baudrate = QSPI1_BAUDRATE; /* Set SCLK frequency */
spiMasterChannelConfig.base.mode.clockPolarity = SpiIf_ClockPolarity_idleLow;
spiMasterChannelConfig.base.mode.shiftClock = SpiIf_ShiftClock_shiftTransmitDataOnLeadingEdge;
spiMasterChannelConfig.base.mode.csInactiveDelay = SpiIf_SlsoTiming_1;
spiMasterChannelConfig.base.mode.csLeadDelay = SpiIf_SlsoTiming_1;
spiMasterChannelConfig.base.mode.csTrailDelay = SpiIf_SlsoTiming_1;

/* Select the port pin for the Chip Select signal */
const IfxQspi_SpiMaster_Output qspiSlaveSelect = { /* QSPI3 Master selects the QSPI3 Slave */
&IfxQspi1_SLSO3_P11_10_OUT, IfxPort_OutputMode_pushPull, /* Slave Select port pin (CS) */
IfxPort_PadDriver_cmosAutomotiveSpeed1 /* Pad driver mode */
};

spiMasterChannelConfig.sls.output = qspiSlaveSelect;

//spiMasterChannelConfig.sls.output.pin = IfxQspi1_SLSO3_P11_10_OUT | IfxQspi1_SLSO4_P11_11_OUT |IfxQspi1_SLSO5_P11_2_OUT;
//spiMasterChannelConfig.sls.output.mode = IfxPort_OutputMode_pushPull;
//spiMasterChannelConfig.sls.output.driver = IfxPort_PadDriver_cmosAutomotiveSpeed1;
//spiMasterChannelConfig.mode.autoCS = (chHandle->activateSlso == NULL_PTR) && (chHandle->deactivateSlso == NULL_PTR);


/* Initialize the QSPI Master channel */
IfxQspi_SpiMaster_initChannel(&g_qspi1.spiMasterChannel, &spiMasterChannelConfig);
}

0 Likes
1 Reply
Di_W
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 250 solutions authored

Hi BD,

For multi slave, you should use GPIO for chip selection, other communication you can keep one master Tx and Rx.

https://community.infineon.com/t5/AURIX/RFID-AURIX-Infineon-Controller-TC3X7/m-p/348119#M7525

dw

0 Likes