nRF Connect SDK API 0.1.0
Loading...
Searching...
No Matches
board.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Nordic Semiconductor ASA
3 *
4 * SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5 */
6
7#ifndef __BOARD_H__
8#define __BOARD_H__
9
10#include <zephyr/kernel.h>
11
12/* Voltage divider PCA10121 board versions.
13 * The defines give what value the ADC will read back.
14 * This is determined by the on-board voltage divider.
15 */
16
18 char name[10];
19 uint32_t mask;
20 uint32_t adc_reg_val;
21};
22
23#define BOARD_PCA10121_0_0_0_MSK (BIT(0))
24#define BOARD_PCA10121_0_6_0_MSK (BIT(1))
25#define BOARD_PCA10121_0_7_0_MSK (BIT(2))
26#define BOARD_PCA10121_0_7_1_MSK (BIT(3))
27#define BOARD_PCA10121_0_8_0_MSK (BIT(4))
28#define BOARD_PCA10121_0_8_1_MSK (BIT(5))
29#define BOARD_PCA10121_0_8_2_MSK (BIT(6))
30#define BOARD_PCA10121_0_9_0_MSK (BIT(7))
31#define BOARD_PCA10121_0_10_0_MSK (BIT(8))
32#define BOARD_PCA10121_1_0_0_MSK (BIT(9))
33#define BOARD_PCA10121_1_1_0_MSK (BIT(10))
34#define BOARD_PCA10121_1_2_0_MSK (BIT(11))
35
36static const struct board_version BOARD_VERSION_ARR[] = {
37 { "0.0.0", BOARD_PCA10121_0_0_0_MSK, INT_MIN },
38 { "0.6.0", BOARD_PCA10121_0_6_0_MSK, 61 },
39 { "0.7.0", BOARD_PCA10121_0_7_0_MSK, 102 },
40 { "0.7.1", BOARD_PCA10121_0_7_1_MSK, 303 },
41 { "0.8.0", BOARD_PCA10121_0_8_0_MSK, 534 },
42 { "0.8.1", BOARD_PCA10121_0_8_1_MSK, 780 },
43 { "0.8.2", BOARD_PCA10121_0_8_2_MSK, 1018 },
44 { "0.9.0", BOARD_PCA10121_0_9_0_MSK, 1260 },
45 /* Lower value used on 0.10.0 due to high ohm divider */
46 { "0.10.0", BOARD_PCA10121_0_10_0_MSK, 1480 },
47 { "1.0.0", BOARD_PCA10121_1_0_0_MSK, 1743 },
48 { "1.1.0", BOARD_PCA10121_1_1_0_MSK, 1982 },
49 { "1.2.0", BOARD_PCA10121_1_2_0_MSK, 2219 },
50};
51
52#define BOARD_VERSION_VALID_MSK \
53 (BOARD_PCA10121_0_8_0_MSK | BOARD_PCA10121_0_8_1_MSK | BOARD_PCA10121_0_8_2_MSK | \
54 BOARD_PCA10121_0_9_0_MSK | BOARD_PCA10121_0_10_0_MSK | BOARD_PCA10121_1_0_0_MSK | \
55 BOARD_PCA10121_1_1_0_MSK | BOARD_PCA10121_1_2_0_MSK)
56
57#define BOARD_VERSION_VALID_MSK_SD_CARD \
58 (BOARD_PCA10121_0_8_0_MSK | BOARD_PCA10121_0_8_1_MSK | BOARD_PCA10121_0_8_2_MSK | \
59 BOARD_PCA10121_0_9_0_MSK | BOARD_PCA10121_0_10_0_MSK | BOARD_PCA10121_1_0_0_MSK | \
60 BOARD_PCA10121_1_1_0_MSK | BOARD_PCA10121_1_2_0_MSK)
61
62#endif
#define BOARD_PCA10121_0_8_1_MSK
Definition: board.h:28
#define BOARD_PCA10121_0_9_0_MSK
Definition: board.h:30
static const struct board_version BOARD_VERSION_ARR[]
Definition: board.h:36
#define BOARD_PCA10121_1_2_0_MSK
Definition: board.h:34
#define BOARD_PCA10121_0_8_0_MSK
Definition: board.h:27
#define BOARD_PCA10121_1_0_0_MSK
Definition: board.h:32
#define BOARD_PCA10121_0_7_1_MSK
Definition: board.h:26
#define BOARD_PCA10121_0_10_0_MSK
Definition: board.h:31
#define BOARD_PCA10121_0_7_0_MSK
Definition: board.h:25
#define BOARD_PCA10121_0_8_2_MSK
Definition: board.h:29
#define BOARD_PCA10121_0_0_0_MSK
Definition: board.h:23
#define BOARD_PCA10121_1_1_0_MSK
Definition: board.h:33
#define BOARD_PCA10121_0_6_0_MSK
Definition: board.h:24
char name[10]
Definition: board.h:18
uint32_t mask
Definition: board.h:19
uint32_t adc_reg_val
Definition: board.h:20
Definition: board.h:17