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 | |
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')
-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 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lm3s/lm3s_internal.h | 18 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lm3s/lm3s_ssi.c | 5 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc17_internal.h | 29 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc17_spi.c | 3 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc17xx/lpc17_ssp.c | 6 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/lpc313x/lpc313x_internal.h | 23 | ||||
-rw-r--r-- | nuttx/arch/arm/src/lpc313x/lpc313x_spi.c | 3 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_internal.h | 25 | ||||
-rwxr-xr-x | nuttx/arch/arm/src/stm32/stm32_spi.c | 9 |
14 files changed, 111 insertions, 42 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
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, diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h b/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h index 41fe549b4..2c684767c 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_internal.h @@ -555,22 +555,26 @@ EXTERN int lpc17_dumpgpio(uint16_t pinset, const char *msg); EXTERN void lpc17_clrpend(int irq); /************************************************************************************ - * Name: lpc17_spi/ssp0/ssp1select and lpc17_spi/ssp0/ssp1status + * Name: lpc17_spi/ssp0/ssp1select, lpc17_spi/ssp0/ssp1status, and + * lpc17_spi/ssp0/ssp1cmddata * * Description: - * The external functions, lpc17_spi/ssp0/ssp1select and lpc17_spi/ssp0/ssp1status - * must be provided by board-specific logic. They 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 LPC17xx logic. To use this common SPI logic on your - * board: + * These external functions must be provided by board-specific logic. They are + * implementations of the select, status, and cmddata 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 LPC17xx logic. To use + * this common SPI logic on your board: * * 1. Provide logic in lpc17_boardinitialize() to configure SPI/SSP chip select * pins. * 2. Provide lpc17_spi/ssp0/ssp1select() and lpc17_spi/ssp0/ssp1status() 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 calls to up_spiinitialize() in your low level application + * 2. If CONFIG_SPI_CMDDATA is defined in the NuttX configuration, provide + * lpc17_spi/ssp0/ssp1cmddata() functions in your board-specific logic. These + * functions 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 application * 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 @@ -585,14 +589,23 @@ enum spi_dev_e; #ifdef CONFIG_LPC17_SPI EXTERN void lpc17_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t lpc17_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int lpc17_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif #endif #ifdef CONFIG_LPC17_SSP0 EXTERN void lpc17_ssp0select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t lpc17_ssp0status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int lpc17_ssp0cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif #endif #ifdef CONFIG_LPC17_SSP1 EXTERN void lpc17_ssp1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t lpc17_ssp1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int lpc17_ssp1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif #endif /**************************************************************************** diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_spi.c b/nuttx/arch/arm/src/lpc17xx/lpc17_spi.c index 0525879b9..e5cc2b3e3 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_spi.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_spi.c @@ -147,6 +147,9 @@ static const struct spi_ops_s g_spiops = .setmode = spi_setmode, .setbits = spi_setbits, .status = lpc17_spistatus, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = lpc17_spicmddata, +#endif .send = spi_send, .sndblock = spi_sndblock, .recvblock = spi_recvblock, diff --git a/nuttx/arch/arm/src/lpc17xx/lpc17_ssp.c b/nuttx/arch/arm/src/lpc17xx/lpc17_ssp.c index e0331f09e..4512cbd28 100755 --- a/nuttx/arch/arm/src/lpc17xx/lpc17_ssp.c +++ b/nuttx/arch/arm/src/lpc17xx/lpc17_ssp.c @@ -171,6 +171,9 @@ static const struct spi_ops_s g_spi0ops = .setmode = ssp_setmode, .setbits = ssp_setbits, .status = lpc17_ssp0status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = lpc17_ssp0cmddata, +#endif .send = ssp_send, .sndblock = ssp_sndblock, .recvblock = ssp_recvblock, @@ -198,6 +201,9 @@ static const struct spi_ops_s g_spi1ops = .setmode = ssp_setmode, .setbits = ssp_setbits, .status = lpc17_ssp1status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = lpc17_ssp1cmddata, +#endif .send = ssp_send, .sndblock = ssp_sndblock, .recvblock = ssp_recvblock, diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_internal.h b/nuttx/arch/arm/src/lpc313x/lpc313x_internal.h index ab8e3caf9..6fdbe9b37 100755 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_internal.h +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_internal.h @@ -173,21 +173,25 @@ EXTERN void lpc313x_clockconfig(void); * Name: lpc313x_spiselect and lpc313x_spistatus * * Description: - * The external functions, lpc313x_spiselect and lpc313x_spistatus must be - * provided by board-specific logic. They 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 LPC313X logic. To use this common SPI logic on your - * board: + * The external functions, lpc313x_spiselect, lpc313x_spistatus, and + * lpc313x_spicmddata must be provided by board-specific logic. These are + * implementations of the select, status, and cmddata 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 LPC313X logic. To use + * this common SPI logic on your board: * * 1. Provide logic in lpc313x_boardinitialize() to configure SPI chip select * pins. * 2. Provide lpc313x_spiselect() and lpc313x_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 calls to up_spiinitialize() in your low level application + * 3. If CONFIG_SPI_CMDDATA is selected in your NuttX configuration, provide + * the lpc313x_spicmddata() function in your board-specific logic. This + * function will perform cmd/data selection operations using GPIOs in the + * way your board is configured. + * 4. Add a calls 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). @@ -198,6 +202,9 @@ struct spi_dev_s; enum spi_dev_e; EXTERN void lpc313x_spiselect(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t lpc313x_spistatus(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +#ifdef CONFIG_SPI_CMDDATA +EXTERN int lpc313x_spicmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); +#endif /************************************************************************************ * Name: lpc313x_usbpullup diff --git a/nuttx/arch/arm/src/lpc313x/lpc313x_spi.c b/nuttx/arch/arm/src/lpc313x/lpc313x_spi.c index a089c5543..af4c9ce09 100644 --- a/nuttx/arch/arm/src/lpc313x/lpc313x_spi.c +++ b/nuttx/arch/arm/src/lpc313x/lpc313x_spi.c @@ -145,6 +145,9 @@ static const struct spi_ops_s g_spiops = .setmode = spi_setmode, .setbits = spi_setbits, .status = spi_status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = lpc313x_spicmddata, +#endif .send = spi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = spi_exchange, diff --git a/nuttx/arch/arm/src/stm32/stm32_internal.h b/nuttx/arch/arm/src/stm32/stm32_internal.h index d7e40ba63..9c13f04ef 100755 --- a/nuttx/arch/arm/src/stm32/stm32_internal.h +++ b/nuttx/arch/arm/src/stm32/stm32_internal.h @@ -1,7 +1,7 @@ /************************************************************************************ * arch/arm/src/stm32/stm32_internal.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 @@ -445,21 +445,25 @@ EXTERN int stm32_ethinitialize(int intf); * Name: stm32_spi1/2/3select and stm32_spi1/2/3status * * Description: - * The external functions, stm32_spi1/2/3select and stm32_spi1/2/3status must be - * provided by board-specific logic. They 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 STM32 logic. To use this common SPI logic on your - * board: + * The external functions, stm32_spi1/2/3select, stm32_spi1/2/3status, and + * stm32_spi1/2/3cmddata must be provided by board-specific logic. These are + * implementations of the select, status, and cmddata 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 STM32 logic. To use this + * common SPI logic on your board: * * 1. Provide logic in stm32_boardinitialize() to configure SPI chip select * pins. * 2. Provide stm32_spi1/2/3select() and stm32_spi1/2/3status() 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 calls to up_spiinitialize() in your low level application + * 3. If CONFIG_SPI_CMDDATA is defined in your NuttX configuration file, then + * provide stm32_spi1/2/3cmddata() functions in your board-specific logic. + * These functions will perform cmd/data selection operations using GPIOs in the + * way your board is configured. + * 4. Add a calls 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). @@ -470,10 +474,13 @@ struct spi_dev_s; enum spi_dev_e; EXTERN void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +EXTERN int stm32_spi1cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); EXTERN void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +EXTERN int stm32_spi2cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); EXTERN void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected); EXTERN uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid); +EXTERN int stm32_spi3cmddata(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool cmd); /************************************************************************************ * Name: stm32_usbpullup diff --git a/nuttx/arch/arm/src/stm32/stm32_spi.c b/nuttx/arch/arm/src/stm32/stm32_spi.c index 4605f8a30..5e28ee879 100755 --- a/nuttx/arch/arm/src/stm32/stm32_spi.c +++ b/nuttx/arch/arm/src/stm32/stm32_spi.c @@ -209,6 +209,9 @@ static const struct spi_ops_s g_sp1iops = .setmode = spi_setmode, .setbits = spi_setbits, .status = stm32_spi1status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = stm32_spi1cmddata, +#endif .send = spi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = spi_exchange, @@ -245,6 +248,9 @@ static const struct spi_ops_s g_sp2iops = .setmode = spi_setmode, .setbits = spi_setbits, .status = stm32_spi2status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = stm32_spi2cmddata, +#endif .send = spi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = spi_exchange, @@ -281,6 +287,9 @@ static const struct spi_ops_s g_sp3iops = .setmode = spi_setmode, .setbits = spi_setbits, .status = stm32_spi3status, +#ifdef CONFIG_SPI_CMDDATA + .cmddata = stm32_spi3cmddata, +#endif .send = spi_send, #ifdef CONFIG_SPI_EXCHANGE .exchange = spi_exchange, |