From f0d95b5441834bbb610e836abb12dfe649a59224 Mon Sep 17 00:00:00 2001 From: edolomb Date: Tue, 6 Mar 2018 12:54:41 +0000 Subject: Updated NSEC board git-svn-id: https://svn.code.sf.net/p/chibios/svn2/trunk@11598 110e8d01-0319-4d1e-a829-52ad28d1bb01 --- os/hal/boards/ATSAMA5D2_XULT_NSEC/board.c | 56 ++++++++++++++++++++++++++++++- os/hal/boards/ATSAMA5D2_XULT_NSEC/board.h | 53 +++++++++++++++-------------- 2 files changed, 82 insertions(+), 27 deletions(-) (limited to 'os') diff --git a/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.c b/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.c index b548ad608..856a70a80 100644 --- a/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.c +++ b/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.c @@ -73,7 +73,54 @@ typedef struct { * @note The list is terminated by a {-1, 0, 0, 0} */ static const sama_pio_init_t sama_inits[] = { - /* RGB Led */ + /* CLASSD */ + {SAMA_PIOB, + SAMA_PIN_N(PIOB_CLASSD_R0) | SAMA_PIN_N(PIOB_CLASSD_R1) | + SAMA_PIN_N(PIOB_CLASSD_R2) | SAMA_PIN_N(PIOB_CLASSD_R3), + SAMA_PIO_FUNC_PERIPH_F, + SAMA_PIO_HIGH}, + /* User Button */ + {SAMA_PIOB, + SAMA_PIN_N(PIOB_USER_PB), + SAMA_PIO_FUNC_GPIO | SAMA_PIO_DIR_INPUT | SAMA_PIO_PUEN | SAMA_PIO_SCHMITT, + SAMA_PIO_HIGH}, + /* UART0 */ + {SAMA_PIOB, + SAMA_PIN_N(PIOB_URXD0) | SAMA_PIN_N(PIOB_UTXD0), + SAMA_PIO_FUNC_PERIPH_C, + SAMA_PIO_HIGH}, + /* UART1 */ + {SAMA_PIOD, + SAMA_PIN_N(PIOD_URXD1) | SAMA_PIN_N(PIOD_UTXD1), + SAMA_PIO_FUNC_PERIPH_A, + SAMA_PIO_HIGH}, + /* UART2 */ + {SAMA_PIOD, + SAMA_PIN_N(PIOD_URXD2) | SAMA_PIN_N(PIOD_UTXD2), + SAMA_PIO_FUNC_PERIPH_B, + SAMA_PIO_HIGH}, + /* FLEXUART0 */ + {SAMA_PIOB, + SAMA_PIN_N(PIOB_UART_FLEXCOM0_IO0) | + SAMA_PIN_N(PIOB_UART_FLEXCOM0_IO1), + SAMA_PIO_FUNC_PERIPH_C, + SAMA_PIO_HIGH}, + /* FLEXUART4 */ + {SAMA_PIOD, + SAMA_PIN_N(PIOD_UART_FLEXCOM4_IO0) | + SAMA_PIN_N(PIOD_UART_FLEXCOM4_IO1) | + SAMA_PIN_N(PIOD_UART_FLEXCOM4_IO3) | + SAMA_PIN_N(PIOD_UART_FLEXCOM4_IO4), + SAMA_PIO_FUNC_PERIPH_C, + SAMA_PIO_HIGH}, + /* Keyboard Backlight Led */ + {SAMA_PIOD, + SAMA_PIN_N(PIOD_KEYBACK_LED_RED) | + SAMA_PIN_N(PIOD_KEYBACK_LED_GREEN) | + SAMA_PIN_N(PIOD_KEYBACK_LED_BLUE), + SAMA_PIO_FUNC_GPIO | SAMA_PIO_DIR_OUTPUT | SAMA_PIO_DRVSTR_HI, + SAMA_PIO_LOW}, + /* Red Led */ {SAMA_PIOB, SAMA_PIN_N(PIOB_LED_RED), SAMA_PIO_FUNC_GPIO | SAMA_PIO_DIR_OUTPUT | SAMA_PIO_DRVSTR_HI, @@ -90,6 +137,13 @@ static const sama_pio_init_t sama_inits[] = { void __early_init(void) { sama_clock_init(); + /* Configures ETH's pins */ + palSetGroupMode(PIOB, PAL_PORT_BIT(PIOB_ETH_GTXCK) | PAL_PORT_BIT(PIOB_ETH_GTXEN) | + PAL_PORT_BIT(PIOB_ETH_GRXDV) | PAL_PORT_BIT(PIOB_ETH_GRXER) | + PAL_PORT_BIT(PIOB_ETH_GRX0) | PAL_PORT_BIT(PIOB_ETH_GRX1) | + PAL_PORT_BIT(PIOB_ETH_GTX0) | PAL_PORT_BIT(PIOB_ETH_GTX1) | + PAL_PORT_BIT(PIOB_ETH_GMDC) | PAL_PORT_BIT(PIOB_ETH_GMDIO), + 0U, PAL_SAMA_FUNC_PERIPH_F); } /** diff --git a/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.h b/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.h index 78b670d4c..4958cdbff 100644 --- a/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.h +++ b/os/hal/boards/ATSAMA5D2_XULT_NSEC/board.h @@ -113,12 +113,12 @@ #define PIOA_PIN30 30U #define PIOA_PIN31 31U -#define PIOB_LED_BLUE 0U -#define PIOB_PIN1 1U -#define PIOB_PIN2 2U -#define PIOB_PIN3 3U -#define PIOB_PIN4 4U -#define PIOB_LED_GREEN 5U +#define PIOB_PIN0 0U +#define PIOB_CLASSD_R0 1U +#define PIOB_CLASSD_R1 2U +#define PIOB_CLASSD_R2 3U +#define PIOB_CLASSD_R3 4U +#define PIOB_PIN5 5U #define PIOB_LED_RED 6U #define PIOB_PIN7 7U #define PIOB_PIN8 8U @@ -139,17 +139,17 @@ #define PIOB_ETH_GMDIO 23U #define PIOB_PIN24 24U #define PIOB_PIN25 25U -#define PIOB_PIN26 26U -#define PIOB_PIN27 27U -#define PIOB_PIN28 28U -#define PIOB_PIN29 29U +#define PIOB_URXD0 26U +#define PIOB_UTXD0 27U +#define PIOB_UART_FLEXCOM0_IO0 28U +#define PIOB_UART_FLEXCOM0_IO1 29U #define PIOB_PIN30 30U #define PIOB_PIN31 31U #define PIOC_PIO0 0U -#define PIOC_PIN1 1U -#define PIOC_PIN2 2U -#define PIOC_PIN3 3U +#define PIOC_PIO1 1U +#define PIOC_PIO2 2U +#define PIOC_PIO3 3U #define PIOC_PIN4 4U #define PIOC_PIN5 5U #define PIOC_PIN6 6U @@ -181,30 +181,30 @@ #define PIOD_PIO0 0U #define PIOD_PIN1 1U -#define PIOD_PIN2 2U -#define PIOD_PIN3 3U -#define PIOD_PIN4 4U -#define PIOD_PIN5 5U +#define PIOD_URXD1 2U +#define PIOD_UTXD1 3U +#define PIOD_URXD2 4U +#define PIOD_UTXD2 5U #define PIOD_PIN6 6U #define PIOD_PIN7 7U #define PIOD_PIN8 8U #define PIOD_PIN9 9U #define PIOD_PIN10 10U #define PIOD_PIN11 11U -#define PIOD_PIN12 12U +#define PIOD_KEYBACK_LED_RED 12U #define PIOD_PIN13 13U #define PIOD_PIN14 14U #define PIOD_PIN15 15U #define PIOD_PIN16 16U #define PIOD_PIN17 17U -#define PIOD_PIN18 18U +#define PIOD_KEYBACK_LED_GREEN 18U #define PIOD_PIN19 19U -#define PIOD_PIN20 20U -#define PIOD_PIN21 21U -#define PIOD_PIN22 22U +#define PIOD_KEYBACK_LED_BLUE 20U +#define PIOD_UART_FLEXCOM4_IO0 21U +#define PIOD_UART_FLEXCOM4_IO1 22U #define PIOD_PIN23 23U -#define PIOD_PIN24 24U -#define PIOD_PIN25 25U +#define PIOD_UART_FLEXCOM4_IO3 24U +#define PIOD_UART_FLEXCOM4_IO4 25U #define PIOD_PIN26 26U #define PIOD_PIN27 27U #define PIOD_PIN28 28U @@ -218,10 +218,11 @@ #define BOARD_LINE(port, pad) \ ((uint32_t)((uint32_t)(port)) | ((uint32_t)(pad))) -#define LINE_LED_BLUE BOARD_LINE(PIOB, 0U) -#define LINE_LED_GREEN BOARD_LINE(PIOB, 5U) #define LINE_LED_RED BOARD_LINE(PIOB, 6U) #define LINE_USER_PB BOARD_LINE(PIOB, 9U) +#define LINE_KEYBACK_LED_RED BOARD_LINE(PIOD, 12U) +#define LINE_KEYBACK_LED_GREEN BOARD_LINE(PIOD, 18U) +#define LINE_KEYBACK_LED_BLUE BOARD_LINE(PIOD, 20U) #if !defined(_FROM_ASM_) #ifdef __cplusplus -- cgit v1.2.3