summaryrefslogtreecommitdiff
path: root/nuttx/include
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-29 18:53:20 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-29 18:53:20 +0000
commit0770d2dd012902a4500bfac21e90181e3ed5ad69 (patch)
treedd3432ad3b7c5fcc83c955ba2539ab4a387f1621 /nuttx/include
parenteb8bf2893617f690ab073a5d1b697bd12e5220a0 (diff)
downloadpx4-nuttx-0770d2dd012902a4500bfac21e90181e3ed5ad69.tar.gz
px4-nuttx-0770d2dd012902a4500bfac21e90181e3ed5ad69.tar.bz2
px4-nuttx-0770d2dd012902a4500bfac21e90181e3ed5ad69.zip
Add enum argument to SPI status method
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1667 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r--nuttx/include/nuttx/spi.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/nuttx/include/nuttx/spi.h b/nuttx/include/nuttx/spi.h
index f3dfa82a7..e07ca6123 100644
--- a/nuttx/include/nuttx/spi.h
+++ b/nuttx/include/nuttx/spi.h
@@ -77,7 +77,8 @@
* Set the SPI frequency. Required.
*
* Input Parameters:
- * frequency: The SPI frequency requested
+ * dev - Device-specific state data
+ * frequency - The SPI frequency requested
*
* Returned Value:
* Returns the actual frequency selected
@@ -93,15 +94,16 @@
* Get SPI/MMC status. Optional.
*
* Input Parameters:
- * None
+ * dev - Device-specific state data
+ * devid - Identifies the device to report status on
*
* Returned Value:
* Returns a bitset of status values (see SPI_STATUS_* defines
*
****************************************************************************/
-#define SPI_STATUS(d) \
- ((d)->ops->status ? (d)->ops->status(d) : SPI_STATUS_PRESENT)
+#define SPI_STATUS(d,id) \
+ ((d)->ops->status ? (d)->ops->status(d, id) : SPI_STATUS_PRESENT)
/* SPI status bits -- Some dedicated for SPI MMC/SD support and may have no
* relationship to SPI other than needed by the SPI MMC/SD interface
@@ -117,7 +119,8 @@
* Send one byte on SPI. Required.
*
* Input Parameters:
- * ch - the byte to send
+ * dev - Device-specific state data
+ * ch - The byte to send
*
* Returned Value:
* None
@@ -133,6 +136,7 @@
* Send a block of data on SPI. Required.
*
* Input Parameters:
+ * dev - Device-specific state data
* buffer - A pointer to the buffer of data to be sent
* buflen - the length of data to send from the buffer
*
@@ -150,6 +154,7 @@
* Revice a block of data from SPI. Required.
*
* Input Parameters:
+ * dev - Device-specific state data
* buffer - A pointer to the buffer in which to recieve data
* buflen - the length of data that can be received in the buffer
*
@@ -169,8 +174,9 @@
* Optional
*
* Input Parameters:
+ * dev - Device-specific state data
* callback - The funtion to call on the media change
- * arg - A caller provided value to return with the callback
+ * arg - A caller provided value to return with the callback
*
* Returned Value:
* 0 on success; negated errno on failure.
@@ -206,7 +212,7 @@ struct spi_ops_s
{
void (*select)(FAR struct spi_dev_s *dev, enum spidev_e devid, boolean selected);
uint32 (*setfrequency)(FAR struct spi_dev_s *dev, uint32 frequency);
- ubyte (*status)(FAR struct spi_dev_s *dev);
+ ubyte (*status)(FAR struct spi_dev_s *dev, enum spidev_e devid);
ubyte (*sndbyte)(FAR struct spi_dev_s *dev, ubyte ch);
void (*sndblock)(FAR struct spi_dev_s *dev, FAR const ubyte *buffer, size_t buflen);
void (*recvblock)(FAR struct spi_dev_s *dev, FAR ubyte *buffer, size_t buflen);