Skip to content

Commit 09ecd2f

Browse files
author
Filip Jagodzinski
committed
Nuvoton: Add gpio_get_capabilities()
TARGET_NANO100, TARGET_NUC472 & TARGET_M451 do not support input pull mode configuration.
1 parent 1b894aa commit 09ecd2f

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

targets/TARGET_NUVOTON/TARGET_M451/gpio_api.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2015-2016 Nuvoton
2+
* Copyright (c) 2015-2020 Nuvoton
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -140,3 +140,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
140140

141141
pin_mode(obj->pin, obj->mode);
142142
}
143+
144+
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
145+
{
146+
// Pull modes not supported.
147+
cap->pull_none = 0;
148+
cap->pull_down = 0;
149+
cap->pull_up = 0;
150+
}

targets/TARGET_NUVOTON/TARGET_NANO100/gpio_api.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2015-2017 Nuvoton
2+
* Copyright (c) 2015-2020 Nuvoton
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -121,3 +121,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
121121

122122
pin_mode(obj->pin, obj->mode);
123123
}
124+
125+
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
126+
{
127+
// Pull modes not supported.
128+
cap->pull_none = 0;
129+
cap->pull_down = 0;
130+
cap->pull_up = 0;
131+
}

targets/TARGET_NUVOTON/TARGET_NUC472/gpio_api.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* mbed Microcontroller Library
2-
* Copyright (c) 2015-2016 Nuvoton
2+
* Copyright (c) 2015-2020 Nuvoton
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -140,3 +140,11 @@ void gpio_dir(gpio_t *obj, PinDirection direction)
140140

141141
pin_mode(obj->pin, obj->mode);
142142
}
143+
144+
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
145+
{
146+
// Pull modes not supported.
147+
cap->pull_none = 0;
148+
cap->pull_down = 0;
149+
cap->pull_up = 0;
150+
}

0 commit comments

Comments
 (0)