104 struct rt_pin_irqchip irqchip;
119#define PIN_MODE_OUTPUT 0x00
120#define PIN_MODE_INPUT 0x01
121#define PIN_MODE_INPUT_PULLUP 0x02
122#define PIN_MODE_INPUT_PULLDOWN 0x03
123#define PIN_MODE_OUTPUT_OD 0x04
125#ifdef RT_USING_PINCTRL
128 PIN_CONFIG_BIAS_BUS_HOLD,
129 PIN_CONFIG_BIAS_DISABLE,
130 PIN_CONFIG_BIAS_HIGH_IMPEDANCE,
131 PIN_CONFIG_BIAS_PULL_DOWN,
132 PIN_CONFIG_BIAS_PULL_PIN_DEFAULT,
133 PIN_CONFIG_BIAS_PULL_UP,
134 PIN_CONFIG_DRIVE_OPEN_DRAIN,
135 PIN_CONFIG_DRIVE_OPEN_SOURCE,
136 PIN_CONFIG_DRIVE_PUSH_PULL,
137 PIN_CONFIG_DRIVE_STRENGTH,
138 PIN_CONFIG_DRIVE_STRENGTH_UA,
139 PIN_CONFIG_INPUT_DEBOUNCE,
140 PIN_CONFIG_INPUT_ENABLE,
141 PIN_CONFIG_INPUT_SCHMITT,
142 PIN_CONFIG_INPUT_SCHMITT_ENABLE,
143 PIN_CONFIG_MODE_LOW_POWER,
146 PIN_CONFIG_OUTPUT_ENABLE,
147 PIN_CONFIG_OUTPUT_IMPEDANCE_OHMS,
148 PIN_CONFIG_PERSIST_STATE,
149 PIN_CONFIG_POWER_SOURCE,
150 PIN_CONFIG_SKEW_DELAY,
151 PIN_CONFIG_SLEEP_HARDWARE_STATE,
152 PIN_CONFIG_SLEW_RATE,
153 PIN_CONFIG_END = 0x7f,
154 PIN_CONFIG_MAX = 0xff,
158#define PIN_IRQ_MODE_RISING 0x00
159#define PIN_IRQ_MODE_FALLING 0x01
160#define PIN_IRQ_MODE_RISING_FALLING 0x02
161#define PIN_IRQ_MODE_HIGH_LEVEL 0x03
162#define PIN_IRQ_MODE_LOW_LEVEL 0x04
164#define PIN_IRQ_DISABLE 0x00
165#define PIN_IRQ_ENABLE 0x01
167#define PIN_IRQ_PIN_NONE PIN_NONE
198#ifdef RT_USING_PINCTRL
202struct rt_pin_ctrl_conf_params
204 const char *propname;
219 rt_uint8_t mode, void (*hdr)(
void *args),
void *args);
228#ifdef RT_USING_PINCTRL
279 void (*hdr)(
void *args),
void *args);
316#ifdef RT_USING_PINCTRL
319rt_err_t rt_pin_ctrl_confs_apply_by_name(
struct rt_device *device,
const char *name);
int rt_device_pin_register(const char *name, const struct rt_pin_ops *ops, void *user_data)
register a pin device
rt_err_t rt_pin_detach_irq(rt_base_t pin)
detach the pin interrupt callback function
void rt_pin_write(rt_base_t pin, rt_ssize_t value)
write pin value
void rt_pin_mode(rt_base_t pin, rt_uint8_t mode)
set pin mode
rt_err_t rt_pin_irq_enable(rt_base_t pin, rt_uint8_t enabled)
enable or disable the pin interrupt
rt_base_t rt_pin_get(const char *name)
get pin number by name
rt_err_t rt_pin_debounce(rt_base_t pin, rt_uint32_t debounce)
set the pin's debounce time
rt_ssize_t rt_pin_read(rt_base_t pin)
read pin value
rt_err_t rt_pin_attach_irq(rt_base_t pin, rt_uint8_t mode, void(*hdr)(void *args), void *args)
bind the pin interrupt callback function
struct rt_list_node rt_list_t
const struct rt_pin_ops * ops
rt_err_t(* pin_irq_enable)(struct rt_device *device, rt_base_t pin, rt_uint8_t enabled)
rt_ssize_t(* pin_read)(struct rt_device *device, rt_base_t pin)
rt_err_t(* pin_debounce)(struct rt_device *device, rt_base_t pin, rt_uint32_t debounce)
rt_err_t(* pin_detach_irq)(struct rt_device *device, rt_base_t pin)
void(* pin_write)(struct rt_device *device, rt_base_t pin, rt_uint8_t value)
rt_err_t(* pin_attach_irq)(struct rt_device *device, rt_base_t pin, rt_uint8_t mode, void(*hdr)(void *args), void *args)
rt_base_t(* pin_get)(const char *name)
void(* pin_mode)(struct rt_device *device, rt_base_t pin, rt_uint8_t mode)