spi writeread function

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

spi writeread function

1,604 次查看
cerr
Contributor I

Hello there,

I'm looking to hook up a p1020 to a Kinetis K60 over SPI. Now, on the P1020, I'm running VxWorks and I have a function spiWriteReadCmd () whixch allows me to send data from an argument provided and at the same time, it will copy the datra in the incoming buffer into an other argument provided.

Now, I'm looking for a similar function on my Kinetis part but have not been able to find it. I have tried around quite a bit already but have not been able to get the SPI on my K60 going yet. I coudln't find much SPI examples for Kinetis, how do I get this going the best?

标签 (1)
标记 (2)
5 回复数

1,144 次查看
cerr
Contributor I

Thanks everyone for the replys!

We got it working now! :smileyhappy:

0 项奖励
回复

1,144 次查看
Amit_Kumar1
Senior Contributor II

Hi Ron

Can you share your writeread function ? Thanks in advance

Kind Regards

Amit Kumar

0 项奖励
回复

1,144 次查看
chandrasekarkan
Contributor III

Hello

    If you are using MQX on K60, try the spi example in "installDirectory/freescale_MQX/mqx/examples/spi".......

rw.BUFFER_LENGTH = 10;
rw.WRITE_BUFFER = (char_ptr)send_buffer;
rw.READ_BUFFER = (char_ptr)recv_buffer;
printf ("IO_IOCTL_SPI_READ_WRITE ... ");
if (SPI_OK == ioctl (spifd, IO_IOCTL_SPI_READ_WRITE, &rw))

This ioctl call, writes commands to spi as well as reads its response....

1,144 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

There is a SPI demo code for TWR-K60D100M board communication with TWR-MEM Serial Flash device.

Customer can download KINETIS512_V2_SC (Kinetis 100MHz Rev 2 Example Projects) [spi_demo] from below link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=K60_100&nodeId=01624698C9DE2DDDAF&fps...

Wish it helps.

0 项奖励
回复

1,144 次查看
Paul_Tian
NXP Employee
NXP Employee

Hi, Ron

Do you need sample code for bare board or a RTOS? If first one, I can provide one for you.

Best Regards

Paul

0 项奖励
回复