Nuvoton: Add gpio_get_capabilities()

TARGET_NANO100, TARGET_NUC472 & TARGET_M451 do not support input pull
mode configuration.
pull/12477/head
Filip Jagodzinski 2020-02-19 16:34:45 +01:00
parent 1b894aa67a
commit 09ecd2fdc0
3 changed files with 27 additions and 3 deletions

View File

@ -1,5 +1,5 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* Copyright (c) 2015-2020 Nuvoton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -140,3 +140,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
pin_mode(obj->pin, obj->mode);
}
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
{
// Pull modes not supported.
cap->pull_none = 0;
cap->pull_down = 0;
cap->pull_up = 0;
}

View File

@ -1,5 +1,5 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2017 Nuvoton
* Copyright (c) 2015-2020 Nuvoton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -121,3 +121,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
pin_mode(obj->pin, obj->mode);
}
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
{
// Pull modes not supported.
cap->pull_none = 0;
cap->pull_down = 0;
cap->pull_up = 0;
}

View File

@ -1,5 +1,5 @@
/* mbed Microcontroller Library
* Copyright (c) 2015-2016 Nuvoton
* Copyright (c) 2015-2020 Nuvoton
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -140,3 +140,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
pin_mode(obj->pin, obj->mode);
}
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
{
// Pull modes not supported.
cap->pull_none = 0;
cap->pull_down = 0;
cap->pull_up = 0;
}