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/imx | |
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/imx')
-rw-r--r-- | nuttx/arch/arm/src/imx/chip.h | 2 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/imx/imx_cspi.h | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/imx/imx_memorymap.h | 2 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/imx/imx_spi.c | 3 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/imx/imx_system.h | 2 |
5 files changed, 21 insertions, 11 deletions
diff --git a/nuttx/arch/arm/src/imx/chip.h b/nuttx/arch/arm/src/imx/chip.h index 00272ccdb..c8a6615d7 100644 --- a/nuttx/arch/arm/src/imx/chip.h +++ b/nuttx/arch/arm/src/imx/chip.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/imx/chip.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/arch/arm/src/imx/imx_cspi.h b/nuttx/arch/arm/src/imx/imx_cspi.h index e0d97f2d4..421b6a4e3 100755 --- a/nuttx/arch/arm/src/imx/imx_cspi.h +++ b/nuttx/arch/arm/src/imx/imx_cspi.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/imx/imx_cspi.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -176,23 +176,30 @@ extern "C" { * Public Functions ************************************************************************************/ -/* The external functions, imx_spiselect and imx_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). All other - * methods (including up_spiinitialize()) are provided by common logic. To use this - * common SPI logic on your board: +/* The external functions, imx_spiselect, imx_spistatus, and imx_cmddaa must be + * provided by board-specific logic. These are implementations of the select and + * status 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: * * 1. Provide imx_spiselect() and imx_spistatus() functions in your board-specific * logic. This function will perform chip selection and status operations using * GPIOs in the way your board is configured. - * 2. Add a call to up_spiinitialize() in your low level initialization logic - * 3. The handle returned by up_spiinitialize() may then be used to bind the + * 2. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration, provide the + * imx_spicmddata() function in your board-specific logic. This function will + * perform cmd/data selection operations using GPIOs in the way your board is + * configured. + * 3. Add a call to up_spiinitialize() in your low level initialization logic + * 4. 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). */ EXTERN void imx_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t imx_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int imx_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif #undef EXTERN #ifdef __cplusplus diff --git a/nuttx/arch/arm/src/imx/imx_memorymap.h b/nuttx/arch/arm/src/imx/imx_memorymap.h index d656b2f80..0b7603bef 100644 --- a/nuttx/arch/arm/src/imx/imx_memorymap.h +++ b/nuttx/arch/arm/src/imx/imx_memorymap.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/imx/imx_memorymap.h * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/arch/arm/src/imx/imx_spi.c b/nuttx/arch/arm/src/imx/imx_spi.c index 578e274cd..e07cd5d32 100755 --- a/nuttx/arch/arm/src/imx/imx_spi.c +++ b/nuttx/arch/arm/src/imx/imx_spi.c @@ -197,6 +197,9 @@ static const struct spi_ops_s g_spiops = .setmode = spi_setmode, .setbits = spi_setbits, .status = imx_spistatus, /* Provided externally by board logic */ +#ifdef CONFIG_SPI_CMDDATA + .cmddata = imx_spicmddata, +#endif .send = spi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = spi_exchange, diff --git a/nuttx/arch/arm/src/imx/imx_system.h b/nuttx/arch/arm/src/imx/imx_system.h index fe575cf41..a3a4b4c54 100755 --- a/nuttx/arch/arm/src/imx/imx_system.h +++ b/nuttx/arch/arm/src/imx/imx_system.h @@ -1,7 +1,7 @@ /************************************************************************************
* arch/arm/src/imx/imx_system.h
*
- * Copyright (C) 2009 Gregory Nutt. All rights reserved.
+ * Copyright (C) 2009-2010 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
*
* Redistribution and use in source and binary forms, with or without
|