mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
cpu/sam0_common: Implement gpio_ll_switch_dir
This commit is contained in:
parent
8aab69e93d
commit
06a05370a2
@ -21,6 +21,7 @@ FEATURES_PROVIDED += periph_gpio_ll_irq
|
||||
FEATURES_PROVIDED += periph_gpio_ll_irq_level_triggered_high
|
||||
FEATURES_PROVIDED += periph_gpio_ll_irq_level_triggered_low
|
||||
FEATURES_PROVIDED += periph_gpio_ll_irq_unmask
|
||||
FEATURES_PROVIDED += periph_gpio_ll_switch_dir
|
||||
FEATURES_PROVIDED += periph_i2c_reconfigure
|
||||
FEATURES_PROVIDED += periph_rtt_overflow
|
||||
FEATURES_PROVIDED += periph_rtt_set_counter
|
||||
|
@ -106,6 +106,18 @@ static inline void gpio_ll_write(gpio_port_t port, uword_t mask)
|
||||
p->OUT.reg = mask;
|
||||
}
|
||||
|
||||
static inline void gpio_ll_switch_dir_output(gpio_port_t port, uword_t outputs)
|
||||
{
|
||||
PortGroup *p = (PortGroup *)port;
|
||||
p->DIRSET.reg = outputs;
|
||||
}
|
||||
|
||||
static inline void gpio_ll_switch_dir_input(gpio_port_t port, uword_t inputs)
|
||||
{
|
||||
PortGroup *p = (PortGroup *)port;
|
||||
p->DIRCLR.reg = inputs;
|
||||
}
|
||||
|
||||
static inline gpio_port_t gpio_get_port(gpio_t pin)
|
||||
{
|
||||
return (gpio_port_t)(pin & ~(0x1f));
|
||||
|
Loading…
Reference in New Issue
Block a user