mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 07:12:54 +08:00
add userled driver initialization
This commit is contained in:
committed by
Alan Carvalho de Assis
parent
7864bf4870
commit
f51d6b8c72
@@ -1150,5 +1150,4 @@ int up_putc(int ch)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif /* HAVE_UART_DEVICE && USE_SERIALDRIVER */
|
||||
|
||||
@@ -320,10 +320,9 @@
|
||||
|
||||
#define BOARD_SPI_DX USIC_DXC
|
||||
#define GPIO_SPI4_MOSI (GPIO_U2C0_DOUT0_2 | GPIO_PADA2_STRONGMEDIUM)
|
||||
#define GPIO_SPI4_MISO (GPIO_U1C0_DX0C)
|
||||
#define GPIO_SPI4_MISO (GPIO_U2C0_DX0C)
|
||||
#define GPIO_SPI4_SCLK (GPIO_U2C0_SCLKOUT_1 | GPIO_PADA2_STRONGMEDIUM)
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
****************************************************************************/
|
||||
|
||||
@@ -50,8 +50,6 @@ void xmc4_board_initialize(void)
|
||||
/* Configure on-board LEDs if LED support has been selected. */
|
||||
|
||||
board_autoled_initialize();
|
||||
#else
|
||||
board_userled_initialize();
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_XMC4_USCI_SPI
|
||||
|
||||
@@ -26,9 +26,15 @@
|
||||
|
||||
#include <debug.h>
|
||||
#include <errno.h>
|
||||
#include <nuttx/spi/spi_transfer.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#ifdef CONFIG_XMC4_USCI_SPI
|
||||
# include <nuttx/spi/spi_transfer.h>
|
||||
#endif
|
||||
#ifdef CONFIG_USERLED
|
||||
# include <nuttx/leds/userled.h>
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
@@ -61,5 +67,15 @@ int xmc4_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_USERLED
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize("/dev/userleds");
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/****************************************************************************
|
||||
* boards/arm/xmc4/xmc4500-relax/src/xmc4_spi.c
|
||||
* boards/arm/xmc4/xmc4700-relax/src/xmc4_spi.c
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
@@ -42,7 +42,7 @@
|
||||
* Name: xmc4_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the FRDM-KL25Z board.
|
||||
* Called to configure SPI chip select GPIO pins.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -186,7 +186,7 @@ void xmc4_spi4select(struct spi_dev_s *dev, uint32_t devid,
|
||||
* devid - Identifies the (logical) device
|
||||
*
|
||||
* Returned Values:
|
||||
* Bit-encoded SPI status (see include/nuttx/spi/spi.h.
|
||||
* Bit-encoded SPI status (see include/nuttx/spi/spi.h).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -238,7 +238,7 @@ uint8_t xmc4_spi4status(struct spi_dev_s *dev, uint32_t devid)
|
||||
* cmd - Determines where command or data should be selected.
|
||||
*
|
||||
* Returned Values:
|
||||
* Bit-encoded SPI status (see include/nuttx/spi/spi.h.
|
||||
* Bit-encoded SPI status (see include/nuttx/spi/spi.h).
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user