Merged in merlin17/nuttx (pull request #302)

configs/clicker2-stm32: Fixes minor SPI configuration issues

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Anthony Merlino
2017-03-28 21:10:10 +00:00
committed by Gregory Nutt
3 changed files with 35 additions and 2 deletions
+12 -1
View File
@@ -233,6 +233,17 @@
* Public Functions * Public Functions
************************************************************************************/ ************************************************************************************/
/****************************************************************************
* Name: stm32_spidev_initialize
*
* Description:
* Called to configure SPI chip select GPIO pins for the Mikroe Clicker2 STM32
* board.
*
****************************************************************************/
void weak_function stm32_spidev_initialize(void);
/************************************************************************************ /************************************************************************************
* Name: stm32_bringup * Name: stm32_bringup
* *
@@ -254,7 +265,7 @@ int stm32_bringup(void);
* *
* Description: * Description:
* Called from stm32_boardinitialize very early in inialization to setup USB-related * Called from stm32_boardinitialize very early in inialization to setup USB-related
* GPIO pins for the Olimex STM32 P407 board. * GPIO pins for the Mikroe Clicker2 STM32 board.
* *
************************************************************************************/ ************************************************************************************/
+11
View File
@@ -63,6 +63,17 @@
void stm32_boardinitialize(void) void stm32_boardinitialize(void)
{ {
#if defined(CONFIG_STM32_SPI1) || defined(CONFIG_STM32_SPI2) || defined(CONFIG_STM32_SPI3)
/* Configure SPI chip selects if 1) SPI is not disabled, and 2) the weak function
* stm32_spidev_initialize() has been brought into the link.
*/
if (stm32_spidev_initialize)
{
stm32_spidev_initialize();
}
#endif
#ifdef CONFIG_STM32_OTGFS #ifdef CONFIG_STM32_OTGFS
/* Initialize USB if the 1) OTG FS controller is in the configuration and 2) /* Initialize USB if the 1) OTG FS controller is in the configuration and 2)
* disabled, and 3) the weak function stm32_usb_configure() has been brought * disabled, and 3) the weak function stm32_usb_configure() has been brought
+12 -1
View File
@@ -135,7 +135,18 @@ uint8_t stm32_spi2status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)
void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected) void stm32_spi3select(FAR struct spi_dev_s *dev, enum spi_dev_e devid, bool selected)
{ {
spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert"); spiinfo("devid: %d CS: %s\n", (int)devid, selected ? "assert" : "de-assert");
/* To be provided */
switch(devid)
{
#ifdef CONFIG_IEEE802154_MRF24J40
case SPIDEV_IEEE802154:
/* Set the GPIO low to select and high to de-select */
stm32_gpiowrite(GPIO_MB1_CS, !selected);
break;
#endif
default:
break;
}
} }
uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid) uint8_t stm32_spi3status(FAR struct spi_dev_s *dev, enum spi_dev_e devid)