forked from nrfconnect/sdk-nrf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
samples: caf: Add nrf54h20pdk configuration
Add configuration for nRF54H20PDK. Signed-off-by: Pawel Dunaj <[email protected]>
- Loading branch information
1 parent
1b2e296
commit fb571f1
Showing
4 changed files
with
117 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# Copyright (c) 2024 Nordic Semiconductor ASA | ||
# | ||
# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
# | ||
################################################################################ | ||
|
||
CONFIG_LED_PWM=n | ||
CONFIG_LED_GPIO=y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
/{ | ||
/delete-node/ leds; | ||
|
||
leds0 { | ||
compatible = "gpio-leds"; | ||
led0: led_0 { | ||
gpios = <&gpio9 0 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 0"; | ||
}; | ||
}; | ||
|
||
leds1 { | ||
compatible = "gpio-leds"; | ||
led1: led_1 { | ||
gpios = <&gpio9 1 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 1"; | ||
}; | ||
}; | ||
|
||
leds2 { | ||
compatible = "gpio-leds"; | ||
led2: led_2 { | ||
gpios = <&gpio9 2 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 2"; | ||
}; | ||
}; | ||
|
||
leds3 { | ||
compatible = "gpio-leds"; | ||
led3: led_3 { | ||
gpios = <&gpio9 3 GPIO_ACTIVE_HIGH>; | ||
label = "Green LED 3"; | ||
}; | ||
}; | ||
}; |
23 changes: 23 additions & 0 deletions
23
samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/buttons_def.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <caf/gpio_pins.h> | ||
|
||
/* This configuration file is included only once from button module and holds | ||
* information about pins forming keyboard matrix. | ||
*/ | ||
|
||
/* This structure enforces the header file is included only once in the build. | ||
* Violating this requirement triggers a multiple definition error at link time. | ||
*/ | ||
const struct {} buttons_def_include_once; | ||
|
||
static const struct gpio_pin col[] = {}; | ||
|
||
static const struct gpio_pin row[] = { | ||
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button0), gpios) }, | ||
{ .port = 0, .pin = DT_GPIO_PIN(DT_NODELABEL(button1), gpios) } | ||
}; |
44 changes: 44 additions & 0 deletions
44
samples/caf/configuration/nrf54h20pdk_nrf54h20_cpuapp/led_state_def.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/* | ||
* Copyright (c) 2024 Nordic Semiconductor ASA | ||
* | ||
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause | ||
*/ | ||
|
||
#include <caf/led_effect.h> | ||
|
||
/* This configuration file is included only once from led_state module and holds | ||
* information about LED effect associated with each state. | ||
*/ | ||
|
||
/* This structure enforces the header file is included only once in the build. | ||
* Violating this requirement triggers a multiple definition error at link time. | ||
*/ | ||
const struct {} led_state_def_include_once; | ||
|
||
enum led_id { | ||
LED_ID_0, | ||
LED_ID_1, | ||
LED_ID_2, | ||
LED_ID_3, | ||
|
||
LED_ID_COUNT | ||
}; | ||
|
||
enum led_effect_id { | ||
LED_EFFECT_ID_OFF, | ||
LED_EFFECT_ID_BLINK, | ||
LED_EFFECT_ID_BLINK2, | ||
LED_EFFECT_ID_CLOCK, | ||
|
||
LED_EFFECT_ID_COUNT | ||
}; | ||
|
||
/* Map function to led effect */ | ||
static const struct led_effect led_effect[] = { | ||
[LED_EFFECT_ID_OFF] = LED_EFFECT_LED_OFF(), | ||
[LED_EFFECT_ID_BLINK] = LED_EFFECT_LED_BLINK(200, LED_COLOR(255, 255, 255)), | ||
[LED_EFFECT_ID_BLINK2] = LED_EFFECT_LED_BLINK2(10, 90, LED_COLOR(255, 255, 255)), | ||
[LED_EFFECT_ID_CLOCK] = LED_EFFECT_LED_CLOCK(3, LED_COLOR(255, 255, 255)), | ||
}; | ||
|
||
static const struct led_effect led_effect_on = LED_EFFECT_LED_ON(LED_COLOR(255, 255, 255)); |