K60 SPI drivers in MQX

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

K60 SPI drivers in MQX

Jump to solution
1,146 Views
Chris_T
Contributor I

I am using the K60N512 as a slave device in my project. I am using the IAR development platform. I am using the K60 tower for initial development. I am in the process of getting Interrupt enabled SPI drivers for the K60 and I have looked at MQX 3.7 SPI drivers. (spi_int_dspi.c, spi_int.c). I was also given drivers from the MCF5445. The drivers from the MCF5445 only work with a single SPI interface and they are written for master. Therefore I think my approach will need to utilize the MQX files. We do not want to integrate the MQX into our build so I will have to take these low level driver files files and modify them to work with our interface. When I looked at these files I also believe these are written for master SPI as well. Does anyone know if slave code exists or if there may be a better approach? I am new to SPI and MQX.

0 Kudos
1 Solution
314 Views
PetrM
Senior Contributor I

Hello,

 

the slave mode is also supported for the DSPI. The difference in the code is basically just in clock generation and chip select handling. Use IO_IOCTL_SPI_SET_TRANSFER_MODE with SPI_DEVICE_SLAVE_MODE to switch to slave mode.

 

PetrM

 

View solution in original post

0 Kudos
1 Reply
315 Views
PetrM
Senior Contributor I

Hello,

 

the slave mode is also supported for the DSPI. The difference in the code is basically just in clock generation and chip select handling. Use IO_IOCTL_SPI_SET_TRANSFER_MODE with SPI_DEVICE_SLAVE_MODE to switch to slave mode.

 

PetrM

 

0 Kudos