Change in osmo-ccid-firmware[master]: name pin according to schematic

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Kévin Redon gerrit-no-reply at lists.osmocom.org
Sun Feb 3 13:47:43 UTC 2019


Kévin Redon has uploaded this change for review. ( https://gerrit.osmocom.org/12810


Change subject: name pin according to schematic
......................................................................

name pin according to schematic

Change-Id: I94a7f2216c288150b044a6190804f9b7247eb10c
---
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/atmel_start_pins.h
M sysmoOCTSIM/driver_init.c
M sysmoOCTSIM/main.c
4 files changed, 175 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-ccid-firmware refs/changes/10/12810/1

diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart
index 5c7cc2c..b6303f9 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -1030,6 +1030,46 @@
         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 @@
     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
diff --git a/sysmoOCTSIM/atmel_start_pins.h b/sysmoOCTSIM/atmel_start_pins.h
index 884a562..fea4388 100644
--- a/sysmoOCTSIM/atmel_start_pins.h
+++ b/sysmoOCTSIM/atmel_start_pins.h
@@ -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
diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index dea4ebc..4ab622f 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -176,9 +176,131 @@
 {
 	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 @@
 	                   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();
 
diff --git a/sysmoOCTSIM/main.c b/sysmoOCTSIM/main.c
index dfe3b03..f2584d2 100644
--- a/sysmoOCTSIM/main.c
+++ b/sysmoOCTSIM/main.c
@@ -30,7 +30,7 @@
 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;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/12810
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I94a7f2216c288150b044a6190804f9b7247eb10c
Gerrit-Change-Number: 12810
Gerrit-PatchSet: 1
Gerrit-Owner: Kévin Redon <kredon at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190203/84d0abe5/attachment.htm>


More information about the gerrit-log mailing list