Skip to content

Commit

Permalink
drivers: gpio: Add support for Apollo3 SoCs GPIO
Browse files Browse the repository at this point in the history
This commit adds support for the GPIO which
can be found in Apollo3 SoCs

Signed-off-by: Hao Luo <[email protected]>
  • Loading branch information
AlessandroLuo committed May 11, 2024
1 parent 2c6306d commit cfc9a1f
Show file tree
Hide file tree
Showing 8 changed files with 436 additions and 21 deletions.
53 changes: 53 additions & 0 deletions boards/ambiq/apollo3_evb/apollo3_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,51 @@

aliases {
watchdog0 = &wdt0;
led0 = &led0;
led1 = &led1;
led2 = &led2;
sw0 = &button0;
sw1 = &button1;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0_31 10 GPIO_ACTIVE_LOW>;
label = "LED 0";
};
led1: led_1 {
gpios = <&gpio0_31 30 GPIO_ACTIVE_LOW>;
label = "LED 1";
};
led2: led_2 {
gpios = <&gpio0_31 15 GPIO_ACTIVE_LOW>;
label = "LED 2";
};
led3: led_3 {
gpios = <&gpio0_31 14 GPIO_ACTIVE_LOW>;
label = "LED 3";
};
led4: led_4 {
gpios = <&gpio0_31 17 GPIO_ACTIVE_LOW>;
label = "LED 4";
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0_31 16 GPIO_ACTIVE_LOW>;
label = "BTN0";
};
button1: button_1 {
gpios = <&gpio0_31 18 GPIO_ACTIVE_LOW>;
label = "BTN1";
};
button2: button_2 {
gpios = <&gpio0_31 19 GPIO_ACTIVE_LOW>;
label = "BTN2";
};
};
};

Expand All @@ -45,3 +90,11 @@
pinctrl-names = "default";
status = "okay";
};

&gpio0_31 {
status = "okay";
};

&gpio32_63 {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/ambiq/apollo3_evb/apollo3_evb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ toolchain:
- gnuarmemb
supported:
- uart
- gpio
testing:
ignore_tags:
- net
Expand Down
57 changes: 57 additions & 0 deletions boards/ambiq/apollo3p_evb/apollo3p_evb.dts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,51 @@

aliases {
watchdog0 = &wdt0;
led0 = &led0;
led1 = &led1;
led2 = &led2;
sw0 = &button0;
sw1 = &button1;
};

leds {
compatible = "gpio-leds";
led0: led_0 {
gpios = <&gpio0_31 10 GPIO_ACTIVE_LOW>;
label = "LED 0";
};
led1: led_1 {
gpios = <&gpio0_31 30 GPIO_ACTIVE_LOW>;
label = "LED 1";
};
led2: led_2 {
gpios = <&gpio0_31 15 GPIO_ACTIVE_LOW>;
label = "LED 2";
};
led3: led_3 {
gpios = <&gpio0_31 14 GPIO_ACTIVE_LOW>;
label = "LED 3";
};
led4: led_4 {
gpios = <&gpio0_31 17 GPIO_ACTIVE_LOW>;
label = "LED 4";
};
};

buttons {
compatible = "gpio-keys";
button0: button_0 {
gpios = <&gpio0_31 16 GPIO_ACTIVE_LOW>;
label = "BTN0";
};
button1: button_1 {
gpios = <&gpio0_31 18 GPIO_ACTIVE_LOW>;
label = "BTN1";
};
button2: button_2 {
gpios = <&gpio0_31 19 GPIO_ACTIVE_LOW>;
label = "BTN2";
};
};
};

Expand All @@ -45,3 +90,15 @@
pinctrl-names = "default";
status = "okay";
};

&gpio0_31 {
status = "okay";
};

&gpio32_63 {
status = "okay";
};

&gpio64_95 {
status = "okay";
};
1 change: 1 addition & 0 deletions boards/ambiq/apollo3p_evb/apollo3p_evb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ toolchain:
- gnuarmemb
supported:
- uart
- gpio
testing:
ignore_tags:
- net
Expand Down
Loading

0 comments on commit cfc9a1f

Please sign in to comment.