diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-03 01:37:56 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-12-03 01:37:56 +0000 |
commit | 5076c4bb878881610884750c5a8fd43bdf99c471 (patch) | |
tree | c28e5e59c702dfc7394e9d365b9bcb7c3209b7ea /nuttx/arch/arm/src/lm3s | |
parent | 42a5fb251254f855b5f3911337d56f0cccfcc37f (diff) | |
download | px4-nuttx-5076c4bb878881610884750c5a8fd43bdf99c471.tar.gz px4-nuttx-5076c4bb878881610884750c5a8fd43bdf99c471.tar.bz2 px4-nuttx-5076c4bb878881610884750c5a8fd43bdf99c471.zip |
Add cmddata method to the SPI interface
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3157 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lm3s')
-rw-r--r-- | nuttx/arch/arm/src/lm3s/lm3s_internal.h | 18 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lm3s/lm3s_ssi.c | 5 |
2 files changed, 17 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/lm3s/lm3s_internal.h b/nuttx/arch/arm/src/lm3s/lm3s_internal.h index 38a079743..43bcf2d6f 100644 --- a/nuttx/arch/arm/src/lm3s/lm3s_internal.h +++ b/nuttx/arch/arm/src/lm3s/lm3s_internal.h @@ -474,9 +474,10 @@ EXTERN int lm3s_ethinitialize(int intf); #endif /**************************************************************************** - * The external functions, lm3s_spiselect and lm3s_spistatus must be provided - * by board-specific logic. The are implementations of the select and status - * methods SPI interface defined by struct spi_ops_s (see include/nuttx/spi.h). + * The external functions, lm3s_spiselect, lm3s_spistatus, and + * lm3s_spicmddata must be provided by board-specific logic. These are + * implementations of the select, status, and cmddaa methods of the SPI + * interface defined by struct spi_ops_s (see include/nuttx/spi.h). * All other methods (including up_spiinitialize()) are provided by common * logic. To use this common SPI logic on your board: * @@ -485,9 +486,13 @@ EXTERN int lm3s_ethinitialize(int intf); * 2. Provide lm3s_spiselect() and lm3s_spistatus() functions in your * board-specific logic. These functions will perform chip selection and * status operations using GPIOs in the way your board is configured. - * 3. Add a call to up_spiinitialize() in your low level application + * 3. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration, provide + * the lm3s_spicmddata() function in your board-specific logic. This + * functions will perform cmd/data selection operations using GPIOs in + * the way your board is configured. + * 4. Add a call to up_spiinitialize() in your low level application * initialization logic - * 4. The handle returned by up_spiinitialize() may then be used to bind the + * 5. The handle returned by up_spiinitialize() may then be used to bind the * SPI driver to higher level logic (e.g., calling * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). @@ -498,6 +503,9 @@ struct spi_dev_s; enum spi_dev_e; EXTERN void lm3s_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t lm3s_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int lm3s_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif #undef EXTERN #if defined(__cplusplus) diff --git a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c b/nuttx/arch/arm/src/lm3s/lm3s_ssi.c index 8c3929ad7..3b6abab2c 100755 --- a/nuttx/arch/arm/src/lm3s/lm3s_ssi.c +++ b/nuttx/arch/arm/src/lm3s/lm3s_ssi.c @@ -1,5 +1,5 @@ /**************************************************************************** - * arch/arm/src/lm32/lm3s_spi.c + * arch/arm/src/lm32/lm3s_ssi.c * * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> @@ -279,6 +279,9 @@ static const struct spi_ops_s g_spiops = .setmode = ssi_setmode, .setbits = ssi_setbits, .status = lm3s_spistatus, /* Provided externally by board logic */ +#ifdef CONFIG_SPI_CMDDATA + .cmddata = lm3s_spicmddata, +#endif .send = ssi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = ssi_exchange, |