Skip to content

Commit 40bd412

Browse files
committed
boards/xg23b-pk6068a: initial commit
1 parent 9f1492f commit 40bd412

File tree

10 files changed

+439
-0
lines changed

10 files changed

+439
-0
lines changed

boards/xg23b-pk6068a/Kconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Copyright (c) 2022 SSV Software Systems GmbH
2+
#
3+
# This file is subject to the terms and conditions of the GNU Lesser
4+
# General Public License v2.1. See the file LICENSE in the top level
5+
# directory for more details.
6+
7+
config BOARD
8+
default "xg23b-pk6068a" if BOARD_XG23B_PK6068A
9+
10+
config BOARD_XG23B_PK6068A
11+
bool
12+
default y
13+
select EFR32ZG23A020F512GM48
14+
15+
# Put defined MCU peripherals here (in alphabetical order)
16+
select HAS_PERIPH_I2C
17+
select HAS_PERIPH_SPI
18+
select HAS_PERIPH_TIMER
19+
select HAS_PERIPH_UART
20+
21+
# Put other features for this board (in alphabetical order)

boards/xg23b-pk6068a/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
MODULE = board
2+
3+
include $(RIOTBASE)/Makefile.base

boards/xg23b-pk6068a/Makefile.dep

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
ifneq (,$(filter saul_default,$(USEMODULE)))
2+
USEMODULE += saul_gpio
3+
endif
4+
5+
ifneq (,$(filter ztimer,$(USEMODULE)))
6+
USEMODULE += ztimer_periph_lptimer
7+
endif
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
CPU = efm32
2+
CPU_FAM = efr32zg23
3+
CPU_MODEL = efr32zg23a020f512gm48
4+
5+
# Put defined MCU peripherals here (in alphabetical order)
6+
FEATURES_PROVIDED += periph_i2c
7+
FEATURES_PROVIDED += periph_spi
8+
FEATURES_PROVIDED += periph_timer
9+
FEATURES_PROVIDED += periph_uart
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# use JLink for flashing
2+
PROGRAMMER ?= jlink
3+
JLINK_DEVICE = EFR32ZG23BXXXF512
4+
JLINK_PRE_FLASH = r
5+
FLASH_ADDR = 0x08000000
6+
BAUD ?= 115200

boards/xg23b-pk6068a/board.c

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Copyright (C) 2022 SSV Software Systems GmbH
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @ingroup boards_xg23b-pk6068a
11+
* @{
12+
*
13+
* @file
14+
* @brief Board specific implementations for the xG23B-PK6068A board
15+
*
16+
* @author Juergen Fitschen <[email protected]>
17+
*
18+
* @}
19+
*/
20+
21+
#include "cpu.h"
22+
#include "board.h"
23+
#include "periph/gpio.h"
24+
25+
void board_init(void)
26+
{
27+
/* Enable VCOM iface */
28+
gpio_init(VCOM_EN_PIN, GPIO_OUT);
29+
gpio_set(VCOM_EN_PIN);
30+
}

boards/xg23b-pk6068a/doc.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
/**
2+
* @defgroup boards_xg23b-pk6068a xG23B-PK6068A
3+
* @ingroup boards
4+
* @brief Support for the xG23B-PK6068A board.
5+
*
6+
* ### General information
7+
*
8+
* Some general information about the board
9+
*
10+
* ### Pinout
11+
*
12+
* A detailed description of the board pinout (if available)
13+
*
14+
* ### Flash the board
15+
*
16+
* Some notes about how to flash the board
17+
*
18+
*/
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
/*
2+
* Copyright (C) 2022 SSV Software Systems GmbH
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @ingroup boards_xg23b-pk6068a
11+
* @{
12+
*
13+
* @file
14+
* @brief Board specific definitions for the xG23B-PK6068A
15+
*
16+
* @author Juergen Fitschen <[email protected]>
17+
*/
18+
19+
#ifndef BOARD_H
20+
#define BOARD_H
21+
22+
#include "cpu.h"
23+
#include "periph_conf.h"
24+
#include "periph_cpu.h"
25+
26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
30+
/**
31+
* @brief Initialize pm_layered with no pre-defined blockers
32+
*
33+
* All peripheral drivers keep track of required pm modes.
34+
*/
35+
#define PM_BLOCKER_INITIAL { 0, 0, 0 }
36+
37+
/**
38+
* @name ztimer configuration
39+
* @{
40+
*/
41+
#define CONFIG_ZTIMER_LPTIMER_DEV TIMER_DEV(1)
42+
#define CONFIG_ZTIMER_LPTIMER_FREQ LFXO_FREQ
43+
#define CONFIG_ZTIMER_LPTIMER_WIDTH 24
44+
#define CONFIG_ZTIMER_LPTIMER_BLOCK_PM_MODE -1
45+
/** @} */
46+
47+
/**
48+
* @brief Power mode required for GPIO IRQs
49+
*
50+
* If all GPIO IRQs are expected on port A or B, EM3 is the lowest allowed
51+
* power mode. No power level has to be blocked in this case.
52+
* If GPIO IRQs shall be fired on port C or D, we must stay in EM1.
53+
* Uncomment the line down below in this case.
54+
*/
55+
//#define GPIO_INT_PM_BLOCKER PM_MODE_EM2
56+
57+
/**
58+
* @name Board VCOM interface
59+
*
60+
* Define the GPIO pin to enable the VCOM interface
61+
*/
62+
#define VCOM_UART UART_DEV(0)
63+
#define VCOM_EN_PIN GPIO_PIN(PB, 0)
64+
65+
/**
66+
* @name Push button pin definitions
67+
* @{
68+
*/
69+
#define PB0_PIN GPIO_PIN(PB, 1)
70+
#define PB1_PIN GPIO_PIN(PB, 3)
71+
/** @} */
72+
73+
/**
74+
* @name LED pin definitions
75+
* @{
76+
*/
77+
#define LED0_PIN GPIO_PIN(PB, 2)
78+
#define LED1_PIN GPIO_PIN(PD, 3)
79+
/** @} */
80+
81+
/**
82+
* @name Macros for controlling the on-board LEDs
83+
* @{
84+
*/
85+
#define LED0_ON gpio_set(LED0_PIN)
86+
#define LED0_OFF gpio_clear(LED0_PIN)
87+
#define LED0_TOGGLE gpio_toggle(LED0_PIN)
88+
#define LED1_ON gpio_set(LED1_PIN)
89+
#define LED1_OFF gpio_clear(LED1_PIN)
90+
#define LED1_TOGGLE gpio_toggle(LED1_PIN)
91+
/** @} */
92+
93+
/**
94+
* @name Display configuration
95+
*
96+
* Connection to the on-board Sharp Memory LCD (LS013B7DH03).
97+
* @{
98+
*/
99+
#define DISP_SPI SPI_DEV(0)
100+
#define DISP_CS_PIN GPIO_PIN(PC, 8)
101+
#define DISP_COM_PIN GPIO_PIN(PC, 6)
102+
#define DISP_ENABLE_PIN GPIO_PIN(PC, 9)
103+
/** @} */
104+
105+
/**
106+
* @name Flash configuration
107+
*
108+
* Connection to the on-board MX25R8035F.
109+
* @{
110+
*/
111+
#define FLASH_SPI SPI_DEV(0)
112+
#define FLASH_CS_PIN GPIO_PIN(PC, 4)
113+
/** @} */
114+
115+
/**
116+
* @name Sensor configuration
117+
*
118+
* Connection to the on-board Si7021 temperature & humidity sensor.
119+
* @{
120+
*/
121+
#define SENSOR_I2C I2C_DEV(0)
122+
#define SENSOR_ENABLE_PIN GPIO_PIN(PC, 9)
123+
/** @} */
124+
125+
/**
126+
* @brief Initialize board specific hardware
127+
*/
128+
void board_init(void);
129+
130+
#ifdef __cplusplus
131+
}
132+
#endif
133+
134+
#endif /* BOARD_H */
135+
/** @} */
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
/*
2+
* Copyright (C) 2022 SSV Software Systems GmbH
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @ingroup boards_xg23b-pk6068a
11+
* @{
12+
*
13+
* @file
14+
* @brief Board specific configuration of direct mapped GPIOs
15+
*
16+
* @author Juergen Fitschen <[email protected]>
17+
*/
18+
19+
#ifndef GPIO_PARAMS_H
20+
#define GPIO_PARAMS_H
21+
22+
#include "board.h"
23+
#include "saul/periph.h"
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
/**
30+
* @brief GPIO pin configuration
31+
*/
32+
static const saul_gpio_params_t saul_gpio_params[] =
33+
{
34+
{
35+
.name = "LED 0",
36+
.pin = LED0_PIN,
37+
.mode = GPIO_OUT
38+
},
39+
{
40+
.name = "LED 1",
41+
.pin = LED1_PIN,
42+
.mode = GPIO_OUT
43+
},
44+
{
45+
.name = "Button 1",
46+
.pin = PB0_PIN,
47+
.mode = GPIO_IN_PU,
48+
.flags = SAUL_GPIO_INVERTED
49+
},
50+
{
51+
.name = "Button 2",
52+
.pin = PB1_PIN,
53+
.mode = GPIO_IN_PU,
54+
.flags = SAUL_GPIO_INVERTED
55+
}
56+
};
57+
58+
#ifdef __cplusplus
59+
}
60+
#endif
61+
62+
#endif /* GPIO_PARAMS_H */
63+
/** @} */

0 commit comments

Comments
 (0)