mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 16:50:55 +08:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
* Matt Thompson <matt@extent3d.com>
|
||||
*
|
||||
* References:
|
||||
* "Microchip SAMD21 datasheet"
|
||||
* "Microchip SAMD21 datasheet"
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -116,7 +116,6 @@
|
||||
|
||||
#define EIC_EXTINT_SHIFT (0) /* Bits 0-15: External interrupt n */
|
||||
#define EIC_EXTINT_MASK (0x3ffff << EIC_EXTINT_SHIFT)
|
||||
//# define EIC_EXTINT(n) ((uint32_t)(n) << EIC_EXTINT_SHIFT)
|
||||
# define EIC_EXTINT(n) (1 << (n))
|
||||
# define EIC_EXTINT_0 (1 << 0) /* Bit 0: External interrupt 0 */
|
||||
# define EIC_EXTINT_1 (1 << 1) /* Bit 1: External interrupt 1 */
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
|
||||
#define EIC_EXTINT_SHIFT (0) /* Bits 0-15: External interrupt n */
|
||||
#define EIC_EXTINT_MASK (0xffff << EIC_EXTINT_SHIFT)
|
||||
# define EIC_EXTINT(n) ((uint32_t)(n) << EIC_EXTINT_SHIFT)
|
||||
# define EIC_EXTINT(n) (1 << (n))
|
||||
# define EIC_EXTINT_0 (1 << 0) /* Bit 0: External interrupt 0 */
|
||||
# define EIC_EXTINT_1 (1 << 1) /* Bit 1: External interrupt 1 */
|
||||
# define EIC_EXTINT_2 (1 << 2) /* Bit 2: External interrupt 2 */
|
||||
|
||||
@@ -83,16 +83,16 @@ static int sam_eic_isr(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
for(bit=0;bit<SAM_IRQ_NEXTINTS;bit++)
|
||||
{
|
||||
if(intflag >> bit & 0x1)
|
||||
{
|
||||
irq_dispatch(SAM_IRQ_EXTINT0 + bit, context);
|
||||
}
|
||||
if (intflag >> bit & 0x1)
|
||||
{
|
||||
irq_dispatch(SAM_IRQ_EXTINT0 + bit, context);
|
||||
}
|
||||
}
|
||||
|
||||
/* Clear the pending interrupt flags */
|
||||
|
||||
putreg32(EIC_EXTINT_ALL, SAM_EIC_INTFLAG);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -126,7 +126,13 @@ void sam_eic_dumpregs(void)
|
||||
* Name: sam_eic_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure the external interrupt controller.
|
||||
* Initialize the external interrupt controller (EIC).
|
||||
*
|
||||
* Input Parameters:
|
||||
* gclkgen - GCLK Generator
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -139,7 +145,7 @@ int sam_eic_initialize(uint8_t gclkgen)
|
||||
regval = GCLK_CLKCTRL_ID_EIC | GCLK_CLKCTRL_GEN(gclkgen) | GCLK_CLKCTRL_CLKEN;
|
||||
putreg16(regval, SAM_GCLK_CLKCTRL);
|
||||
|
||||
putreg8(EIC_CTRLA_ENABLE, SAM_EIC_CTRLA);
|
||||
putreg8(EIC_CTRLA_ENABLE, SAM_EIC_CTRLA);
|
||||
sam_eic_syncwait();
|
||||
|
||||
irq_attach(SAM_IRQ_EIC, sam_eic_isr, NULL);
|
||||
@@ -151,12 +157,26 @@ int sam_eic_initialize(uint8_t gclkgen)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_eic_initialize
|
||||
*
|
||||
* Description:
|
||||
* Enable a external interrupt.
|
||||
*
|
||||
* Input Parameters:
|
||||
* irq - SAM_IRQ_EXTINTn IRQ to be enabled
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sam_eic_irq_enable(int irq)
|
||||
{
|
||||
uint32_t config;
|
||||
int eirq = irq - SAM_IRQ_EXTINT0;
|
||||
|
||||
config = getreg32(SAM_EIC_CONFIG0);
|
||||
config = getreg32(SAM_EIC_CONFIG0);
|
||||
config |= EIC_CONFIG0_FILTEN(eirq) | EIC_CONFIG0_SENSE_FALL(eirq);
|
||||
putreg32(config, SAM_EIC_CONFIG0);
|
||||
|
||||
@@ -165,6 +185,21 @@ int sam_eic_irq_enable(int irq)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_eic_config
|
||||
*
|
||||
* Description:
|
||||
* Configure the interrupt edge sensitivity in CONFIGn register of the EIC
|
||||
*
|
||||
* Input Parameters:
|
||||
* eirq - Pin to be configured
|
||||
* pinset - Configuration of the pin
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sam_eic_config(uint8_t eirq, port_pinset_t pinset)
|
||||
{
|
||||
uint32_t reg;
|
||||
@@ -173,18 +208,24 @@ int sam_eic_config(uint8_t eirq, port_pinset_t pinset)
|
||||
|
||||
/* Determine which of the CONFIG[0:2] registers to write to */
|
||||
|
||||
if(eirq < 8)
|
||||
if (eirq < 8)
|
||||
{
|
||||
reg = SAM_EIC_CONFIG0;
|
||||
|
||||
|
||||
val = EIC_CONFIG0_SENSE_BOTH(eirq);
|
||||
if(pinset & PORT_INT_RISING)
|
||||
val = EIC_CONFIG0_SENSE_RISE(eirq);
|
||||
if(pinset & PORT_INT_FALLING)
|
||||
val = EIC_CONFIG0_SENSE_FALL(eirq);
|
||||
if (pinset & PORT_INT_RISING)
|
||||
{
|
||||
val = EIC_CONFIG0_SENSE_RISE(eirq);
|
||||
}
|
||||
|
||||
if (pinset & PORT_INT_FALLING)
|
||||
{
|
||||
val = EIC_CONFIG0_SENSE_FALL(eirq);
|
||||
}
|
||||
|
||||
val |= EIC_CONFIG0_FILTEN(eirq);
|
||||
}
|
||||
else if(eirq < 16)
|
||||
else if (eirq < 16)
|
||||
{
|
||||
reg = SAM_EIC_CONFIG1;
|
||||
val = EIC_CONFIG1_FILTEN(eirq) | EIC_CONFIG1_SENSE_FALL(eirq);
|
||||
@@ -197,7 +238,7 @@ int sam_eic_config(uint8_t eirq, port_pinset_t pinset)
|
||||
|
||||
/* Write the new config to the CONFIGn register */
|
||||
|
||||
config = getreg32(reg);
|
||||
config = getreg32(reg);
|
||||
config |= val;
|
||||
putreg32(config, reg);
|
||||
|
||||
@@ -206,6 +247,5 @@ int sam_eic_config(uint8_t eirq, port_pinset_t pinset)
|
||||
putreg32(EIC_EXTINT(eirq), SAM_EIC_INTENSET);
|
||||
|
||||
sam_eic_dumpregs();
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -57,19 +57,7 @@
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Inline Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Data
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
#undef EXTERN
|
||||
@@ -82,14 +70,10 @@ extern "C"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_eic_configure
|
||||
* Name: sam_eic_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure the EIC
|
||||
* Initialize the EIC
|
||||
*
|
||||
* Input Parameters:
|
||||
* gclkgen - GCLK Generator
|
||||
@@ -100,6 +84,38 @@ extern "C"
|
||||
****************************************************************************/
|
||||
|
||||
int sam_eic_initialize(uint8_t gclkgen);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_eic_initialize
|
||||
*
|
||||
* Description:
|
||||
* Enable a external interrupt.
|
||||
*
|
||||
* Input Parameters:
|
||||
* irq - SAM_IRQ_EXTINTn IRQ to be enabled
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sam_eic_irq_enable(int irq);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: sam_eic_config
|
||||
*
|
||||
* Description:
|
||||
* Configure the interrupt edge sensitivity in CONFIGn register of the EIC
|
||||
*
|
||||
* Input Parameters:
|
||||
* eirq - Pin to be configured
|
||||
* pinset - Configuration of the pin
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int sam_eic_config(uint8_t eirq, port_pinset_t pinset);
|
||||
|
||||
#undef EXTERN
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* arch/arm/src/samdl/sam_port.c
|
||||
*
|
||||
* Copyright (C) 2014-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* References:
|
||||
@@ -190,13 +190,15 @@ static inline void sam_configinput(uintptr_t base, port_pinset_t pinset)
|
||||
|
||||
static inline void sam_configinterrupt(uintptr_t base, port_pinset_t pinset)
|
||||
{
|
||||
#ifdef CONFIG_SAMDL_EIC
|
||||
uint32_t func;
|
||||
uint32_t regval;
|
||||
int pin;
|
||||
|
||||
pin = (pinset & PORT_PIN_MASK) >> PORT_PIN_SHIFT;
|
||||
pin = (pinset & PORT_PIN_MASK) >> PORT_PIN_SHIFT;
|
||||
|
||||
regval = (PORT_WRCONFIG_WRPINCFG | PORT_WRCONFIG_WRPMUX | PORT_WRCONFIG_PMUXEN | PORT_WRCONFIG_INEN);
|
||||
regval = (PORT_WRCONFIG_WRPINCFG | PORT_WRCONFIG_WRPMUX |
|
||||
PORT_WRCONFIG_PMUXEN | PORT_WRCONFIG_INEN);
|
||||
regval |= PORT_WRCONFIG_PINMASK(pin);
|
||||
|
||||
func = (pinset & PORT_FUNC_MASK) >> PORT_FUNC_SHIFT;
|
||||
@@ -211,6 +213,7 @@ static inline void sam_configinterrupt(uintptr_t base, port_pinset_t pinset)
|
||||
#ifdef CONFIG_DEBUG_GPIO_INFO
|
||||
sam_dumpport(pinset, "extint");
|
||||
#endif
|
||||
#endif /* CONFIG_SAMDL_EIC */
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
@@ -552,7 +555,7 @@ int sam_dumpport(uint32_t pinset, const char *msg)
|
||||
|
||||
/* Get the base address associated with the PIO port */
|
||||
|
||||
pin = (pinset & PORT_PIN_MASK) >> PORT_PIN_SHIFT;
|
||||
pin = (pinset & PORT_PIN_MASK) >> PORT_PIN_SHIFT;
|
||||
port = (pinset & PORT_MASK) >> PORT_SHIFT;
|
||||
base = SAM_PORTN_BASE(port);
|
||||
|
||||
|
||||
@@ -2351,15 +2351,6 @@ config BOARDCTL_USBDEVCTRL
|
||||
---help---
|
||||
Enables support for the BOARDIOC_USBDEV_CONTROL boardctl() command.
|
||||
|
||||
config BOARDCTL_TSCTEST
|
||||
bool "Enable touchscreen test interfaces"
|
||||
default n
|
||||
---help---
|
||||
Enables support for the BOARDIOC_TSCTEST_SETUP and
|
||||
BOARDIOC_TSCTEST_TEARDOWN boardctl() commands. Architecture
|
||||
specific logic must provide board_tsc_setup() and
|
||||
board_tsc_teardown() interfaces.
|
||||
|
||||
config BOARDCTL_IOCTL
|
||||
bool "Board-specific boardctl() commands"
|
||||
default n
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
* and the SD card.
|
||||
* 2. UART0 cannot be used. USARTs on the COMM connector should be available.
|
||||
* 3. Parallel data is not contiguous in the PIO register
|
||||
* 4. Touchcontroller /CS pin is connected to ground (always selected).
|
||||
* 4. Touch controller /CS pin is connected to ground (always selected).
|
||||
* 5. Either PA28 or PC29 may drive PWM10
|
||||
*/
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
* Public Functions
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_bringup
|
||||
*
|
||||
* Description:
|
||||
@@ -320,23 +320,44 @@
|
||||
* CONFIG_BOARD_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
int sam_bringup(void);
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_sdinitialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize the SPI-based SD card.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_MMCSD_SPI)
|
||||
int sam_sdinitialize(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_INPUT_ADS7843E)
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_ARDUINO_DUE_SRC_ARDUNO_DUE_H */
|
||||
|
||||
@@ -118,6 +118,17 @@ int sam_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(CONFIG_ARDUINO_ITHEAD_TFT) && defined(CONFIG_SPI_BITBANG) && \
|
||||
defined(CONFIG_INPUT_ADS7843E)
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -336,13 +336,12 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -353,79 +352,42 @@ static FAR struct spi_dev_s *sam_tsc_spiinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
||||
iinfo("minor %d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Have we already initialized? Since we never uninitialize we must prevent
|
||||
* multiple initializations. This is necessary, for example, when the
|
||||
* touchscreen example is used as a built-in application in NSH and can be
|
||||
* called numerous time. It will attempt to initialize each time.
|
||||
*/
|
||||
/* Configure and enable the XPT2046 interrupt pin as an input */
|
||||
|
||||
if (!initialized)
|
||||
(void)sam_configgpio(GPIO_TSC_IRQ);
|
||||
|
||||
/* Configure the PIO interrupt */
|
||||
|
||||
sam_gpioirq(SAM_TSC_IRQ);
|
||||
|
||||
/* Get an instance of the SPI interface for the touchscreen chip select */
|
||||
|
||||
dev = sam_tsc_spiinitialize();
|
||||
if (!dev)
|
||||
{
|
||||
/* Configure and enable the XPT2046 interrupt pin as an input */
|
||||
ierr("ERROR: Failed to initialize bit bang SPI\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
(void)sam_configgpio(GPIO_TSC_IRQ);
|
||||
/* Initialize and register the SPI touschscreen device */
|
||||
|
||||
/* Configure the PIO interrupt */
|
||||
|
||||
sam_gpioirq(SAM_TSC_IRQ);
|
||||
|
||||
/* Get an instance of the SPI interface for the touchscreen chip select */
|
||||
|
||||
dev = sam_tsc_spiinitialize();
|
||||
if (!dev)
|
||||
{
|
||||
ierr("ERROR: Failed to initialize bit bang SPI\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Initialize and register the SPI touschscreen device */
|
||||
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device\n");
|
||||
/* up_spiuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Now we are initialized */
|
||||
|
||||
initialized = true;
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device\n");
|
||||
/* up_spiuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen XPT2046 device. It will
|
||||
* continue to run and process touch interrupts in the background.
|
||||
*/
|
||||
}
|
||||
|
||||
#endif /* CONFIG_ARDUINO_ITHEAD_TFT && CONFIG_SPI_BITBANG && CONFIG_INPUT_ADS7843E */
|
||||
|
||||
@@ -401,35 +401,6 @@ int boardctl(unsigned int cmd, uintptr_t arg)
|
||||
break;
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_TSCTEST
|
||||
/* CMD: BOARDIOC_TSCTEST_SETUP
|
||||
* DESCRIPTION: Touchscreen controller test configuration
|
||||
* ARG: Touch controller device minor number
|
||||
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
|
||||
* DEPENDENCIES: Board logic must provide board_tsc_setup()
|
||||
*/
|
||||
|
||||
case BOARDIOC_TSCTEST_SETUP:
|
||||
{
|
||||
ret = board_tsc_setup((int)arg);
|
||||
}
|
||||
break;
|
||||
|
||||
/* CMD: BOARDIOC_TSCTEST_TEARDOWN
|
||||
* DESCRIPTION: Touchscreen controller test configuration
|
||||
* ARG: None
|
||||
* CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_TSCTEST
|
||||
* DEPENDENCIES: Board logic must provide board_tsc_teardown()
|
||||
*/
|
||||
|
||||
case BOARDIOC_TSCTEST_TEARDOWN:
|
||||
{
|
||||
board_tsc_teardown();
|
||||
ret = OK;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
default:
|
||||
{
|
||||
#ifdef CONFIG_BOARDCTL_IOCTL
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/hymini-stm32v/src/hymini-stm32v.h
|
||||
*
|
||||
* Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
* Laurent Latil <laurent@latil.nom.fr>
|
||||
*
|
||||
@@ -122,7 +122,7 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
extern void weak_function stm32_spidev_initialize(void);
|
||||
void weak_function stm32_spidev_initialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_usbinitialize
|
||||
@@ -132,7 +132,28 @@ extern void weak_function stm32_spidev_initialize(void);
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
extern void weak_function stm32_usbinitialize(void);
|
||||
void weak_function stm32_usbinitialize(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_HYMINI_STM32V_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/hymini-stm32v/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2009, 2011, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009, 2011, 2016-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -170,10 +170,11 @@ static int nsh_cdinterrupt(int irq, FAR void *context, FAR void *arg)
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
int ret;
|
||||
|
||||
#ifdef NSH_HAVEMMCSD
|
||||
/* Card detect */
|
||||
|
||||
bool cd_status;
|
||||
|
||||
/* Configure the card detect GPIO */
|
||||
@@ -220,5 +221,17 @@ int board_app_initialize(uintptr_t arg)
|
||||
|
||||
sdio_mediachange(g_sdiodev, cd_status);
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
#include "hymini-stm32v.h"
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Defintiions
|
||||
* Pre-processor Definitions
|
||||
************************************************************************************/
|
||||
|
||||
#if !defined(CONFIG_STM32_SPI1)
|
||||
@@ -136,13 +136,12 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -153,7 +152,7 @@ static bool hymini_ts_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
|
||||
@@ -172,24 +171,3 @@ int board_tsc_setup(int minor)
|
||||
|
||||
return ads7843e_register(dev, &ts_cfg, minor);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* FIXME What can/should we do here ? */
|
||||
}
|
||||
|
||||
@@ -264,7 +264,6 @@ Configurations
|
||||
|
||||
$ telnet fc00::42
|
||||
|
||||
|
||||
nsh:
|
||||
|
||||
Configures the NuttShell (nsh) application located at examples/nsh.
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
# CONFIG_ARCH_FPU is not set
|
||||
# CONFIG_EXAMPLES_TOUCHSCREEN_ARCHINIT is not set
|
||||
CONFIG_ARCH_BOARD_LPCXPRESSO_LPC54628=y
|
||||
CONFIG_ARCH_BOARD="lpcxpresso-lpc54628"
|
||||
CONFIG_ARCH_CHIP_LPC54628=y
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
# CONFIG_NX_DISABLE_16BPP is not set
|
||||
# CONFIG_NXFONTS_DISABLE_16BPP is not set
|
||||
# CONFIG_NXTK_DEFAULT_BORDERCOLORS is not set
|
||||
# CONFIG_NXWM_TOUCHSCREEN_DEVINIT is not set
|
||||
CONFIG_ARCH_BOARD_LPCXPRESSO_LPC54628=y
|
||||
CONFIG_ARCH_BOARD="lpcxpresso-lpc54628"
|
||||
CONFIG_ARCH_CHIP_LPC54628=y
|
||||
@@ -11,7 +10,6 @@ CONFIG_ARCH_INTERRUPTSTACK=2048
|
||||
CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH_STDARG_H=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_BOARD_INITIALIZE=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=21082
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_FAT_LCNAMES=y
|
||||
|
||||
@@ -245,25 +245,4 @@ int lpc54_ft5x06_register(void)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup and board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Stubs for expected interfaces. This implementation does not permit the
|
||||
* application to mange the touch screen controller.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_BOARDCTL_TSCTEST
|
||||
int board_tsc_setup(int minor)
|
||||
{
|
||||
DEBUGASSERT(minor == 0);
|
||||
return OK;
|
||||
}
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* HAVE_FT5x06*/
|
||||
|
||||
@@ -45,6 +45,7 @@ CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LCD_MIO283QT2=y
|
||||
CONFIG_LCD=y
|
||||
CONFIG_LIBC_PERROR_STDOUT=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_LIBC_STRERROR=y
|
||||
CONFIG_M25P_MANUFACTURER=0x1C
|
||||
CONFIG_M25P_MEMORY_TYPE=0x31
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************************************
|
||||
* configs/mikroe-stm32f4/src/mikroe-stm32f4.h
|
||||
*
|
||||
* Copyright (C) 2011-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2011-2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -218,7 +218,7 @@ void weak_function stm32_spidev_initialize(void);
|
||||
* Name: stm32_usbinitialize
|
||||
*
|
||||
* Description:
|
||||
* Called from stm32_usbinitialize very early in inialization to setup USB-related
|
||||
* Called from stm32_usbinitialize very early in initialization to setup USB-related
|
||||
* GPIO pins for the Mikroe-stm32f4 board.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
@@ -227,13 +227,13 @@ void weak_function stm32_spidev_initialize(void);
|
||||
void weak_function stm32_usbinitialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_pwm_setup
|
||||
*
|
||||
* Description:
|
||||
* Initialize PWM and register the PWM device.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
int stm32_pwm_setup(void);
|
||||
@@ -252,13 +252,13 @@ int stm32_pwm_setup(void);
|
||||
# error "The Mikroe-STM32F4 board does not support HOST OTG, only device!"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_qencoder_initialize
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register a qencoder
|
||||
*
|
||||
****************************************************************************/
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SENSORS_QENCODER
|
||||
int stm32_qencoder_initialize(FAR const char *devpath, int timer);
|
||||
@@ -277,6 +277,26 @@ int stm32_qencoder_initialize(FAR const char *devpath, int timer);
|
||||
void stm32_lcdinitialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen device. This
|
||||
* function will register the driver as /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to indicate the
|
||||
* nature of the failure.
|
||||
*
|
||||
****************************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int stm32_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/****************************************************************************************************
|
||||
* Name: up_vs1053initialize
|
||||
*
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/mikroe_stm32f4/src/stm32_appinit.c
|
||||
*
|
||||
* Copyright (C) 2012-2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012-2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -350,6 +350,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = stm32_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: stm32_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_PWM
|
||||
/* Initialize PWM and register the PWM device. */
|
||||
|
||||
|
||||
@@ -1474,13 +1474,12 @@ errout:
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: stm32_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -1491,7 +1490,7 @@ errout:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int stm32_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
@@ -1583,25 +1582,4 @@ errout_with_priv:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* Need to unregister the /dev/inputN device here. */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT */
|
||||
|
||||
@@ -45,7 +45,9 @@
|
||||
# include <stdint.h>
|
||||
#endif
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <stm32l4.h>
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Pre-processor Definitions
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
#define GPIO_LD2 \
|
||||
(GPIO_PORTA | GPIO_PIN5 | GPIO_OUTPUT_CLEAR | GPIO_OUTPUT | GPIO_PULLUP | \
|
||||
GPIO_SPEED_50MHz)
|
||||
#define LED_DRIVER_PATH "/dev/userleds"
|
||||
|
||||
/* Buttons
|
||||
*
|
||||
|
||||
@@ -51,6 +51,7 @@
|
||||
#include <nuttx/board.h>
|
||||
#include <nuttx/sdio.h>
|
||||
#include <nuttx/mmcsd.h>
|
||||
#include <nuttx/leds/userled.h>
|
||||
|
||||
#include <stm32l4.h>
|
||||
#include <stm32l4_uart.h>
|
||||
@@ -135,6 +136,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if !defined(CONFIG_ARCH_LEDS) && defined(CONFIG_USERLED_LOWER)
|
||||
/* Register the LED driver */
|
||||
|
||||
ret = userled_lower_initialize(LED_DRIVER_PATH);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: userled_lower_initialize() failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_RTC_DRIVER
|
||||
/* Instantiate the STM32L4 lower-half RTC driver */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/olimex-lpc1766stk/src/lpc1766stk.h
|
||||
*
|
||||
* Copyright (C) 2010-2011, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010-2011, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -272,6 +272,27 @@ void weak_function lpc1766stk_sspdev_initialize(void);
|
||||
int lpc1766stk_can_setup(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc1766stk_hidmouse_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the HID mouse
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_USBHOST_HIDMOUSE
|
||||
int lpc1766stk_hidmouse_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* _CONFIGS_OLIMEX_LPC1766STK_SRC_LPC1766STK_H */
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/olimex-lpc1766stk/src/lpc17_appinit.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -362,6 +362,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
syslog(LOG_ERR, "ERROR: Failed to initialize USB host: %d\n", ret);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_USBHOST_HIDMOUSE
|
||||
/* Initialize the HID Mouse class */
|
||||
|
||||
ret = lpc1766stk_hidmouse_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: lpc1766stk_hidmouse_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_CAN
|
||||
/* Initialize CAN and register the CAN driver. */
|
||||
|
||||
|
||||
@@ -71,17 +71,15 @@
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: lpc1766stk_hidmouse_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this
|
||||
* function. This function is called by application-specific, setup logic
|
||||
* to configure the USB HID mouse driver that emulates a touchscreen
|
||||
* device. This function will register the driver as /dev/mouseN where N
|
||||
* is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the HID
|
||||
* mouse device. This function will register the driver as /dev/inputN
|
||||
* where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The mouse device minor number
|
||||
* minor - The mouse device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
@@ -89,7 +87,7 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int lpc1766stk_hidmouse_setup(int minor)
|
||||
{
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
@@ -132,27 +130,4 @@ int board_tsc_setup(int minor)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the USB mouse driver. It will continue
|
||||
* to run and process touch interrupts in the background.
|
||||
*/
|
||||
}
|
||||
|
||||
#endif /* CONFIG_USBHOST_HIDMOUSE */
|
||||
|
||||
@@ -48,7 +48,7 @@ CONFIG_I2C=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=300
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_SENDFILE_BUFSIZE=0
|
||||
CONFIG_MAX_TASKS=12
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_SMALL=y
|
||||
CONFIG_NAME_MAX=8
|
||||
|
||||
@@ -66,7 +66,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=300
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_SENDFILE_BUFSIZE=0
|
||||
CONFIG_MAX_TASKS=12
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_SMALL=y
|
||||
CONFIG_MMCSD=y
|
||||
|
||||
@@ -54,7 +54,7 @@ CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_IDLETHREAD_STACKSIZE=300
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_SENDFILE_BUFSIZE=0
|
||||
CONFIG_MAX_TASKS=12
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_SMALL=y
|
||||
CONFIG_MMCSD=y
|
||||
|
||||
@@ -89,6 +89,6 @@ int board_app_initialize(uintptr_t arg)
|
||||
#else
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
return lpc17_bringup();
|
||||
return open1788_bringup();
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -137,6 +137,6 @@ void board_initialize(void)
|
||||
{
|
||||
/* Perform board-specific initialization */
|
||||
|
||||
(void)lpc17_bringup();
|
||||
(void)open1788_bringup();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -245,12 +245,11 @@ static int nsh_sdinitialize(void)
|
||||
|
||||
lpc17_configgpio(GPIO_SD_CD);
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD_CDINT
|
||||
/* Attach an interrupt handler to get notifications when a card is
|
||||
* inserted or deleted.
|
||||
*/
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD_CDINT
|
||||
|
||||
(void)irq_attach(LPC17_IRQ_P0p13, nsh_cdinterrupt, NULL);
|
||||
up_enable_irq(LPC17_IRQ_P0p13);
|
||||
|
||||
@@ -361,7 +360,7 @@ static int nsh_usbhostinitialize(void)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: lpc17_bringup
|
||||
* Name: open1788_bringup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture-specific initialization
|
||||
@@ -374,7 +373,7 @@ static int nsh_usbhostinitialize(void)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int lpc17_bringup(void)
|
||||
int open1788_bringup(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -398,6 +397,16 @@ int lpc17_bringup(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = open1788_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: open1788_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_OPEN1788_DJOYSTICK
|
||||
/* Initialize and register the joystick driver */
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/************************************************************************************
|
||||
* configs/open1788/src/lpc17_touchscreen.c
|
||||
* arch/arm/src/board/lpc17_touchscreen.c
|
||||
*
|
||||
* Copyright (C) 2013 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
@@ -255,13 +254,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: open1788_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this
|
||||
* function. This function is called by application-specific, setup logic
|
||||
* to configure the touchscreen device. This function will register the
|
||||
* driver as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -272,76 +270,45 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int open1788_tsc_setup(int minor)
|
||||
{
|
||||
static bool initialized = false;
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
|
||||
iinfo("initialized:%d minor:%d\n", initialized, minor);
|
||||
iinfo("minor:%d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Since there is no uninitialized logic, this initialization can be
|
||||
* performed only one time.
|
||||
*/
|
||||
/* Configure and enable the XPT2046 PENIRQ pin as an interrupting input. */
|
||||
|
||||
if (!initialized)
|
||||
{
|
||||
/* Configure and enable the XPT2046 PENIRQ pin as an interrupting input. */
|
||||
(void)lpc17_configgpio(GPIO_TC_PENIRQ);
|
||||
|
||||
(void)lpc17_configgpio(GPIO_TC_PENIRQ);
|
||||
|
||||
/* Configure the XPT2046 BUSY pin as a normal input. */
|
||||
/* Configure the XPT2046 BUSY pin as a normal input. */
|
||||
|
||||
#ifndef XPT2046_NO_BUSY
|
||||
(void)lpc17_configgpio(GPIO_TC_BUSY);
|
||||
(void)lpc17_configgpio(GPIO_TC_BUSY);
|
||||
#endif
|
||||
|
||||
/* Get an instance of the SPI interface */
|
||||
/* Get an instance of the SPI interface */
|
||||
|
||||
dev = lpc17_sspbus_initialize(CONFIG_ADS7843E_SPIDEV);
|
||||
if (!dev)
|
||||
{
|
||||
ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
dev = lpc17_sspbus_initialize(CONFIG_ADS7843E_SPIDEV);
|
||||
if (!dev)
|
||||
{
|
||||
ierr("ERROR: Failed to initialize SPI bus %d\n", CONFIG_ADS7843E_SPIDEV);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/* Initialize and register the SPI touchscreen device */
|
||||
/* Initialize and register the SPI touchscreen device */
|
||||
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device minor=%d\n",
|
||||
CONFIG_ADS7843E_DEVMINOR);
|
||||
/* up_spiuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
ret = ads7843e_register(dev, &g_tscinfo, CONFIG_ADS7843E_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device minor=%d\n",
|
||||
CONFIG_ADS7843E_DEVMINOR);
|
||||
/* up_spiuninitialize(dev); */
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen XPT2046 device yet */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT_ADS7843E */
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* configs/open1788/src/open1788.h
|
||||
* arch/arm/src/board/open1788.n
|
||||
*
|
||||
* Copyright (C) 2013, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -162,7 +162,7 @@
|
||||
************************************************************************************/
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc17_bringup
|
||||
* Name: open1788_bringup
|
||||
*
|
||||
* Description:
|
||||
* Perform architecture-specific initialization
|
||||
@@ -175,7 +175,7 @@
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
int lpc17_bringup(void);
|
||||
int open1788_bringup(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: open1788_sspdev_initialize
|
||||
@@ -237,13 +237,34 @@ void open1788_nand_initialize(void);
|
||||
void open1788_lcd_initialize(void);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: open1788_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int open1788_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: lpc17_djoy_initialization
|
||||
*
|
||||
* Description:
|
||||
* Initialize and register the discrete joystick driver
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef CONFIG_OPEN1788_DJOYSTICK
|
||||
int lpc17_djoy_initialization(void);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/pic32mx7mmb/src/pic32_bringup.c
|
||||
*
|
||||
* Copyright (C) 2012, 2016-2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2016-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -407,5 +407,15 @@ int pic32mx_bringup(void)
|
||||
ret = nsh_usbdevinitialize();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = pic32mx_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: pic32mx_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1343,13 +1343,12 @@ errout:
|
||||
************************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: pic32mx_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -1360,7 +1359,7 @@ errout:
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int pic32mx_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct tc_dev_s *priv;
|
||||
char devname[DEV_NAMELEN];
|
||||
@@ -1435,25 +1434,4 @@ errout_with_priv:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* Need to unregister the /dev/inputN device here. */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* configs/pic32mx7mmb/src/pic32mx7mmb.h
|
||||
*
|
||||
* Copyright (C) 2012, 2017 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2012, 2017-2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -119,33 +119,33 @@ extern "C" {
|
||||
#define EXTERN extern
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_spidev_initialize
|
||||
*
|
||||
* Description:
|
||||
* Called to configure SPI chip select GPIO pins for the Mikroelektronika PIC32MX7
|
||||
* MMB board.
|
||||
* Called to configure SPI chip select GPIO pins for the Mikroelektronika
|
||||
* PIC32MX7 MMB board.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_PIC32MX_SPI1) || defined(CONFIG_PIC32MX_SPI2) || \
|
||||
defined(CONFIG_PIC32MX_SPI3) || defined(CONFIG_PIC32MX_SPI4)
|
||||
void weak_function pic32mx_spidev_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_led_initialize
|
||||
*
|
||||
* Description:
|
||||
* Configure on-board LEDs if LED support has been selected.
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_ARCH_LEDS
|
||||
void pic32mx_led_initialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_bringup
|
||||
*
|
||||
* Description:
|
||||
@@ -157,7 +157,7 @@ void pic32mx_led_initialize(void);
|
||||
* CONFIG_BOARD_INITIALIZE=y && CONFIG_LIB_BOARDCTL=y :
|
||||
* Called from the NSH library
|
||||
*
|
||||
************************************************************************************/
|
||||
****************************************************************************/
|
||||
|
||||
int pic32mx_bringup(void);
|
||||
|
||||
@@ -173,6 +173,27 @@ int pic32mx_bringup(void);
|
||||
|
||||
void pic32mx_lcdinitialize(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: pic32mx_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is
|
||||
* returned to indicate the nature of the failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
int pic32mx_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#undef EXTERN
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7M_OABI_TOOLCHAIN=y
|
||||
CONFIG_ARMV7M_TOOLCHAIN_BUILDROOT=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=8720
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_CXX_NEWLONG=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_HAVE_CXX=y
|
||||
@@ -29,6 +28,7 @@ CONFIG_INPUT=y
|
||||
CONFIG_LCD_MAXCONTRAST=1
|
||||
CONFIG_LCD_MAXPOWER=31
|
||||
CONFIG_LCD=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
CONFIG_MAX_WDOGPARMS=2
|
||||
CONFIG_MM_REGIONS=2
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sam3u-ek/src/sam3u-ek.h
|
||||
*
|
||||
* Copyright (C) 2009-2011, 2013 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2009-2011, 2013, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -263,5 +263,26 @@ bool sam_writeprotected(unsigned char slot);
|
||||
# define sam_writeprotected(slot) (false)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_SAM3U_EK_SRC_SAM3U_EK_H */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sam3u-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2010, 2013, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2010, 2013, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -128,9 +128,10 @@
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
int ret;
|
||||
|
||||
#ifdef NSH_HAVE_MMCSD
|
||||
FAR struct sdio_dev_s *sdio;
|
||||
int ret;
|
||||
|
||||
/* Mount the SDIO-based MMC/SD block driver */
|
||||
/* First, get an instance of the SDIO interface */
|
||||
@@ -164,5 +165,17 @@ int board_app_initialize(uintptr_t arg)
|
||||
|
||||
sdio_mediachange(sdio, sam_cardinserted(0));
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -216,13 +216,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -233,7 +232,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
@@ -272,26 +271,4 @@ int board_tsc_setup(int minor)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen ADS7843E device yet */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT_ADS7843E */
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LCD_MAXCONTRAST=1
|
||||
CONFIG_LCD_MAXPOWER=64
|
||||
CONFIG_LCD=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBM=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sam4e-ek/src/sam4e-ek.h
|
||||
*
|
||||
* Copyright (C) 2014 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -440,14 +440,14 @@ bool sam_writeprotected(int slotno);
|
||||
# define sam_writeprotected(slotno) (false)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
/************************************************************************************
|
||||
* Name: sam_at25_automount
|
||||
*
|
||||
* Description:
|
||||
* Initialize, configure, and mount the AT25 serial FLASH. The FLASH will
|
||||
* be mounted at /dev/at25.
|
||||
*
|
||||
****************************************************************************/
|
||||
************************************************************************************/
|
||||
|
||||
#ifdef HAVE_AT25
|
||||
int sam_at25_automount(int minor);
|
||||
@@ -455,5 +455,26 @@ int sam_at25_automount(int minor);
|
||||
# define sam_at25_automount(minor) (-ENOSYS)
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
#endif /* __CONFIGS_SAM4E_EK_SRC_SAM4E_EK_H */
|
||||
|
||||
@@ -213,13 +213,12 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* configure the touchscreen device. This function will register the driver
|
||||
* as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -230,7 +229,7 @@ static bool tsc_pendown(FAR struct ads7843e_config_s *state)
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
FAR struct spi_dev_s *dev;
|
||||
int ret;
|
||||
@@ -269,25 +268,4 @@ int board_tsc_setup(int minor)
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen ADS7843E device yet */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT && CONFIG_INPUT_ADS7843E */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sam4e-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2014, 2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2014, 2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -89,9 +89,7 @@
|
||||
|
||||
int board_app_initialize(uintptr_t arg)
|
||||
{
|
||||
#if defined(HAVE_AT25) || defined(HAVE_HSMCI) || defined(HAVE_USBMONITOR)
|
||||
int ret;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_AT25
|
||||
/* Initialize the AT25 driver */
|
||||
@@ -115,6 +113,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_INPUT_ADS7843E
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_USBMONITOR
|
||||
/* Start the USB Monitor */
|
||||
|
||||
@@ -126,5 +134,6 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
UNUSED(ret);
|
||||
return OK;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ CONFIG_ARCH_STACKDUMP=y
|
||||
CONFIG_ARCH="arm"
|
||||
CONFIG_ARMV7A_TOOLCHAIN_CODESOURCERYW=y
|
||||
CONFIG_BOARD_LOOPSPERMSEC=49341
|
||||
CONFIG_BOARDCTL_TSCTEST=y
|
||||
CONFIG_BUILTIN=y
|
||||
CONFIG_DISABLE_POLL=y
|
||||
CONFIG_FLASH_SIZE=134217728
|
||||
@@ -23,6 +22,7 @@ CONFIG_HAVE_CXX=y
|
||||
CONFIG_HAVE_CXXINITIALIZE=y
|
||||
CONFIG_HOST_WINDOWS=y
|
||||
CONFIG_INTELHEX_BINARY=y
|
||||
CONFIG_LIB_BOARDCTL=y
|
||||
CONFIG_LIBC_FLOATINGPOINT=y
|
||||
CONFIG_LIBM=y
|
||||
CONFIG_MAX_TASKS=16
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* config/sama5d3x-ek/src/sam_appinit.c
|
||||
*
|
||||
* Copyright (C) 2013-2016 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2016, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -173,6 +173,16 @@ int board_app_initialize(uintptr_t arg)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_SAMA5_TSD
|
||||
/* Initialize the touchscreen */
|
||||
|
||||
ret = sam_tsc_setup(0);
|
||||
if (ret < 0)
|
||||
{
|
||||
syslog(LOG_ERR, "ERROR: sam_tsc_setup failed: %d\n", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_WM8904
|
||||
/* Configure WM8904 audio */
|
||||
|
||||
|
||||
@@ -64,34 +64,17 @@
|
||||
# define CONFIG_SAMA5D3xEK_TSD_DEVMINOR 0
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Private Types
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Function Prototypes
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Private Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_setup
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this
|
||||
* function. This function is called by application-specific, setup logic
|
||||
* to configure the touchscreen device. This function will register the
|
||||
* driver as /dev/inputN where N is the minor device number.
|
||||
* This function is called by board-bringup logic to configure the
|
||||
* touchscreen device. This function will register the driver as
|
||||
* /dev/inputN where N is the minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
@@ -102,65 +85,34 @@
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
int board_tsc_setup(int minor)
|
||||
int sam_tsc_setup(int minor)
|
||||
{
|
||||
struct sam_adc_s *adc;
|
||||
static bool initialized = false;
|
||||
int ret;
|
||||
|
||||
iinfo("initialized:%d minor:%d\n", initialized, minor);
|
||||
iinfo("minor:%d\n", minor);
|
||||
DEBUGASSERT(minor == 0);
|
||||
|
||||
/* Since there is no uninitialized logic, this initialization can be
|
||||
* performed only one time.
|
||||
*/
|
||||
/* Initialize the ADC driver */
|
||||
|
||||
if (!initialized)
|
||||
adc = sam_adc_initialize();
|
||||
if (!adc)
|
||||
{
|
||||
/* Initialize the ADC driver */
|
||||
ierr("ERROR: Failed to initialize the ADC driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
adc = sam_adc_initialize();
|
||||
if (!adc)
|
||||
{
|
||||
ierr("ERROR: Failed to initialize the ADC driver\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
/* Initialize and register the SPI touchscreen device */
|
||||
|
||||
/* Initialize and register the SPI touchscreen device */
|
||||
|
||||
ret = sam_tsd_register(adc, CONFIG_SAMA5D3xEK_TSD_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device /dev/input%d: %d\n",
|
||||
CONFIG_SAMA5D3xEK_TSD_DEVMINOR, ret);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
initialized = true;
|
||||
ret = sam_tsd_register(adc, CONFIG_SAMA5D3xEK_TSD_DEVMINOR);
|
||||
if (ret < 0)
|
||||
{
|
||||
ierr("ERROR: Failed to register touchscreen device /dev/input%d: %d\n",
|
||||
CONFIG_SAMA5D3xEK_TSD_DEVMINOR, ret);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_tsc_teardown
|
||||
*
|
||||
* Description:
|
||||
* Each board that supports a touchscreen device must provide this function.
|
||||
* This function is called by application-specific, setup logic to
|
||||
* uninitialize the touchscreen device.
|
||||
*
|
||||
* Input Parameters:
|
||||
* None
|
||||
*
|
||||
* Returned Value:
|
||||
* None.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
void board_tsc_teardown(void)
|
||||
{
|
||||
/* No support for un-initializing the touchscreen yet */
|
||||
}
|
||||
|
||||
#endif /* CONFIG_INPUT_ADS7843E */
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/************************************************************************************
|
||||
* configs/sama5d3x-ek/src/sama5d3x-ek.h
|
||||
*
|
||||
* Copyright (C) 2013-2015 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2013-2015, 2018 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -833,6 +833,27 @@ int sam_usbhost_initialize(void);
|
||||
void weak_function sam_netinitialize(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_tsc_setup
|
||||
*
|
||||
* Description:
|
||||
* This function is called by board-bringup logic to configure the touchscreen
|
||||
* device. This function will register the driver as /dev/inputN where N is the
|
||||
* minor device number.
|
||||
*
|
||||
* Input Parameters:
|
||||
* minor - The input device minor number
|
||||
*
|
||||
* Returned Value:
|
||||
* Zero is returned on success. Otherwise, a negated errno value is returned to
|
||||
* indicate the nature of the failure.
|
||||
*
|
||||
***********************************************************************************/
|
||||
|
||||
#ifdef CONFIG_SAMA5_TSD
|
||||
int sam_tsc_setup(int minor);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: sam_pwm_setup
|
||||
*
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user