Zephyr API Documentation  3.7.0
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
pinctrl_rcar_common.h File Reference

Go to the source code of this file.

Data Structures

struct  rcar_pin_func
 
struct  pinctrl_soc_pin
 Type for R-Car pin. More...
 
struct  pfc_drive_reg_field
 
struct  pfc_drive_reg
 
struct  pfc_bias_reg
 

Macros

#define RCAR_PIN_FLAGS_PULL_SET   BIT(0)
 Pull-up, pull-down, or bias disable is requested.
 
#define RCAR_PIN_FLAGS_PUEN   BIT(1)
 Performs on/off control of the pull resistors.
 
#define RCAR_PIN_FLAGS_PUD   BIT(2)
 Select pull-up resistor if set pull-down otherwise.
 
#define RCAR_PIN_FLAGS_FUNC_SET   BIT(3)
 Alternate function for the pin is requested.
 
#define RCAR_PIN_FLAGS_FUNC_DUMMY   BIT(4)
 Ignore IPSR settings for alternate function pin.
 
#define RCAR_PIN_PULL_UP   (RCAR_PIN_FLAGS_PULL_SET | RCAR_PIN_FLAGS_PUEN | RCAR_PIN_FLAGS_PUD)
 
#define RCAR_PIN_PULL_DOWN   (RCAR_PIN_FLAGS_PULL_SET | RCAR_PIN_FLAGS_PUEN)
 
#define RCAR_PIN_PULL_DISABLE   RCAR_PIN_FLAGS_PULL_SET
 
#define RCAR_IPSR(node_id)   DT_PROP_BY_IDX(node_id, pin, 1)
 
#define RCAR_HAS_IPSR(node_id)   DT_PROP_HAS_IDX(node_id, pin, 1)
 
#define RCAR_PIN_FUNC(node_id)
 
#define RCAR_PIN_IS_FUNC_DUMMY(node_id)
 
#define RCAR_PIN_FLAGS(node_id)
 
#define RCAR_DT_PIN(node_id)
 
#define RCAR_IS_GP_PIN(pin)   (pin < PIN_NOGPSR_START)
 Utility macro to check if a pin is GPIO capable.
 

Typedefs

typedef struct pinctrl_soc_pin pinctrl_soc_pin_t
 Type for R-Car pin.
 

Macro Definition Documentation

◆ RCAR_DT_PIN

#define RCAR_DT_PIN (   node_id)
Value:
{ \
.pin = DT_PROP_BY_IDX(node_id, pin, 0), \
.func = COND_CODE_1(RCAR_HAS_IPSR(node_id), \
(RCAR_PIN_FUNC(node_id)), {0}), \
.flags = RCAR_PIN_FLAGS(node_id), \
.drive_strength = \
COND_CODE_1(DT_NODE_HAS_PROP(node_id, drive_strength), \
(DT_PROP(node_id, drive_strength)), (0)), \
.voltage = COND_CODE_1(DT_NODE_HAS_PROP(node_id, \
power_source), \
(DT_PROP(node_id, power_source)), \
},
#define DT_NODE_HAS_PROP(node_id, prop)
Does a devicetree node have a property?
Definition: devicetree.h:3479
#define DT_PROP_BY_IDX(node_id, prop, idx)
Get the value at index idx in an array type property.
Definition: devicetree.h:809
#define DT_PROP(node_id, prop)
Get a devicetree property value.
Definition: devicetree.h:663
#define COND_CODE_1(_flag, _if_1_code, _else_code)
Insert code depending on whether _flag expands to 1 or not.
Definition: util_macro.h:179
flags
Definition: parser.h:96
#define PIN_VOLTAGE_NONE
Definition: pinctrl-rcar-common.h:97
#define RCAR_HAS_IPSR(node_id)
Definition: pinctrl_rcar_common.h:47
#define RCAR_PIN_FUNC(node_id)
Definition: pinctrl_rcar_common.h:50
#define RCAR_PIN_FLAGS(node_id)
Definition: pinctrl_rcar_common.h:62

◆ RCAR_HAS_IPSR

#define RCAR_HAS_IPSR (   node_id)    DT_PROP_HAS_IDX(node_id, pin, 1)

◆ RCAR_IPSR

#define RCAR_IPSR (   node_id)    DT_PROP_BY_IDX(node_id, pin, 1)

◆ RCAR_IS_GP_PIN

#define RCAR_IS_GP_PIN (   pin)    (pin < PIN_NOGPSR_START)

Utility macro to check if a pin is GPIO capable.

Parameters
pin
Returns
true if pin is GPIO capable false otherwise

◆ RCAR_PIN_FLAGS

#define RCAR_PIN_FLAGS (   node_id)
Value:
DT_PROP(node_id, bias_pull_up) * RCAR_PIN_PULL_UP | \
DT_PROP(node_id, bias_pull_down) * RCAR_PIN_PULL_DOWN | \
DT_PROP(node_id, bias_disable) * RCAR_PIN_PULL_DISABLE | \
RCAR_HAS_IPSR(node_id) * RCAR_PIN_FLAGS_FUNC_SET | \
RCAR_PIN_IS_FUNC_DUMMY(node_id) * RCAR_PIN_FLAGS_FUNC_DUMMY
#define RCAR_PIN_FLAGS_FUNC_DUMMY
Ignore IPSR settings for alternate function pin.
Definition: pinctrl_rcar_common.h:31
#define RCAR_PIN_PULL_DOWN
Definition: pinctrl_rcar_common.h:34
#define RCAR_PIN_PULL_UP
Definition: pinctrl_rcar_common.h:33
#define RCAR_PIN_PULL_DISABLE
Definition: pinctrl_rcar_common.h:35
#define RCAR_PIN_FLAGS_FUNC_SET
Alternate function for the pin is requested.
Definition: pinctrl_rcar_common.h:29

◆ RCAR_PIN_FLAGS_FUNC_DUMMY

#define RCAR_PIN_FLAGS_FUNC_DUMMY   BIT(4)

Ignore IPSR settings for alternate function pin.

◆ RCAR_PIN_FLAGS_FUNC_SET

#define RCAR_PIN_FLAGS_FUNC_SET   BIT(3)

Alternate function for the pin is requested.

◆ RCAR_PIN_FLAGS_PUD

#define RCAR_PIN_FLAGS_PUD   BIT(2)

Select pull-up resistor if set pull-down otherwise.

◆ RCAR_PIN_FLAGS_PUEN

#define RCAR_PIN_FLAGS_PUEN   BIT(1)

Performs on/off control of the pull resistors.

◆ RCAR_PIN_FLAGS_PULL_SET

#define RCAR_PIN_FLAGS_PULL_SET   BIT(0)

Pull-up, pull-down, or bias disable is requested.

◆ RCAR_PIN_FUNC

#define RCAR_PIN_FUNC (   node_id)
Value:
{ \
((RCAR_IPSR(node_id) >> 10U) & 0x1FU), \
((RCAR_IPSR(node_id) >> 4U) & 0x1FU), \
((RCAR_IPSR(node_id) & 0xFU)) \
}
#define RCAR_IPSR(node_id)
Definition: pinctrl_rcar_common.h:46

◆ RCAR_PIN_IS_FUNC_DUMMY

#define RCAR_PIN_IS_FUNC_DUMMY (   node_id)
Value:
((((RCAR_IPSR(node_id) >> 10U) & 0x1FU) == 0x1F) && \
(((RCAR_IPSR(node_id) >> 4U) & 0x1FU) == 0x1F) && \
((RCAR_IPSR(node_id) & 0xFU) == 0xF))

◆ RCAR_PIN_PULL_DISABLE

#define RCAR_PIN_PULL_DISABLE   RCAR_PIN_FLAGS_PULL_SET

◆ RCAR_PIN_PULL_DOWN

#define RCAR_PIN_PULL_DOWN   (RCAR_PIN_FLAGS_PULL_SET | RCAR_PIN_FLAGS_PUEN)

◆ RCAR_PIN_PULL_UP

#define RCAR_PIN_PULL_UP   (RCAR_PIN_FLAGS_PULL_SET | RCAR_PIN_FLAGS_PUEN | RCAR_PIN_FLAGS_PUD)

Typedef Documentation

◆ pinctrl_soc_pin_t

Type for R-Car pin.