Skip to content

Commit

Permalink
samples: caf: Add nrf54h20pdk configuration
Browse files Browse the repository at this point in the history
Add configuration for nRF54H20PDK.

Signed-off-by: Pawel Dunaj <[email protected]>
  • Loading branch information
pdunaj authored and jfischer-no committed Mar 11, 2024
1 parent 1b2e296 commit fb571f1
Show file tree
Hide file tree
Showing 4 changed files with 117 additions and 0 deletions.
9 changes: 9 additions & 0 deletions samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.conf
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
41 changes: 41 additions & 0 deletions samples/caf/boards/nrf54h20pdk_nrf54h20_cpuapp.overlay
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";
};
};
};
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) }
};
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));

0 comments on commit fb571f1

Please sign in to comment.