14
14
*/
15
15
struct rpi_pinctrl_soc_pin {
16
16
/** Pin number 0..29 */
17
- uint32_t pin_num : 5 ;
17
+ uint32_t pin_num : 5 ;
18
18
/** Alternative function (UART, SPI, etc.) */
19
- uint32_t alt_func : 5 ;
19
+ uint32_t alt_func : 5 ;
20
20
/** Maximum current used by a pin, in mA */
21
- uint32_t drive_strength : 4 ;
21
+ uint32_t drive_strength : 4 ;
22
22
/** Slew rate, may be either false (slow) or true (fast) */
23
- uint32_t slew_rate : 1 ;
23
+ uint32_t slew_rate : 1 ;
24
24
/** Enable the internal pull up resistor */
25
- uint32_t pullup : 1 ;
25
+ uint32_t pullup : 1 ;
26
26
/** Enable the internal pull down resistor */
27
- uint32_t pulldown : 1 ;
27
+ uint32_t pulldown : 1 ;
28
28
/** Enable the pin as an input */
29
- uint32_t input_enable : 1 ;
29
+ uint32_t input_enable : 1 ;
30
30
/** Enable the internal schmitt trigger */
31
- uint32_t schmitt_enable : 1 ;
31
+ uint32_t schmitt_enable : 1 ;
32
32
/** Output-enable override */
33
- uint32_t oe_override : 2 ;
33
+ uint32_t oe_override : 2 ;
34
34
/** Output override */
35
- uint32_t out_override : 2 ;
35
+ uint32_t out_override : 2 ;
36
36
/** Input override */
37
- uint32_t in_override : 2 ;
37
+ uint32_t in_override : 2 ;
38
38
/** Interrupt override */
39
- uint32_t irq_override : 2 ;
39
+ uint32_t irq_override : 2 ;
40
40
};
41
41
42
42
typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t ;
@@ -48,20 +48,20 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
48
48
* @param prop Property name.
49
49
* @param idx Property entry index.
50
50
*/
51
- #define Z_PINCTRL_STATE_PIN_INIT (node_id , prop , idx ) \
52
- { \
53
- RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
54
- RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
55
- DT_ENUM_IDX(node_id, drive_strength), \
56
- DT_ENUM_IDX(node_id, slew_rate), \
57
- DT_PROP(node_id, bias_pull_up), \
58
- DT_PROP(node_id, bias_pull_down), \
59
- DT_PROP(node_id, input_enable), \
60
- DT_PROP(node_id, input_schmitt_enable), \
61
- DT_PROP(node_id, raspberrypi_oe_override), \
62
- DT_PROP(node_id, raspberrypi_out_override), \
63
- DT_PROP(node_id, raspberrypi_in_override), \
64
- DT_PROP(node_id, raspberrypi_irq_override), \
51
+ #define Z_PINCTRL_STATE_PIN_INIT (node_id , prop , idx ) \
52
+ { \
53
+ RP2_GET_PIN_NUM(DT_PROP_BY_IDX(node_id, prop, idx)), \
54
+ RP2_GET_PIN_ALT_FUNC(DT_PROP_BY_IDX(node_id, prop, idx)), \
55
+ DT_ENUM_IDX(node_id, drive_strength), \
56
+ DT_ENUM_IDX(node_id, slew_rate), \
57
+ DT_PROP(node_id, bias_pull_up), \
58
+ DT_PROP(node_id, bias_pull_down), \
59
+ DT_PROP(node_id, input_enable), \
60
+ DT_PROP(node_id, input_schmitt_enable), \
61
+ DT_PROP(node_id, raspberrypi_oe_override), \
62
+ DT_PROP(node_id, raspberrypi_out_override), \
63
+ DT_PROP(node_id, raspberrypi_in_override), \
64
+ DT_PROP(node_id, raspberrypi_irq_override), \
65
65
},
66
66
67
67
/**
@@ -70,14 +70,11 @@ typedef struct rpi_pinctrl_soc_pin pinctrl_soc_pin_t;
70
70
* @param node_id Node identifier.
71
71
* @param prop Property name describing state pins.
72
72
*/
73
- #define Z_PINCTRL_STATE_PINS_INIT (node_id , prop ) \
74
- {DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), \
75
- DT_FOREACH_PROP_ELEM, pinmux, \
73
+ #define Z_PINCTRL_STATE_PINS_INIT (node_id , prop ) \
74
+ {DT_FOREACH_CHILD_VARGS(DT_PHANDLE(node_id, prop), DT_FOREACH_PROP_ELEM, pinmux, \
76
75
Z_PINCTRL_STATE_PIN_INIT)}
77
76
78
- #define RP2_GET_PIN_NUM (pinctrl ) \
79
- (((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
80
- #define RP2_GET_PIN_ALT_FUNC (pinctrl ) \
81
- (((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
77
+ #define RP2_GET_PIN_NUM (pinctrl ) (((pinctrl) >> RP2_PIN_NUM_POS) & RP2_PIN_NUM_MASK)
78
+ #define RP2_GET_PIN_ALT_FUNC (pinctrl ) (((pinctrl) >> RP2_ALT_FUNC_POS) & RP2_ALT_FUNC_MASK)
82
79
83
80
#endif /* ZEPHYR_SOC_ARM_RPI_PICO_RP2_PINCTRL_SOC_H_ */
0 commit comments