spi writeread function

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

spi writeread function

1,601件の閲覧回数
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,141件の閲覧回数
cerr
Contributor I

Thanks everyone for the replys!

We got it working now! :smileyhappy:

0 件の賞賛
返信

1,141件の閲覧回数
Amit_Kumar1
Senior Contributor II

Hi Ron

Can you share your writeread function ? Thanks in advance

Kind Regards

Amit Kumar

0 件の賞賛
返信

1,141件の閲覧回数
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,141件の閲覧回数
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,141件の閲覧回数
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 件の賞賛
返信