name pin according to schematic
Change-Id: I94a7f2216c288150b044a6190804f9b7247eb10c
This commit is contained in:
parent
d4ed1ec9ff
commit
6a8295cfa9
|
@ -1030,6 +1030,46 @@ drivers:
|
|||
configuration:
|
||||
usb_gclk_selection: Generic clock generator 1
|
||||
pads:
|
||||
SIMCLK_20MHZ:
|
||||
name: PA11
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA11
|
||||
mode: Advanced
|
||||
user_label: SIMCLK_20MHZ
|
||||
configuration:
|
||||
pad_direction: Out
|
||||
pad_function: M
|
||||
pad_initial_level: Low
|
||||
pad_pull_config: 'Off'
|
||||
SWITCH:
|
||||
name: PC14
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC14
|
||||
mode: Digital input
|
||||
user_label: SWITCH
|
||||
configuration: null
|
||||
VB0:
|
||||
name: PA20
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA20
|
||||
mode: Digital input
|
||||
user_label: VB0
|
||||
configuration: null
|
||||
VB1:
|
||||
name: PA21
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA21
|
||||
mode: Digital input
|
||||
user_label: VB1
|
||||
configuration: null
|
||||
VB2:
|
||||
name: PA22
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA22
|
||||
mode: Digital input
|
||||
user_label: VB2
|
||||
configuration: null
|
||||
VB3:
|
||||
name: PA23
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA23
|
||||
mode: Digital input
|
||||
user_label: VB3
|
||||
configuration: null
|
||||
USBUP_D_N:
|
||||
name: PA24
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA24
|
||||
|
@ -1042,11 +1082,11 @@ pads:
|
|||
mode: Advanced
|
||||
user_label: USBUP_D_P
|
||||
configuration: null
|
||||
LED_system:
|
||||
USER_LED:
|
||||
name: PC26
|
||||
definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC26
|
||||
mode: Digital output
|
||||
user_label: LED_system
|
||||
user_label: USER_LED
|
||||
configuration: null
|
||||
UART_TX:
|
||||
name: PB30
|
||||
|
|
|
@ -27,10 +27,16 @@
|
|||
#define GPIO_PIN_FUNCTION_M 12
|
||||
#define GPIO_PIN_FUNCTION_N 13
|
||||
|
||||
#define SIMCLK_20MHZ GPIO(GPIO_PORTA, 11)
|
||||
#define VB0 GPIO(GPIO_PORTA, 20)
|
||||
#define VB1 GPIO(GPIO_PORTA, 21)
|
||||
#define VB2 GPIO(GPIO_PORTA, 22)
|
||||
#define VB3 GPIO(GPIO_PORTA, 23)
|
||||
#define USBUP_D_N GPIO(GPIO_PORTA, 24)
|
||||
#define USBUP_D_P GPIO(GPIO_PORTA, 25)
|
||||
#define UART_TX GPIO(GPIO_PORTB, 30)
|
||||
#define UART_RX GPIO(GPIO_PORTB, 31)
|
||||
#define LED_system GPIO(GPIO_PORTC, 26)
|
||||
#define SWITCH GPIO(GPIO_PORTC, 14)
|
||||
#define USER_LED GPIO(GPIO_PORTC, 26)
|
||||
|
||||
#endif // ATMEL_START_PINS_H_INCLUDED
|
||||
|
|
|
@ -176,9 +176,131 @@ void system_init(void)
|
|||
{
|
||||
init_mcu();
|
||||
|
||||
// GPIO on PA11
|
||||
|
||||
gpio_set_pin_direction(SIMCLK_20MHZ,
|
||||
// <y> Pin direction
|
||||
// <id> pad_direction
|
||||
// <GPIO_DIRECTION_OFF"> Off
|
||||
// <GPIO_DIRECTION_IN"> In
|
||||
// <GPIO_DIRECTION_OUT"> Out
|
||||
GPIO_DIRECTION_OUT);
|
||||
|
||||
gpio_set_pin_level(SIMCLK_20MHZ,
|
||||
// <y> Initial level
|
||||
// <id> pad_initial_level
|
||||
// <false"> Low
|
||||
// <true"> High
|
||||
false);
|
||||
|
||||
gpio_set_pin_pull_mode(SIMCLK_20MHZ,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(SIMCLK_20MHZ,
|
||||
// <y> Pin function
|
||||
// <id> pad_function
|
||||
// <i> Auto : use driver pinmux if signal is imported by driver, else turn off function
|
||||
// <GPIO_PIN_FUNCTION_OFF"> Auto
|
||||
// <GPIO_PIN_FUNCTION_OFF"> Off
|
||||
// <GPIO_PIN_FUNCTION_A"> A
|
||||
// <GPIO_PIN_FUNCTION_B"> B
|
||||
// <GPIO_PIN_FUNCTION_C"> C
|
||||
// <GPIO_PIN_FUNCTION_D"> D
|
||||
// <GPIO_PIN_FUNCTION_E"> E
|
||||
// <GPIO_PIN_FUNCTION_F"> F
|
||||
// <GPIO_PIN_FUNCTION_G"> G
|
||||
// <GPIO_PIN_FUNCTION_H"> H
|
||||
// <GPIO_PIN_FUNCTION_I"> I
|
||||
// <GPIO_PIN_FUNCTION_J"> J
|
||||
// <GPIO_PIN_FUNCTION_K"> K
|
||||
// <GPIO_PIN_FUNCTION_L"> L
|
||||
// <GPIO_PIN_FUNCTION_M"> M
|
||||
// <GPIO_PIN_FUNCTION_N"> N
|
||||
GPIO_PIN_FUNCTION_M);
|
||||
|
||||
// GPIO on PA20
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(VB0, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(VB0,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(VB0, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
// GPIO on PA21
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(VB1, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(VB1,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(VB1, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
// GPIO on PA22
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(VB2, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(VB2,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(VB2, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
// GPIO on PA23
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(VB3, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(VB3,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(VB3, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
// GPIO on PC14
|
||||
|
||||
// Set pin direction to input
|
||||
gpio_set_pin_direction(SWITCH, GPIO_DIRECTION_IN);
|
||||
|
||||
gpio_set_pin_pull_mode(SWITCH,
|
||||
// <y> Pull configuration
|
||||
// <id> pad_pull_config
|
||||
// <GPIO_PULL_OFF"> Off
|
||||
// <GPIO_PULL_UP"> Pull-up
|
||||
// <GPIO_PULL_DOWN"> Pull-down
|
||||
GPIO_PULL_OFF);
|
||||
|
||||
gpio_set_pin_function(SWITCH, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
// GPIO on PC26
|
||||
|
||||
gpio_set_pin_level(LED_system,
|
||||
gpio_set_pin_level(USER_LED,
|
||||
// <y> Initial level
|
||||
// <id> pad_initial_level
|
||||
// <false"> Low
|
||||
|
@ -186,9 +308,9 @@ void system_init(void)
|
|||
false);
|
||||
|
||||
// Set pin direction to output
|
||||
gpio_set_pin_direction(LED_system, GPIO_DIRECTION_OUT);
|
||||
gpio_set_pin_direction(USER_LED, GPIO_DIRECTION_OUT);
|
||||
|
||||
gpio_set_pin_function(LED_system, GPIO_PIN_FUNCTION_OFF);
|
||||
gpio_set_pin_function(USER_LED, GPIO_PIN_FUNCTION_OFF);
|
||||
|
||||
UART_debug_init();
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ static void tx_cb_UART_debug(const struct usart_async_descriptor *const io_descr
|
|||
static void rx_cb_UART_debug(const struct usart_async_descriptor *const io_descr)
|
||||
{
|
||||
/* Receive completed */
|
||||
gpio_toggle_pin_level(LED_system);
|
||||
gpio_toggle_pin_level(USER_LED);
|
||||
data_arrived = true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue