Skip to content

Commit 6fa4b46

Browse files
committed
Decorated all HALs with gpio_is_connected() function implementation
1 parent a53cd59 commit 6fa4b46

File tree

25 files changed

+100
-0
lines changed

25 files changed

+100
-0
lines changed

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_K20D50M/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ static inline int gpio_read(gpio_t *obj) {
4646
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4747
}
4848

49+
static inline int gpio_is_connected(const gpio_t *obj) {
50+
return obj->pin != (PinName)NC;
51+
}
52+
4953
#ifdef __cplusplus
5054
}
5155
#endif

libraries/mbed/targets/hal/TARGET_Freescale/TARGET_KLXX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NORDIC/TARGET_MCU_NRF51822/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11U6X/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11UXX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC11XX_11CXX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,10 @@ static inline int gpio_read(gpio_t *obj) {
4343
return ((*obj->reg_mask_read) ? 1 : 0);
4444
}
4545

46+
static inline int gpio_is_connected(const gpio_t *obj) {
47+
return obj->pin != (PinName)NC;
48+
}
49+
4650
#ifdef __cplusplus
4751
}
4852
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC13XX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC15XX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ static inline int gpio_read(gpio_t *obj) {
4646
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4747
}
4848

49+
static inline int gpio_is_connected(const gpio_t *obj) {
50+
return obj->pin != (PinName)NC;
51+
}
52+
4953
#ifdef __cplusplus
5054
}
5155
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC176X/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC23XX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC408X/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC43XX/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC81X/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ static inline int gpio_read(gpio_t *obj) {
4545
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4646
}
4747

48+
static inline int gpio_is_connected(const gpio_t *obj) {
49+
return obj->pin != (PinName)NC;
50+
}
51+
4852
#ifdef __cplusplus
4953
}
5054
#endif

libraries/mbed/targets/hal/TARGET_NXP/TARGET_LPC82X/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ static inline int gpio_read(gpio_t *obj)
4747
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4848
}
4949

50+
static inline int gpio_is_connected(const gpio_t *obj) {
51+
return obj->pin != (PinName)NC;
52+
}
53+
5054
#ifdef __cplusplus
5155
}
5256
#endif

libraries/mbed/targets/hal/TARGET_RENESAS/TARGET_RZ_A1H/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@ static inline int gpio_read(gpio_t *obj) {
4141
return ((*obj->reg_in & obj->mask) ? 1 : 0);
4242
}
4343

44+
static inline int gpio_is_connected(const gpio_t *obj) {
45+
return obj->pin != (PinName)NC;
46+
}
47+
4448
#ifdef __cplusplus
4549
}
4650
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F051R8/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F100RB/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ static inline int gpio_read(gpio_t *obj) {
6363
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6464
}
6565

66+
static inline int gpio_is_connected(const gpio_t *obj) {
67+
return obj->pin != (PinName)NC;
68+
}
69+
6670
#ifdef __cplusplus
6771
}
6872
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F303VC/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F334C8/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_F429ZI/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_DISCO_L053C8/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ static inline int gpio_read(gpio_t *obj) {
6262
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6363
}
6464

65+
static inline int gpio_is_connected(const gpio_t *obj) {
66+
return obj->pin != (PinName)NC;
67+
}
68+
6569
#ifdef __cplusplus
6670
}
6771
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_MTS_MDOT_F405RG/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ static inline int gpio_read(gpio_t *obj) {
6262
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6363
}
6464

65+
static inline int gpio_is_connected(const gpio_t *obj) {
66+
return obj->pin != (PinName)NC;
67+
}
68+
6569
#ifdef __cplusplus
6670
}
6771
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F030R8/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F072RB/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_F091RC/gpio_object.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ static inline int gpio_read(gpio_t *obj)
6464
return ((*obj->reg_in & obj->mask) ? 1 : 0);
6565
}
6666

67+
static inline int gpio_is_connected(const gpio_t *obj) {
68+
return obj->pin != (PinName)NC;
69+
}
70+
6771
#ifdef __cplusplus
6872
}
6973
#endif

0 commit comments

Comments
 (0)