gpio: deprecate gpio pin callback enable and disable API
These have been replaced by the appropriate call to gpio_pin_interrupt_configure(). While the disable function could be implemented using the new functionality, the enable function cannot because the interrupt mode is not available. Consequently we cannot replace these with equivalent functionality using the legacy API. Clean up the internal implementation by removing the inaccessible port-based enable/disable feature, leaving the pin-based capability in place. Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
parent
e999f7c6fb
commit
1947481cce
22 changed files with 90 additions and 302 deletions
|
@ -331,47 +331,23 @@ static int gpio_sam_manage_callback(struct device *port,
|
|||
}
|
||||
|
||||
static int gpio_sam_enable_callback(struct device *port,
|
||||
int access_op, u32_t pin)
|
||||
u32_t pin)
|
||||
{
|
||||
const struct gpio_sam_config * const cfg = DEV_CFG(port);
|
||||
Pio * const pio = cfg->regs;
|
||||
u32_t mask;
|
||||
|
||||
switch (access_op) {
|
||||
case GPIO_ACCESS_BY_PIN:
|
||||
mask = BIT(pin);
|
||||
break;
|
||||
case GPIO_ACCESS_BY_PORT:
|
||||
mask = 0xFFFFFFFF;
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
pio->PIO_IER |= mask;
|
||||
pio->PIO_IER |= BIT(pin);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int gpio_sam_disable_callback(struct device *port,
|
||||
int access_op, u32_t pin)
|
||||
u32_t pin)
|
||||
{
|
||||
const struct gpio_sam_config * const cfg = DEV_CFG(port);
|
||||
Pio * const pio = cfg->regs;
|
||||
u32_t mask;
|
||||
|
||||
switch (access_op) {
|
||||
case GPIO_ACCESS_BY_PIN:
|
||||
mask = BIT(pin);
|
||||
break;
|
||||
case GPIO_ACCESS_BY_PORT:
|
||||
mask = 0xFFFFFFFF;
|
||||
break;
|
||||
default:
|
||||
return -ENOTSUP;
|
||||
}
|
||||
|
||||
pio->PIO_IDR |= mask;
|
||||
pio->PIO_IDR |= BIT(pin);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue