2008-03-25 23:20:52     Operate SPI port full duplex

Document created by Aaronwu Employee on Aug 5, 2013
Version 1Show Document
  • View in full screen mode

2008-03-25 23:20:52     Operate SPI port full duplex

DAVID ZHOU (CHINA)

Message: 53022   

 

In my driver I want to operate SPI port full duplex, How should I do ?

 

That is mean : from the first bit of the data transfer ,the received bit  is valid . Atfer I send out 3 bytes, I will have received 3 bytes data.

 

Second question:

 

I have read the spi_bf5xx.c source code,

 

when read, the MOSI line will send out 0xFFFF, but  0xFFFF will be a valid command for my SPI slave chip. If I want to send out 0x0000 on MOSI line. How should I do ?

 

Thanks.

 

My  uclinux version and toolchain  are  2008 new release version.

 

I have read  the spi documents, but It do not tell me how to do.

QuoteReplyEditDelete

 

 

2008-03-26 00:36:13     Re: Operate SPI port full duplex

Mike Frysinger (UNITED STATES)

Message: 53027    did you read the wiki as well as the external resources ?  full duplex transfers are covered

 

http://docs.blackfin.uclinux.org/doku.php?id=spi

linux-2.6.x/include/linux/spi/spi.h

QuoteReplyEditDelete

 

 

2008-03-26 02:15:01     Re: Operate SPI port full duplex

DAVID ZHOU (CHINA)

Message: 53031   

 

Thanks! Mike.

 

I have read that, but only find  spi_write_then_read(), It is a half-duplex, not full-duplex.

 

Also there are duplex functions, such as :

 

static void u8_duplex(struct driver_data *drv_data)

 

But I do not know how to call it.

 

 

 

QuoteReplyEditDelete

 

 

2008-03-26 10:06:14     Re: Operate SPI port full duplex

Mike Frysinger (UNITED STATES)

Message: 53056    read the header file i referred to ... you could also read existing spi drivers

Attachments

    Outcomes