Change in osmo-ccid-firmware[master]: Update from AtmelStart: Define all used GPIO pins

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
Tue Feb 26 18:13:42 UTC 2019


Kévin Redon has submitted this change and it was merged. ( https://gerrit.osmocom.org/13032 )

Change subject: Update from AtmelStart: Define all used GPIO pins
......................................................................

Update from AtmelStart: Define all used GPIO pins

Change-Id: I2cb67fd01f6e8602af16bbdb4960427586cdd9a4
---
M sysmoOCTSIM/atmel_start_config.atstart
M sysmoOCTSIM/atmel_start_pins.h
M sysmoOCTSIM/driver_init.c
3 files changed, 366 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Kévin Redon: Looks good to me, approved



diff --git a/sysmoOCTSIM/atmel_start_config.atstart b/sysmoOCTSIM/atmel_start_config.atstart
index 58f05f6..a301385 100644
--- a/sysmoOCTSIM/atmel_start_config.atstart
+++ b/sysmoOCTSIM/atmel_start_config.atstart
@@ -1367,6 +1367,66 @@
         configuration:
           usb_gclk_selection: Generic clock generator 1
 pads:
+  SIM0_INT:
+    name: PC00
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC00
+    mode: Digital input
+    user_label: SIM0_INT
+    configuration: null
+  SIM1_INT:
+    name: PC01
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC01
+    mode: Digital input
+    user_label: SIM1_INT
+    configuration: null
+  SIM2_INT:
+    name: PC02
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC02
+    mode: Digital input
+    user_label: SIM2_INT
+    configuration: null
+  SIM3_INT:
+    name: PC03
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC03
+    mode: Digital input
+    user_label: SIM3_INT
+    configuration: null
+  SIM4_INT:
+    name: PA02
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA02
+    mode: Digital input
+    user_label: SIM4_INT
+    configuration: null
+  SIM5_INT:
+    name: PA03
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA03
+    mode: Digital input
+    user_label: SIM5_INT
+    configuration: null
+  SIM6_INT:
+    name: PB04
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB04
+    mode: Digital input
+    user_label: SIM6_INT
+    configuration: null
+  SIM7_INT:
+    name: PB05
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB05
+    mode: Digital input
+    user_label: SIM7_INT
+    configuration: null
+  SCL3:
+    name: PB06
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB06
+    mode: Digital output
+    user_label: SCL3
+    configuration: null
+  SDA3:
+    name: PB07
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB07
+    mode: Digital output
+    user_label: SDA3
+    configuration: null
   SIM4_IO:
     name: PB08
     definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB08
@@ -1395,12 +1455,30 @@
       pad_function: M
       pad_initial_level: Low
       pad_pull_config: 'Off'
+  SCL1:
+    name: PB14
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB14
+    mode: Digital output
+    user_label: SCL1
+    configuration: null
+  SDA1:
+    name: PB15
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB15
+    mode: Digital output
+    user_label: SDA1
+    configuration: null
   SWITCH:
     name: PC14
     definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC14
     mode: Digital input
     user_label: SWITCH
     configuration: null
+  MUX_SSTAT:
+    name: PC15
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC15
+    mode: Digital input
+    user_label: MUX_SSTAT
+    configuration: null
   SIM1_IO:
     name: PA16
     definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PA16
@@ -1467,6 +1545,18 @@
     mode: Digital output
     user_label: USER_LED
     configuration: null
+  SCL4:
+    name: PC27
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC27
+    mode: Digital output
+    user_label: SCL4
+    configuration: null
+  SDA4:
+    name: PC28
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PC28
+    mode: Digital output
+    user_label: SDA4
+    configuration: null
   UART_TX:
     name: PB30
     definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB30
@@ -1479,4 +1569,16 @@
     mode: Peripheral IO
     user_label: UART_RX
     configuration: null
+  SCL2:
+    name: PB02
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB02
+    mode: Digital output
+    user_label: SCL2
+    configuration: null
+  SDA2:
+    name: PB03
+    definition: Atmel:SAME54_Drivers:0.0.1::SAME54N19A-AF::pad::PB03
+    mode: Digital output
+    user_label: SDA2
+    configuration: null
 toolchain_options: []
diff --git a/sysmoOCTSIM/atmel_start_pins.h b/sysmoOCTSIM/atmel_start_pins.h
index ad5f27b..60b70bb 100644
--- a/sysmoOCTSIM/atmel_start_pins.h
+++ b/sysmoOCTSIM/atmel_start_pins.h
@@ -27,6 +27,8 @@
 #define GPIO_PIN_FUNCTION_M 12
 #define GPIO_PIN_FUNCTION_N 13
 
+#define SIM4_INT GPIO(GPIO_PORTA, 2)
+#define SIM5_INT GPIO(GPIO_PORTA, 3)
 #define SIM0_IO GPIO(GPIO_PORTA, 4)
 #define SIM2_IO GPIO(GPIO_PORTA, 9)
 #define SIMCLK_20MHZ GPIO(GPIO_PORTA, 11)
@@ -37,13 +39,28 @@
 #define VB3 GPIO(GPIO_PORTA, 23)
 #define USBUP_D_N GPIO(GPIO_PORTA, 24)
 #define USBUP_D_P GPIO(GPIO_PORTA, 25)
+#define SCL2 GPIO(GPIO_PORTB, 2)
+#define SDA2 GPIO(GPIO_PORTB, 3)
+#define SIM6_INT GPIO(GPIO_PORTB, 4)
+#define SIM7_INT GPIO(GPIO_PORTB, 5)
+#define SCL3 GPIO(GPIO_PORTB, 6)
+#define SDA3 GPIO(GPIO_PORTB, 7)
 #define SIM4_IO GPIO(GPIO_PORTB, 8)
+#define SCL1 GPIO(GPIO_PORTB, 14)
+#define SDA1 GPIO(GPIO_PORTB, 15)
 #define SIM5_IO GPIO(GPIO_PORTB, 16)
 #define SIM3_IO GPIO(GPIO_PORTB, 20)
 #define UART_TX GPIO(GPIO_PORTB, 30)
 #define UART_RX GPIO(GPIO_PORTB, 31)
+#define SIM0_INT GPIO(GPIO_PORTC, 0)
+#define SIM1_INT GPIO(GPIO_PORTC, 1)
+#define SIM2_INT GPIO(GPIO_PORTC, 2)
+#define SIM3_INT GPIO(GPIO_PORTC, 3)
 #define SWITCH GPIO(GPIO_PORTC, 14)
+#define MUX_SSTAT GPIO(GPIO_PORTC, 15)
 #define SIM6_IO GPIO(GPIO_PORTC, 16)
 #define USER_LED GPIO(GPIO_PORTC, 26)
+#define SCL4 GPIO(GPIO_PORTC, 27)
+#define SDA4 GPIO(GPIO_PORTC, 28)
 
 #endif // ATMEL_START_PINS_H_INCLUDED
diff --git a/sysmoOCTSIM/driver_init.c b/sysmoOCTSIM/driver_init.c
index a196791..1a58ad9 100644
--- a/sysmoOCTSIM/driver_init.c
+++ b/sysmoOCTSIM/driver_init.c
@@ -470,6 +470,36 @@
 {
 	init_mcu();
 
+	// GPIO on PA02
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM4_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM4_INT,
+	                       // <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(SIM4_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PA03
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM5_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM5_INT,
+	                       // <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(SIM5_INT, GPIO_PIN_FUNCTION_OFF);
+
 	// GPIO on PA11
 
 	gpio_set_pin_direction(SIMCLK_20MHZ,
@@ -577,6 +607,180 @@
 
 	gpio_set_pin_function(VB3, GPIO_PIN_FUNCTION_OFF);
 
+	// GPIO on PB02
+
+	gpio_set_pin_level(SCL2,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SCL2, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SCL2, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB03
+
+	gpio_set_pin_level(SDA2,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SDA2, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SDA2, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB04
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM6_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM6_INT,
+	                       // <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(SIM6_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB05
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM7_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM7_INT,
+	                       // <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(SIM7_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB06
+
+	gpio_set_pin_level(SCL3,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SCL3, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SCL3, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB07
+
+	gpio_set_pin_level(SDA3,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SDA3, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SDA3, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB14
+
+	gpio_set_pin_level(SCL1,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SCL1, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SCL1, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PB15
+
+	gpio_set_pin_level(SDA1,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SDA1, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SDA1, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PC00
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM0_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM0_INT,
+	                       // <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(SIM0_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PC01
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM1_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM1_INT,
+	                       // <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(SIM1_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PC02
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM2_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM2_INT,
+	                       // <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(SIM2_INT, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PC03
+
+	// Set pin direction to input
+	gpio_set_pin_direction(SIM3_INT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(SIM3_INT,
+	                       // <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(SIM3_INT, GPIO_PIN_FUNCTION_OFF);
+
 	// GPIO on PC14
 
 	// Set pin direction to input
@@ -592,6 +796,21 @@
 
 	gpio_set_pin_function(SWITCH, GPIO_PIN_FUNCTION_OFF);
 
+	// GPIO on PC15
+
+	// Set pin direction to input
+	gpio_set_pin_direction(MUX_SSTAT, GPIO_DIRECTION_IN);
+
+	gpio_set_pin_pull_mode(MUX_SSTAT,
+	                       // <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(MUX_SSTAT, GPIO_PIN_FUNCTION_OFF);
+
 	// GPIO on PC26
 
 	gpio_set_pin_level(USER_LED,
@@ -606,6 +825,34 @@
 
 	gpio_set_pin_function(USER_LED, GPIO_PIN_FUNCTION_OFF);
 
+	// GPIO on PC27
+
+	gpio_set_pin_level(SCL4,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SCL4, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SCL4, GPIO_PIN_FUNCTION_OFF);
+
+	// GPIO on PC28
+
+	gpio_set_pin_level(SDA4,
+	                   // <y> Initial level
+	                   // <id> pad_initial_level
+	                   // <false"> Low
+	                   // <true"> High
+	                   false);
+
+	// Set pin direction to output
+	gpio_set_pin_direction(SDA4, GPIO_DIRECTION_OUT);
+
+	gpio_set_pin_function(SDA4, GPIO_PIN_FUNCTION_OFF);
+
 	SIM0_init();
 	SIM1_init();
 	SIM2_init();

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

Gerrit-Project: osmo-ccid-firmware
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I2cb67fd01f6e8602af16bbdb4960427586cdd9a4
Gerrit-Change-Number: 13032
Gerrit-PatchSet: 2
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Kévin Redon <kredon at sysmocom.de>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190226/0d101775/attachment.htm>


More information about the gerrit-log mailing list