Changed length parameter in SPI methods to be a byte length, rather than

a word length.
This commit is contained in:
Michael Brown
2006-12-04 16:09:59 +00:00
parent 931f94dca3
commit dc06c895fc
5 changed files with 15 additions and 21 deletions

View File

@@ -118,21 +118,21 @@ struct spi_device_type {
* @v device SPI device
* @v address Address from which to read
* @v data Data buffer
* @v len Length of data to read, in @b words
* @v len Length of data buffer
* @ret rc Return status code
*/
int ( * read ) ( struct spi_device *device, unsigned int address,
void *data, unsigned int len );
void *data, size_t len );
/** Write data to device
*
* @v device SPI device
* @v address Address to which to write
* @v data Data buffer
* @v len Length of data to write, in @b words
* @v len Length of data buffer
* @ret rc Return status code
*/
int ( * write ) ( struct spi_device *device, unsigned int address,
const void *data, unsigned int len );
const void *data, size_t len );
};
/**
@@ -192,18 +192,15 @@ struct spi_bus {
* @v address Address to read/write (<0 for no address)
* @v data_out TX data buffer (or NULL)
* @v data_in RX data buffer (or NULL)
* @v len Length of transfer (in @b words)
* @v len Length of data buffer(s)
*
* This issues the specified command and optional address to
* the SPI device, then reads and/or writes data to/from the
* data buffers. Note that the transfer length is measured in
* words, not in bytes. Some SPI devices have 16-bit word
* lengths; take care with these devices not to accidentally
* read or write twice as much data as intended.
* data buffers.
*/
int ( * rw ) ( struct spi_bus *bus, struct spi_device *device,
unsigned int command, int address,
const void *data_out, void *data_in, unsigned int len );
const void *data_out, void *data_in, size_t len );
};
/** Clock phase (CPHA) mode bit

View File

@@ -56,6 +56,6 @@
/** @} */
extern int threewire_read ( struct spi_device *device, unsigned int address,
void *data, unsigned int len );
void *data, size_t len );
#endif /* _GPXE_THREEWIRE_H */