mirror of
https://github.com/apache/nuttx.git
synced 2026-06-05 15:58:59 +08:00
SAMA5D2-XULT: Add support for the single on-board button
This commit is contained in:
@@ -579,16 +579,16 @@ Buttons and LEDs
|
||||
|
||||
Buttons
|
||||
-------
|
||||
A single button, PB_USER1 (PB2), is available on the SAMA5D2-XULT
|
||||
A single button, PB_USER1 (PB6), is available on the SAMA5D2-XULT
|
||||
|
||||
------------------------------ ------------------- -------------------------
|
||||
SAMA5D2 PIO SIGNAL USAGE
|
||||
------------------------------ ------------------- -------------------------
|
||||
PE13/A13/TIOB1/PWML2 PB_USER1_PE13 PB_USER1
|
||||
PB6 USER_PB_PB6 PB_USER push button
|
||||
------------------------------ ------------------- -------------------------
|
||||
|
||||
Closing JP2 will bring PE13 to ground so 1) PE13 should have a weak pull-up,
|
||||
and 2) when PB2 is pressed, a low value will be senses.
|
||||
Closing PB_USER will bring PB6 to ground so 1) PB6 should have a weak pull-up,
|
||||
and 2) when PB_USER is pressed, a low value will be senses.
|
||||
|
||||
Support for pollable buttons is enabled with:
|
||||
|
||||
|
||||
@@ -159,16 +159,16 @@
|
||||
*/
|
||||
|
||||
/* Button definitions ***************************************************************/
|
||||
/* A single button, PB_USER1 (PB2), is available on the SAMA5D4-EK:
|
||||
/* A single button, PB_USER (PB6), is available on the SAMA5D2-XULT
|
||||
*
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
* SAMA5D4 PIO SIGNAL USAGE
|
||||
* SAMA5D2 PIO SIGNAL USAGE
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
* PE13/A13/TIOB1/PWML2 PB_USER1_PE13 PB_USER1
|
||||
* PB6 USER_PB_PB6 PB_USER push button
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
*
|
||||
* Closing JP2 will bring PE13 to ground so 1) PE13 should have a weak pull-up,
|
||||
* and 2) when PB2 is pressed, a low value will be senses.
|
||||
* Closing PB_USER will bring PB6 to ground so 1) PB6 should have a weak pull-up,
|
||||
* and 2) when PB_USER is pressed, a low value will be senses.
|
||||
*/
|
||||
|
||||
#define BUTTON_USER 0
|
||||
@@ -176,61 +176,6 @@
|
||||
|
||||
#define BUTTON_USER_BIT (1 << BUTTON_USER)
|
||||
|
||||
/* LCD Interface, Geometry and Timing ***********************************************/
|
||||
/* This configuration applies only to the TM7000 LCD/Touchscreen module. Other LCDs
|
||||
* will require changes.
|
||||
*
|
||||
* NOTE: The TM7000 user manual claims that the hardware interface is 18-bit RGB666.
|
||||
* If you select that, you will get a very pink display (because the upper, "red"
|
||||
* bits floating high). By trial and error, the 24-bit select was found to produce
|
||||
* the correct color output.
|
||||
*
|
||||
* NOTE: Timings come from the smaller SAMA5D3x-EK LCD and have not been optimized
|
||||
* for this display.
|
||||
*/
|
||||
|
||||
#define BOARD_LCDC_OUTPUT_BPP 24 /* Output format to H/W is 24 bpp RGB888 */
|
||||
#define BOARD_LCDC_WIDTH 800 /* Display width (pixels) */
|
||||
#define BOARD_LCDC_HEIGHT 480 /* Display height (rows) */
|
||||
#define BOARD_LCDC_MCK_MUL2 1 /* Source clock is 2*Mck (vs Mck) */
|
||||
#define BOARD_LCDC_PIXCLK_INV 1 /* Invert pixel clock, use falling edge */
|
||||
#define BOARD_LCDC_GUARDTIME 9 /* Guard time (frames) */
|
||||
#define BOARD_LCDC_VSPW 2 /* Vertical pulse width (lines) */
|
||||
#define BOARD_LCDC_HSPW 128 /* Horizontal pulse width (LCDDOTCLK) */
|
||||
#define BOARD_LCDC_VFPW 37 /* Vertical front porch (lines) */
|
||||
#define BOARD_LCDC_VBPW 8 /* Vertical back porch (lines) */
|
||||
#define BOARD_LCDC_HFPW 168 /* Horizontal front porch (LCDDOTCLK) */
|
||||
#define BOARD_LCDC_HBPW 88 /* Horizontal back porch (LCDDOTCLK) */
|
||||
|
||||
/* Pixel clock rate in Hz (HS period * VS period * BOARD_LCDC_FRAMERATE). */
|
||||
|
||||
#define BOARD_LCDC_FRAMERATE 40 /* Frame rate in Hz */
|
||||
#define BOARD_LCDC_HSPERIOD \
|
||||
(BOARD_LCDC_HSPW + BOARD_LCDC_HBPW + BOARD_LCDC_WIDTH + BOARD_LCDC_HFPW)
|
||||
#define BOARD_LCDC_VSPERIOD \
|
||||
(BOARD_LCDC_VSPW + BOARD_LCDC_VBPW + BOARD_LCDC_HEIGHT + BOARD_LCDC_VFPW)
|
||||
#define BOARD_LCDC_PIXELCLOCK \
|
||||
(BOARD_LCDC_HSPERIOD * BOARD_LCDC_VSPERIOD * BOARD_LCDC_FRAMERATE)
|
||||
|
||||
/* Backlight prescaler value and PWM output polarity */
|
||||
|
||||
#define BOARD_LCDC_PWMPS LCDC_LCDCFG6_PWMPS_DIV1
|
||||
#define BOARD_LCDC_PWMPOL LCDC_LCDCFG6_PWMPOL
|
||||
|
||||
/* NAND *****************************************************************************/
|
||||
|
||||
/* Address for transferring command bytes to the nandflash, CLE A22*/
|
||||
|
||||
#define BOARD_EBICS3_NAND_CMDADDR 0x60400000
|
||||
|
||||
/* Address for transferring address bytes to the nandflash, ALE A21*/
|
||||
|
||||
#define BOARD_EBICS3_NAND_ADDRADDR 0x60200000
|
||||
|
||||
/* Address for transferring data bytes to the nandflash.*/
|
||||
|
||||
#define BOARD_EBICS3_NAND_DATAADDR 0x60000000
|
||||
|
||||
/* Pin disambiguation ***************************************************************/
|
||||
/* Alternative pin selections are provided with a numeric suffix like _1, _2, etc.
|
||||
* Drivers, however, will use the pin selection without the numeric suffix.
|
||||
@@ -243,31 +188,6 @@
|
||||
* The PCK logic will then automatically configure PB26 as the PCK0 pin.
|
||||
*/
|
||||
|
||||
/* SSC0 TD is provided on PB28 */
|
||||
|
||||
#define PIO_SSC0_TD PIO_SSC0_TD_2
|
||||
|
||||
/* PCK2 is provides the MCLK to the WM8904 audio CODEC via PB10 */
|
||||
|
||||
#define PIO_PMC_PCK2 PIO_PMC_PCK2_1
|
||||
|
||||
/* PCK0 and PCK1 are not currently used, but the PCK logic wants these definitions
|
||||
* anyway. The assignments here are arbitrary and will not be used (at least not
|
||||
* until we implement ISI of HDMI).
|
||||
*
|
||||
* PIO_PMC_PCK0_1: PB26 is used by I2S with the WM8904 (AUDIO_RK0_PB26)
|
||||
* PIO_PMC_PCK0_2: PD8 is the HDMI MCLK (HDMI_MCK_PD8)
|
||||
* PIO_PMC_PCK0_3: PA24 is used for the LCD backlight (LCD_PWM_PA24)
|
||||
*
|
||||
* PIO_PMC_PCK1_1: PD31 goes to the expansion interface and is not used on-board
|
||||
* (EXP_PD31).
|
||||
* PIO_PMC_PCK1_2: PC24 is used for ISI data (ISI_D5)
|
||||
* PIO_PMC_PCK1_3: PC4 is ISI_MCK_PC4, MCI0_CK_PC4, EXP_PC4
|
||||
*/
|
||||
|
||||
#define PIO_PMC_PCK0 PIO_PMC_PCK0_2
|
||||
#define PIO_PMC_PCK1 PIO_PMC_PCK1_1
|
||||
|
||||
/************************************************************************************
|
||||
* Assembly Language Macros
|
||||
************************************************************************************/
|
||||
|
||||
@@ -32,16 +32,16 @@
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
/* A single button, PB_USER1 (PB2), is available on the SAMA5D4-EK:
|
||||
/* A single button, PB_USER (PB6), is available on the SAMA5D2-XULT
|
||||
*
|
||||
* ------------------------------ ------------------- ----------------------
|
||||
* SAMA5D4 PIO SIGNAL USAGE
|
||||
* SAMA5D2 PIO SIGNAL USAGE
|
||||
* ------------------------------ ------------------- ----------------------
|
||||
* PE13/A13/TIOB1/PWML2 PB_USER1_PE13 PB_USER1
|
||||
* PB6 USER_PB_PB6 PB_USER push button
|
||||
* ------------------------------ ------------------- ----------------------
|
||||
*
|
||||
* Closing JP2 will bring PE13 to ground so 1) PE13 should have a weak
|
||||
* pull-up, and 2) when PB2 is pressed, a low value will be senses.
|
||||
* Closing PB_USER will bring PB6 to ground so 1) PB6 should have a weak
|
||||
* pull-up, and 2) when PB_USER is pressed, a low value will be senses.
|
||||
*/
|
||||
|
||||
/****************************************************************************
|
||||
@@ -72,7 +72,7 @@
|
||||
* Private Data
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SAMA5_PIOE_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
|
||||
#if defined(CONFIG_SAMA5_PIOB_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
|
||||
static xcpt_t g_irquser1;
|
||||
#endif
|
||||
|
||||
@@ -127,12 +127,12 @@ uint8_t board_buttons(void)
|
||||
*
|
||||
* Configuration Notes:
|
||||
* Configuration CONFIG_SAMA5_PIO_IRQ must be selected to enable the
|
||||
* overall PIO IRQ feature and CONFIG_SAMA5_PIOE_IRQ must be enabled to
|
||||
* overall PIO IRQ feature and CONFIG_SAMA5_PIOB_IRQ must be enabled to
|
||||
* select PIOs to support interrupts on PIOE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#if defined(CONFIG_SAMA5_PIOE_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
|
||||
#if defined(CONFIG_SAMA5_PIOB_IRQ) && defined(CONFIG_ARCH_IRQBUTTONS)
|
||||
xcpt_t board_button_irq(int id, xcpt_t irqhandler)
|
||||
{
|
||||
xcpt_t oldhandler = NULL;
|
||||
|
||||
@@ -82,21 +82,21 @@
|
||||
PIO_PORT_PIOE | PIO_PIN9)
|
||||
|
||||
/* Buttons **************************************************************************/
|
||||
/* A single button, PB_USER1 (PB2), is available on the SAMA5D4-EK:
|
||||
/* A single button, PB_USER (PB6), is available on the SAMA5D2-XULT
|
||||
*
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
* SAMA5D4 PIO SIGNAL USAGE
|
||||
* SAMA5D2 PIO SIGNAL USAGE
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
* PE13/A13/TIOB1/PWML2 PB_USER1_PE13 PB_USER1
|
||||
* PB6 USER_PB_PB6 PB_USER push button
|
||||
* ------------------------------ ------------------- -------------------------
|
||||
*
|
||||
* Closing JP2 will bring PE13 to ground so 1) PE13 should have a weak pull-up,
|
||||
* and 2) when PB2 is pressed, a low value will be senses.
|
||||
* Closing PB_USER will bring PB6 to ground so 1) PB6 should have a weak pull-up,
|
||||
* and 2) when PB_USER is pressed, a low value will be senses.
|
||||
*/
|
||||
|
||||
#define PIO_BTN_USER (PIO_INPUT | PIO_CFG_PULLUP | PIO_CFG_DEGLITCH | \
|
||||
PIO_INT_BOTHEDGES | PIO_PORT_PIOE | PIO_PIN13)
|
||||
#define IRQ_BTN_USER SAM_IRQ_PE13
|
||||
PIO_INT_BOTHEDGES | PIO_PORT_PIOB | PIO_PIN6)
|
||||
#define IRQ_BTN_USER SAM_IRQ_PB6
|
||||
|
||||
|
||||
/************************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user