@@ -31,6 +31,10 @@ Includes <System Includes> , "Project Includes"
31
31
#define BSP_PROP_HAS_STATUS_OKAY_OR (node_id , prop , default_value ) \
32
32
(COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), (DT_PROP(node_id, prop)), (default_value)))
33
33
34
+ #define BSP_PROP_HAS_STATUS_OKAY_ENUM (node_id , prop , default_value ) \
35
+ (COND_CODE_1(DT_NODE_HAS_STATUS(node_id, okay), \
36
+ (DT_ENUM_IDX(node_id, prop)), (default_value)))
37
+
34
38
/***********************************************************************************************************************
35
39
Macro definitions
36
40
***********************************************************************************************************************/
@@ -50,8 +54,10 @@ Macro definitions
50
54
/* Specifies the target to be monitored for each channel. */
51
55
/* 0: VCC (default value) */
52
56
/* 1: CMPA2 pin */
53
- #define LVD_CFG_VDET_TARGET_CHANNEL_1 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd0), vdet_target, 0)
54
- #define LVD_CFG_VDET_TARGET_CHANNEL_2 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd1), vdet_target, 0)
57
+ #define LVD_CFG_VDET_TARGET_CHANNEL_1 \
58
+ BSP_PROP_HAS_STATUS_OKAY_ENUM(DT_NODELABEL(lvd0), vdet_target, 0)
59
+ #define LVD_CFG_VDET_TARGET_CHANNEL_2 \
60
+ BSP_PROP_HAS_STATUS_OKAY_ENUM(DT_NODELABEL(lvd1), vdet_target, 0)
55
61
56
62
/* Specifies the voltage detection level for each channel. Set an integer value */
57
63
/* which expresses the number up to two decimal places. */
@@ -62,8 +68,10 @@ Macro definitions
62
68
/* To set the voltage detection level to 4.29 V, specify '429'. */
63
69
/* To set the voltage detection level to default value, specify '0xFFFF' . */
64
70
65
- #define LVD_CFG_VOLTAGE_LEVEL_CHANNEL_1 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd0), voltage_level, 0)
66
- #define LVD_CFG_VOLTAGE_LEVEL_CHANNEL_2 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd1), voltage_level, 0)
71
+ #define LVD_CFG_VOLTAGE_LEVEL_CHANNEL_1 \
72
+ BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd0), voltage_level, 0)
73
+ #define LVD_CFG_VOLTAGE_LEVEL_CHANNEL_2 \
74
+ BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd1), voltage_level, 0)
67
75
68
76
/* Specifies enable/disable of the digital filter for each channel. */
69
77
/* 0: Digital filter is disabled. (default value) */
@@ -93,8 +101,8 @@ Macro definitions
93
101
/* reset is selected with this definition, the operation of the reset is not */
94
102
/* dependent on the voltage detection condition. */
95
103
96
- #define LVD_CFG_ACTION_CHANNEL_1 BSP_PROP_HAS_STATUS_OKAY_OR (DT_NODELABEL(lvd0), lvd_action, 0)
97
- #define LVD_CFG_ACTION_CHANNEL_2 BSP_PROP_HAS_STATUS_OKAY_OR (DT_NODELABEL(lvd1), lvd_action, 0)
104
+ #define LVD_CFG_ACTION_CHANNEL_1 BSP_PROP_HAS_STATUS_OKAY_ENUM (DT_NODELABEL(lvd0), lvd_action, 0)
105
+ #define LVD_CFG_ACTION_CHANNEL_2 BSP_PROP_HAS_STATUS_OKAY_ENUM (DT_NODELABEL(lvd1), lvd_action, 0)
98
106
99
107
/* Specifies the interrupt priority level for each channel, with maskable interrupt */
100
108
/* selected as processing. */
@@ -114,8 +122,11 @@ Macro definitions
114
122
/* 1: Negation occurs when a certain period elapses after the LVD reset assertion. */
115
123
/* Note: "a certain period" here means a wait time after a voltage monitoring */
116
124
/* reset. Refer to the User's Manual: Hardware for details. */
117
- #define LVD_CFG_STABILIZATION_CHANNEL_1 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd0), lvd_stabilization, 0)
118
- #define LVD_CFG_STABILIZATION_CHANNEL_2 BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd1), lvd_stabilization, 0)
125
+ #define LVD_CFG_STABILIZATION_CHANNEL_1 \
126
+ BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd0), lvd_stabilization, 0)
127
+ #define LVD_CFG_STABILIZATION_CHANNEL_2 \
128
+ BSP_PROP_HAS_STATUS_OKAY_OR(DT_NODELABEL(lvd1), lvd_stabilization, 0)
129
+
119
130
/* Enable Nested Interrupt */
120
131
/* 0 : Disable nested interrupt. */
121
132
/* 1 : Enable nested interrupt. */
0 commit comments