How can I implement S32k144 spi0 communication its own spi1

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I implement S32k144 spi0 communication its own spi1

1,077 Views
DELPHI_Eric
Contributor III

How can I implement S32k144 lpspi0 communication its own lpspi1 for test lpspi function is OK,is there one demo for reference,thank you.

follow is the S32 DS IDE example : lpspi_transfer_s32k144


LPSPI_DRV_MasterInit(SEND, &masterState, &Send_MasterConfig0);

LPSPI_DRV_SlaveInit(RECEIVE, &slaveState, &Receive_SlaveConfig0);

ADC_DRV_ConfigConverter(INST_ADCONV1, &adConv1_ConvConfig0);

FTM_DRV_Init(INST_FLEXTIMER_PWM1, &flexTimer_pwm1_InitConfig, &ftmStateStruct);
FTM_DRV_InitPwm(INST_FLEXTIMER_PWM1, &flexTimer_pwm1_PwmConfig);

while(1)
{
   ADC_DRV_ConfigChan(INST_ADCONV1, 0U, &adConv1_ChnConfig0);
   ADC_DRV_WaitConvDone(INST_ADCONV1);

   ADC_DRV_GetChanResult(INST_ADCONV1, 0U, &adcRead);
   slaveDataSend = (uint8_t)adcRead;
   LPSPI_DRV_SlaveTransfer(RECEIVE, &slaveDataSend, &slaveDataReceive, BUFFER_SIZE);
   LPSPI_DRV_MasterTransferBlocking(SEND, &masterDataSend, &masterDataReceive, BUFFER_SIZE, TIMEOUT);
   FTM_DRV_UpdatePwmChannel(INST_FLEXTIMER_PWM1, 0U, FTM_PWM_UPDATE_IN_DUTY_CYCLE,    masterDataReceive<<8, 0U, true);

}

0 Kudos
Reply
1 Reply

962 Views
danielmartynek
NXP TechSupport
NXP TechSupport

Hello shenjun,

I have difficulties to understand.
Could you please elaborate?

If you want to have more information about the lpspi_transfer_s32k144 example, please refer to its documentation in the SDK installation folder:

…\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\doc\Start_here.html

pastedImage_2.png

Thanks,

BR, Daniel

0 Kudos
Reply