mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-01-17 05:12:57 +01:00
cpu/atmega_common: implement gpio_ll_switch_dir
This commit is contained in:
parent
6fb369d4fc
commit
c011764022
@ -12,6 +12,7 @@ FEATURES_PROVIDED += periph_gpio_ll_input_pull_up
|
||||
FEATURES_PROVIDED += periph_gpio_ll_irq
|
||||
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_pm
|
||||
FEATURES_PROVIDED += periph_rtc_ms
|
||||
FEATURES_PROVIDED += periph_rtt_overflow
|
||||
|
@ -184,6 +184,22 @@ static inline uword_t gpio_ll_prepare_write(gpio_port_t port, uword_t mask,
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline void gpio_ll_switch_dir_output(gpio_port_t port, uword_t outputs)
|
||||
{
|
||||
unsigned irq_state = irq_disable();
|
||||
atmega_gpio_port_t *p = (void *)port;
|
||||
p->ddr |= outputs;
|
||||
irq_restore(irq_state);
|
||||
}
|
||||
|
||||
static inline void gpio_ll_switch_dir_input(gpio_port_t port, uword_t inputs)
|
||||
{
|
||||
unsigned irq_state = irq_disable();
|
||||
atmega_gpio_port_t *p = (void *)port;
|
||||
p->ddr &= ~(inputs);
|
||||
irq_restore(irq_state);
|
||||
}
|
||||
|
||||
static inline gpio_port_t gpio_port_pack_addr(void *addr)
|
||||
{
|
||||
return (gpio_port_t)addr;
|
||||
|
Loading…
Reference in New Issue
Block a user