SPI2 CS MQX3.7 question

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

SPI2 CS MQX3.7 question

ソリューションへジャンプ
1,622件の閲覧回数
Belen
Contributor I

Does anybody know how I can set SPI CS1 (PTD15 for Kinetis K60)?

 

I am using IO_IOCTL_SPI_SET_CS but I don't know the correct value for the param.

 

Thank you,

Belén.

0 件の賞賛
返信
1 解決策
1,198件の閲覧回数
PetrM
Senior Contributor I

Hello,

 

to deassert CS simply call fflush (spi_fd) or IO_IOCTL_FLUSH_OUTPUT command.

 

Regards,

PetrM

 

元の投稿で解決策を見る

0 件の賞賛
返信
3 返答(返信)
1,198件の閲覧回数
PetrM
Senior Contributor I

Hello, this should do it:

 

param = SPI_PUSHR_PCS(1 << 1);

ioctl (spi_fd, IO_IOCTL_SPI_SET_CS, &param);

 

The parameter type of this IOCTL command always corresponds to the one in the BSP SPI init structure (init_spi.c).

 

Regards,

PetrM

0 件の賞賛
返信
1,198件の閲覧回数
Belen
Contributor I

Thank you very much.

 

It works but my problem now is that I can't unset CS. I tried with:

 

        param = SPI_PUSHR_PCS(1 << 1);
        ioctl (spifd, IO_IOCTL_SPI_FLUSH_DEASSERT_CS, &param);

 

but it doesn't work. Any suggestions?

 

Regards,

Belén.

 

 

0 件の賞賛
返信
1,199件の閲覧回数
PetrM
Senior Contributor I

Hello,

 

to deassert CS simply call fflush (spi_fd) or IO_IOCTL_FLUSH_OUTPUT command.

 

Regards,

PetrM

 

0 件の賞賛
返信