1
0
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:
Marian Buschsieweke 2024-01-23 08:15:28 +01:00
parent 8aab69e93d
commit 06a05370a2
No known key found for this signature in database
GPG Key ID: 77AA882EC78084E6
2 changed files with 13 additions and 0 deletions

View File

@ -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

View File

@ -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));