nxstyle
This commit is contained in:
parent
5fd9bd5837
commit
2d8a534ef5
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_bh1750.h
|
* boards/arm/stm32/common/include/stm32_bh1750.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_dhtxx.h
|
* boards/arm/stm32/common/include/stm32_dhtxx.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* /home/v01d/coding/nuttx_latest/nuttx/boards/arm/stm32/common/include/stm32_l3gd20.h
|
* boards/arm/stm32/common/include/stm32_l3gd20.h
|
||||||
*
|
*
|
||||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||||
* contributor license agreements. See the NOTICE file distributed with
|
* contributor license agreements. See the NOTICE file distributed with
|
||||||
|
@ -60,7 +60,8 @@
|
|||||||
* Private Function Prototypes
|
* Private Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, bool mode);
|
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state,
|
||||||
|
bool mode);
|
||||||
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value);
|
static void dhtxx_set_data_pin(FAR struct dhtxx_config_s *state, bool value);
|
||||||
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state);
|
static bool dhtxx_read_data_pin(FAR struct dhtxx_config_s *state);
|
||||||
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state);
|
static int64_t dhtxx_get_clock(FAR struct dhtxx_config_s *state);
|
||||||
@ -85,7 +86,8 @@ struct timespec ts;
|
|||||||
* Private Functions
|
* Private Functions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state, bool mode)
|
static void dhtxx_config_data_pin(FAR struct dhtxx_config_s *state,
|
||||||
|
bool mode)
|
||||||
{
|
{
|
||||||
if (mode)
|
if (mode)
|
||||||
{
|
{
|
||||||
|
@ -65,8 +65,8 @@
|
|||||||
* on STM32F4Discovery
|
* on STM32F4Discovery
|
||||||
*
|
*
|
||||||
* Input Parameters:
|
* Input Parameters:
|
||||||
* *config - The lis3dsh instance configuration data containing the IRQ number,
|
* config - The lis3dsh instance configuration data containing
|
||||||
* device ID and interrupt handler
|
* the IRQ number, device ID and interrupt handler
|
||||||
* interrupt_handler - The interrupt handler to attach
|
* interrupt_handler - The interrupt handler to attach
|
||||||
* arg -
|
* arg -
|
||||||
*
|
*
|
||||||
@ -74,11 +74,12 @@
|
|||||||
* Zero (OK) on success; a negated errno value on failure.
|
* Zero (OK) on success; a negated errno value on failure.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config,
|
int attach_disc_lis3dsh(FAR struct lis3dsh_config_s *config,
|
||||||
xcpt_t interrupt_handler)
|
xcpt_t interrupt_handler)
|
||||||
{
|
{
|
||||||
return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false,
|
return stm32_gpiosetevent(BOARD_LIS3DSH_GPIO_EXT0, true, false, false,
|
||||||
interrupt_handler, NULL);
|
interrupt_handler, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -127,4 +128,3 @@ int board_lis3dsh_initialize(int devno, int busno)
|
|||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -211,8 +211,8 @@ static void xen1210_clear(FAR struct xen1210_config_s *state)
|
|||||||
* Name: xen1210_pwm_setup
|
* Name: xen1210_pwm_setup
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* All STM32 architectures must provide the following interface to work with
|
* All STM32 architectures must provide the following interface to
|
||||||
* examples/pwm.
|
* work with examples/pwm.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -302,7 +302,9 @@ int board_xen1210_initialize(int devno, int busno)
|
|||||||
/* Instantiate the XEN1210 driver */
|
/* Instantiate the XEN1210 driver */
|
||||||
|
|
||||||
g_xen1210config.handle =
|
g_xen1210config.handle =
|
||||||
xen1210_instantiate(dev, (FAR struct xen1210_config_s *)&g_xen1210config);
|
xen1210_instantiate(dev,
|
||||||
|
(FAR struct xen1210_config_s *)
|
||||||
|
&g_xen1210config);
|
||||||
if (!g_xen1210config.handle)
|
if (!g_xen1210config.handle)
|
||||||
{
|
{
|
||||||
snerr("ERROR: Failed to instantiate the XEN1210 driver\n");
|
snerr("ERROR: Failed to instantiate the XEN1210 driver\n");
|
||||||
|
@ -50,7 +50,7 @@
|
|||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/* Clocking *************************************************************************/
|
/* Clocking *****************************************************************/
|
||||||
|
|
||||||
/* HSI - 16 MHz RC factory-trimmed
|
/* HSI - 16 MHz RC factory-trimmed
|
||||||
* LSI - 32 KHz RC (30-60KHz, uncalibrated)
|
* LSI - 32 KHz RC (30-60KHz, uncalibrated)
|
||||||
@ -165,9 +165,10 @@
|
|||||||
# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
# define SDIO_SDXFR_CLKDIV (2 << SDIO_CLKCR_CLKDIV_SHIFT)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* LED definitions ******************************************************************/
|
/* LED definitions **********************************************************/
|
||||||
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in any
|
|
||||||
* way. The following definitions are used to access individual LEDs.
|
/* If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs
|
||||||
|
* in any way. The following definitions are used to access individual LEDs.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* LED index values for use with board_userled() */
|
/* LED index values for use with board_userled() */
|
||||||
@ -190,8 +191,9 @@
|
|||||||
#define BOARD_LED3_BIT (1 << BOARD_LED3)
|
#define BOARD_LED3_BIT (1 << BOARD_LED3)
|
||||||
#define BOARD_LED4_BIT (1 << BOARD_LED4)
|
#define BOARD_LED4_BIT (1 << BOARD_LED4)
|
||||||
|
|
||||||
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on board the
|
/* If CONFIG_ARCH_LEDs is defined, then NuttX will control the 4 LEDs on
|
||||||
* Olimex STM32-P407. The following definitions describe how NuttX controls the LEDs:
|
* board the Olimex STM32-P407. The following definitions describe how
|
||||||
|
* NuttX controls the LEDs:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define LED_STARTED 0 /* LED1 */
|
#define LED_STARTED 0 /* LED1 */
|
||||||
@ -203,7 +205,8 @@
|
|||||||
#define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */
|
#define LED_ASSERTION 6 /* LED1 + LED2 + LED3 */
|
||||||
#define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */
|
#define LED_PANIC 7 /* N/C + N/C + N/C + LED4 */
|
||||||
|
|
||||||
/* Button definitions ***************************************************************/
|
/* Button definitions *******************************************************/
|
||||||
|
|
||||||
/* The Olimex STM32-P407 supports seven buttons: */
|
/* The Olimex STM32-P407 supports seven buttons: */
|
||||||
|
|
||||||
#define BUTTON_TAMPER 0
|
#define BUTTON_TAMPER 0
|
||||||
@ -224,7 +227,7 @@
|
|||||||
#define BUTTON_DOWN_BIT (1 << BUTTON_DOWN)
|
#define BUTTON_DOWN_BIT (1 << BUTTON_DOWN)
|
||||||
#define BUTTON_CENTER_BIT (1 << BUTTON_CENTER)
|
#define BUTTON_CENTER_BIT (1 << BUTTON_CENTER)
|
||||||
|
|
||||||
/* Alternate function pin selections ************************************************/
|
/* Alternate function pin selections ****************************************/
|
||||||
|
|
||||||
/* USART3: */
|
/* USART3: */
|
||||||
|
|
||||||
@ -305,9 +308,10 @@
|
|||||||
#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2
|
#define GPIO_ETH_RMII_TXD0 GPIO_ETH_RMII_TXD0_2
|
||||||
#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2
|
#define GPIO_ETH_RMII_TXD1 GPIO_ETH_RMII_TXD1_2
|
||||||
|
|
||||||
/* DMA Channel/Stream Selections ****************************************************/
|
/* DMA Channel/Stream Selections ********************************************/
|
||||||
/* Stream selections are arbitrary for now but might become important in the future
|
|
||||||
* if we set aside more DMA channels/streams.
|
/* Stream selections are arbitrary for now but might become important in
|
||||||
|
* the future if we set aside more DMA channels/streams.
|
||||||
*
|
*
|
||||||
* SDIO DMA
|
* SDIO DMA
|
||||||
* DMAMAP_SDIO_1 = Channel 4, Stream 3
|
* DMAMAP_SDIO_1 = Channel 4, Stream 3
|
||||||
|
@ -64,8 +64,8 @@
|
|||||||
#define HAVE_ELF 1
|
#define HAVE_ELF 1
|
||||||
#define HAVE_MODSYMS 1
|
#define HAVE_MODSYMS 1
|
||||||
|
|
||||||
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO support
|
/* Can't support MMC/SD features if mountpoints are disabled or if SDIO
|
||||||
* is not enabled.
|
* support is not enabled.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_STM32_SDIO) || \
|
#if defined(CONFIG_DISABLE_MOUNTPOINT) || !defined(CONFIG_STM32_SDIO) || \
|
||||||
@ -144,6 +144,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Olimex-STM32-P407 GPIOs **************************************************/
|
/* Olimex-STM32-P407 GPIOs **************************************************/
|
||||||
|
|
||||||
/* LEDs */
|
/* LEDs */
|
||||||
|
|
||||||
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
#define GPIO_LED1 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_50MHz|\
|
||||||
@ -189,7 +190,7 @@
|
|||||||
#ifndef __ASSEMBLY__
|
#ifndef __ASSEMBLY__
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Functions
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
@ -212,25 +213,25 @@ int stm32_bringup(void);
|
|||||||
* Name: stm32_stram_configure
|
* Name: stm32_stram_configure
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Initialize to access external SRAM. SRAM will be visible at the FSMC Bank
|
* Initialize to access external SRAM. SRAM will be visible at the FSMC
|
||||||
* NOR/SRAM2 base address (0x64000000)
|
* Bank NOR/SRAM2 base address (0x64000000)
|
||||||
*
|
*
|
||||||
* General transaction rules. The requested AHB transaction data size can be 8-,
|
* General transaction rules. The requested AHB transaction data size can
|
||||||
* 16- or 32-bit wide whereas the SRAM has a fixed 16-bit data width. Some simple
|
* be 8-, 16- or 32-bit wide whereas the SRAM has a fixed 16-bit data
|
||||||
* transaction rules must be followed:
|
* width. Some simple transaction rules must be followed:
|
||||||
*
|
*
|
||||||
* Case 1: AHB transaction width and SRAM data width are equal
|
* Case 1: AHB transaction width and SRAM data width are equal
|
||||||
* There is no issue in this case.
|
* There is no issue in this case.
|
||||||
* Case 2: AHB transaction size is greater than the memory size
|
* Case 2: AHB transaction size is greater than the memory size
|
||||||
* In this case, the FSMC splits the AHB transaction into smaller consecutive
|
* In this case, the FSMC splits the AHB transaction into smaller
|
||||||
* memory accesses in order to meet the external data width.
|
* consecutive memory accesses in order to meet the external data width.
|
||||||
* Case 3: AHB transaction size is smaller than the memory size.
|
* Case 3: AHB transaction size is smaller than the memory size.
|
||||||
* SRAM supports the byte select feature.
|
* SRAM supports the byte select feature.
|
||||||
* a) FSMC allows write transactions accessing the right data through its
|
* a) FSMC allows write transactions accessing the right data through its
|
||||||
* byte lanes (NBL[1:0])
|
* byte lanes (NBL[1:0])
|
||||||
* b) Read transactions are allowed (the controller reads the entire memory
|
* b) Read transactions are allowed (the controller reads the entire
|
||||||
* word and uses the needed byte only). The NBL[1:0] are always kept low
|
* memory word and uses the needed byte only). The NBL[1:0] are always
|
||||||
* during read transactions.
|
* kept low during read transactions.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -242,8 +243,8 @@ void stm32_stram_configure(void);
|
|||||||
* Name: stm32_usb_configure
|
* Name: stm32_usb_configure
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called from stm32_boardinitialize very early in inialization to setup USB-related
|
* Called from stm32_boardinitialize very early in inialization to setup
|
||||||
* GPIO pins for the Olimex STM32 P407 board.
|
* USB-related GPIO pins for the Olimex STM32 P407 board.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
@ -255,9 +256,9 @@ void weak_function stm32_usb_configure(void);
|
|||||||
* Name: stm32_usbhost_setup
|
* Name: stm32_usbhost_setup
|
||||||
*
|
*
|
||||||
* Description:
|
* Description:
|
||||||
* Called at application startup time to initialize the USB host functionality.
|
* Called at application startup time to initialize the USB host
|
||||||
* This function will start a thread that will monitor for device connection/
|
* functionality. This function will start a thread that will monitor for
|
||||||
* disconnection events.
|
* device connection/disconnection events.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
|
@ -121,6 +121,7 @@ int stm32_bringup(void)
|
|||||||
|
|
||||||
#ifdef HAVE_MMCSD
|
#ifdef HAVE_MMCSD
|
||||||
/* Mount the SDIO-based MMC/SD block driver */
|
/* Mount the SDIO-based MMC/SD block driver */
|
||||||
|
|
||||||
/* First, get an instance of the SDIO interface */
|
/* First, get an instance of the SDIO interface */
|
||||||
|
|
||||||
sdio = sdio_initialize(MMCSD_SLOTNO);
|
sdio = sdio_initialize(MMCSD_SLOTNO);
|
||||||
@ -148,7 +149,7 @@ int stm32_bringup(void)
|
|||||||
* the slot so we are reduced to guessing.
|
* the slot so we are reduced to guessing.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
sdio_mediachange(sdio, true);
|
sdio_mediachange(sdio, true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_CAN
|
#ifdef CONFIG_CAN
|
||||||
|
@ -157,15 +157,18 @@ int stm32_bringup(void)
|
|||||||
mtd = sst25xx_initialize(spi);
|
mtd = sst25xx_initialize(spi);
|
||||||
if (!mtd)
|
if (!mtd)
|
||||||
{
|
{
|
||||||
syslog(LOG_ERR, "ERROR: Failed to bind SPI port 4 to the SPI FLASH driver\n");
|
syslog(LOG_ERR, "ERROR: Failed to bind SPI port 4 to the SPI FLASH"
|
||||||
|
" driver\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
syslog(LOG_INFO, "Successfully bound SPI port 4 to the SPI FLASH driver\n");
|
syslog(LOG_INFO, "Successfully bound SPI port 4 to the SPI FLASH"
|
||||||
|
" driver\n");
|
||||||
|
|
||||||
/* Get the geometry of the FLASH device */
|
/* Get the geometry of the FLASH device */
|
||||||
|
|
||||||
ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY, (unsigned long)((uintptr_t)&geo));
|
ret = mtd->ioctl(mtd, MTDIOC_GEOMETRY,
|
||||||
|
(unsigned long)((uintptr_t)&geo));
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
{
|
{
|
||||||
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
|
ferr("ERROR: mtd->ioctl failed: %d\n", ret);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user