Files
OpenParcelBox/firmware/app/include/board_config.h
T

59 lines
1.3 KiB
C

/*
* SPDX-License-Identifier: Apache-2.0
*
* OpenParcelBox
* Copyright (c) 2026
*
* Central board configuration.
*/
#ifndef BOARD_CONFIG_H
#define BOARD_CONFIG_H
#include <zephyr/devicetree.h>
#include <zephyr/dt-bindings/gpio/gpio.h>
/* RGB LED */
#define LED_RED_NODE DT_ALIAS(led0)
#define LED_GREEN_NODE DT_ALIAS(led1)
#define LED_BLUE_NODE DT_ALIAS(led2)
/* GPIO expander */
#define GPIO_EXPANDER_I2C_NODE DT_NODELABEL(i2c1)
#define GPIO_EXPANDER_ADDRESS 0x20
/* PN532 NFC reader (7-bit I2C address; NXP documents 0x48 including R/W). */
#define PN532_I2C_NODE DT_NODELABEL(i2c1)
#define PN532_I2C_ADDRESS 0x24
/* Buzzer */
#define BUZZER_GPIO_NODE DT_NODELABEL(gpio0)
#define BUZZER_GPIO_PIN 2
#define BUZZER_GPIO_FLAGS GPIO_ACTIVE_HIGH
/* Lock control */
#define LOCK_CONTROL_GPIO_NODE DT_NODELABEL(lock_control)
/* Lock state feedback */
#define LOCK_STATE_NC_GPIO_NODE DT_NODELABEL(gpio1)
#define LOCK_STATE_NC_GPIO_PIN 12
#define LOCK_STATE_NC_GPIO_FLAGS GPIO_ACTIVE_LOW
#define LOCK_STATE_COM_GPIO_NODE DT_NODELABEL(gpio1)
#define LOCK_STATE_COM_GPIO_PIN 13
#define LOCK_STATE_COM_GPIO_FLAGS GPIO_ACTIVE_HIGH
/* Internal identity reset button */
#define RESET_BUTTON_GPIO_NODE DT_NODELABEL(gpio1)
#define RESET_BUTTON_GPIO_PIN 11
#define RESET_BUTTON_GPIO_FLAGS GPIO_ACTIVE_LOW
#endif /* BOARD_CONFIG_H */