diff options
author | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-03-26 01:04:10 +0000 |
---|---|---|
committer | patacongo <patacongo@7fd9a85b-ad96-42d3-883c-3090e2eb8679> | 2011-03-26 01:04:10 +0000 |
commit | f3e64e55c04e9eef02c64d64d3b9117143502ccd (patch) | |
tree | 4c791787398c9f76ccd9c8a56e1dd139c2a4e8e4 /nuttx/configs/vsn/src/spi.c | |
parent | 92a6346ae8bb62459481b880abf4f211b4bd4031 (diff) |
Incorporate changes from Uros Platise
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@3419 7fd9a85b-ad96-42d3-883c-3090e2eb8679
Diffstat (limited to 'nuttx/configs/vsn/src/spi.c')
-rw-r--r-- | nuttx/configs/vsn/src/spi.c | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/nuttx/configs/vsn/src/spi.c b/nuttx/configs/vsn/src/spi.c index 742fcfd41e..a452197b71 100644 --- a/nuttx/configs/vsn/src/spi.c +++ b/nuttx/configs/vsn/src/spi.c @@ -37,12 +37,17 @@ * ************************************************************************************/ -/************************************************************************************ - * Included Files - ************************************************************************************/ +/** \file + * \author Gregory Nutt, Uros Platise + * \brief SPI Slave Selects + */ + #include <nuttx/config.h> #include <nuttx/spi.h> + +#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) + #include <arch/board/board.h> #include <stdint.h> @@ -55,7 +60,6 @@ #include "stm32_internal.h" #include "vsn.h" -#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3) /************************************************************************************ * Definitions @@ -79,22 +83,15 @@ # define spivdbg(x...) #endif -/************************************************************************************ - * Private Functions - ************************************************************************************/ /************************************************************************************ * Public Functions ************************************************************************************/ -/************************************************************************************ - * Name: stm32_spiinitialize - * - * Description: - * Called to configure SPI chip select GPIO pins for the VSN board. - * - ************************************************************************************/ +/** Called to configure SPI chip select GPIO pins for the VSN board. + */ + void weak_function stm32_spiinitialize(void) { /* NOTE: Clocking for SPI1 and/or SPI2 and SPI3 was already provided in stm32_rcc.c. @@ -109,10 +106,8 @@ void weak_function stm32_spiinitialize(void) #endif } -/**************************************************************************** - * Name: stm32_spi1/2/3select and stm32_spi1/2/3status +/** Selects: 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 @@ -132,9 +127,10 @@ void weak_function stm32_spiinitialize(void) * mmcsd_spislotinitialize(), for example, will bind the SPI driver to * the SPI MMC/SD driver). * - ****************************************************************************/ + **/ #ifdef CONFIG_STM32_SPI1 + void stm32_spi1select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -144,9 +140,11 @@ uint8_t stm32_spi1status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { return SPI_STATUS_PRESENT; } + #endif #ifdef CONFIG_STM32_SPI2 + void stm32_spi2select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -156,9 +154,11 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { return SPI_STATUS_PRESENT; } + #endif #ifdef CONFIG_STM32_SPI3 + void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) { spidbg("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); @@ -173,6 +173,7 @@ uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) { return SPI_STATUS_PRESENT; } + #endif #endif /* CONFIG_STM32_SPI1 || CONFIG_STM32_SPI2 */ |