mirror of https://github.com/ARMmbed/mbed-os.git
K64F: Add gpio_get_capabilities()
Remove the gpio_pinmap() for this target. GPIO tests are skipped based on pin's capabilities.pull/12477/head
parent
ce65a80f82
commit
1b894aa67a
|
@ -1,5 +1,5 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2013 ARM Limited
|
* Copyright (c) 2006-2020 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -22,10 +22,6 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
GPIO_X = 0, // dummy peripheral used instead of GPIO_A..GPIO_E
|
|
||||||
} GPIOName;
|
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
OSC32KCLK = 0,
|
OSC32KCLK = 0,
|
||||||
} RTCName;
|
} RTCName;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2013 ARM Limited
|
* Copyright (c) 2006-2020 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -19,118 +19,6 @@
|
||||||
|
|
||||||
#include <mstd_cstddef>
|
#include <mstd_cstddef>
|
||||||
|
|
||||||
/************GPIO***************/
|
|
||||||
MSTD_CONSTEXPR_OBJ_11 PinMap PinMap_GPIO[] = {
|
|
||||||
{PTA0, GPIO_X, 1},
|
|
||||||
{PTA1, GPIO_X, 1},
|
|
||||||
{PTA2, GPIO_X, 1},
|
|
||||||
{PTA3, GPIO_X, 1},
|
|
||||||
{PTA4, GPIO_X, 1},
|
|
||||||
{PTA5, GPIO_X, 1},
|
|
||||||
{PTA6, GPIO_X, 1},
|
|
||||||
{PTA7, GPIO_X, 1},
|
|
||||||
{PTA8, GPIO_X, 1},
|
|
||||||
{PTA9, GPIO_X, 1},
|
|
||||||
{PTA10, GPIO_X, 1},
|
|
||||||
{PTA11, GPIO_X, 1},
|
|
||||||
{PTA12, GPIO_X, 1},
|
|
||||||
{PTA13, GPIO_X, 1},
|
|
||||||
{PTA14, GPIO_X, 1},
|
|
||||||
{PTA15, GPIO_X, 1},
|
|
||||||
{PTA16, GPIO_X, 1},
|
|
||||||
{PTA17, GPIO_X, 1},
|
|
||||||
{PTA18, GPIO_X, 1},
|
|
||||||
{PTA19, GPIO_X, 1},
|
|
||||||
{PTA24, GPIO_X, 1},
|
|
||||||
{PTA25, GPIO_X, 1},
|
|
||||||
{PTA26, GPIO_X, 1},
|
|
||||||
{PTA27, GPIO_X, 1},
|
|
||||||
{PTA28, GPIO_X, 1},
|
|
||||||
{PTA29, GPIO_X, 1},
|
|
||||||
|
|
||||||
{PTB0, GPIO_X, 1},
|
|
||||||
{PTB1, GPIO_X, 1},
|
|
||||||
{PTB2, GPIO_X, 1},
|
|
||||||
{PTB3, GPIO_X, 1},
|
|
||||||
{PTB4, GPIO_X, 1},
|
|
||||||
{PTB5, GPIO_X, 1},
|
|
||||||
{PTB6, GPIO_X, 1},
|
|
||||||
{PTB7, GPIO_X, 1},
|
|
||||||
{PTB8, GPIO_X, 1},
|
|
||||||
{PTB9, GPIO_X, 1},
|
|
||||||
{PTB10, GPIO_X, 1},
|
|
||||||
{PTB11, GPIO_X, 1},
|
|
||||||
{PTB12, GPIO_X, 1},
|
|
||||||
{PTB13, GPIO_X, 1},
|
|
||||||
{PTB16, GPIO_X, 1},
|
|
||||||
{PTB17, GPIO_X, 1},
|
|
||||||
{PTB18, GPIO_X, 1},
|
|
||||||
{PTB19, GPIO_X, 1},
|
|
||||||
{PTB20, GPIO_X, 1},
|
|
||||||
{PTB21, GPIO_X, 1},
|
|
||||||
{PTB22, GPIO_X, 1},
|
|
||||||
{PTB23, GPIO_X, 1},
|
|
||||||
|
|
||||||
{PTC0, GPIO_X, 1},
|
|
||||||
{PTC1, GPIO_X, 1},
|
|
||||||
{PTC2, GPIO_X, 1},
|
|
||||||
{PTC3, GPIO_X, 1},
|
|
||||||
{PTC4, GPIO_X, 1},
|
|
||||||
{PTC5, GPIO_X, 1},
|
|
||||||
{PTC6, GPIO_X, 1},
|
|
||||||
{PTC7, GPIO_X, 1},
|
|
||||||
{PTC8, GPIO_X, 1},
|
|
||||||
{PTC9, GPIO_X, 1},
|
|
||||||
{PTC10, GPIO_X, 1},
|
|
||||||
{PTC11, GPIO_X, 1},
|
|
||||||
{PTC12, GPIO_X, 1},
|
|
||||||
{PTC13, GPIO_X, 1},
|
|
||||||
{PTC14, GPIO_X, 1},
|
|
||||||
{PTC15, GPIO_X, 1},
|
|
||||||
{PTC16, GPIO_X, 1},
|
|
||||||
{PTC17, GPIO_X, 1},
|
|
||||||
{PTC18, GPIO_X, 1},
|
|
||||||
{PTC19, GPIO_X, 1},
|
|
||||||
|
|
||||||
{PTD0, GPIO_X, 1},
|
|
||||||
{PTD1, GPIO_X, 1},
|
|
||||||
{PTD2, GPIO_X, 1},
|
|
||||||
{PTD3, GPIO_X, 1},
|
|
||||||
{PTD4, GPIO_X, 1},
|
|
||||||
{PTD5, GPIO_X, 1},
|
|
||||||
{PTD6, GPIO_X, 1},
|
|
||||||
{PTD7, GPIO_X, 1},
|
|
||||||
{PTD8, GPIO_X, 1},
|
|
||||||
{PTD9, GPIO_X, 1},
|
|
||||||
{PTD10, GPIO_X, 1},
|
|
||||||
{PTD11, GPIO_X, 1},
|
|
||||||
{PTD12, GPIO_X, 1},
|
|
||||||
{PTD13, GPIO_X, 1},
|
|
||||||
{PTD14, GPIO_X, 1},
|
|
||||||
{PTD15, GPIO_X, 1},
|
|
||||||
|
|
||||||
{PTE0, GPIO_X, 1},
|
|
||||||
{PTE1, GPIO_X, 1},
|
|
||||||
{PTE2, GPIO_X, 1},
|
|
||||||
{PTE3, GPIO_X, 1},
|
|
||||||
{PTE4, GPIO_X, 1},
|
|
||||||
{PTE5, GPIO_X, 1},
|
|
||||||
{PTE6, GPIO_X, 1},
|
|
||||||
{PTE7, GPIO_X, 1},
|
|
||||||
{PTE8, GPIO_X, 1},
|
|
||||||
{PTE9, GPIO_X, 1},
|
|
||||||
{PTE10, GPIO_X, 1},
|
|
||||||
{PTE11, GPIO_X, 1},
|
|
||||||
{PTE12, GPIO_X, 1},
|
|
||||||
// {PTE24, GPIO_X, 1}, // fixed pull-up (for I2C)
|
|
||||||
// {PTE25, GPIO_X, 1}, // fixed pull-up (for I2C)
|
|
||||||
{PTE26, GPIO_X, 1},
|
|
||||||
{PTE27, GPIO_X, 1},
|
|
||||||
{PTE28, GPIO_X, 1},
|
|
||||||
|
|
||||||
{NC, NC, 0}
|
|
||||||
};
|
|
||||||
|
|
||||||
/************RTC***************/
|
/************RTC***************/
|
||||||
MSTD_CONSTEXPR_OBJ_11 PinMap PinMap_RTC[] = {
|
MSTD_CONSTEXPR_OBJ_11 PinMap PinMap_RTC[] = {
|
||||||
{NC, OSC32KCLK, 0},
|
{NC, OSC32KCLK, 0},
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2013 ARM Limited
|
* Copyright (c) 2006-2020 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -16,8 +16,20 @@
|
||||||
|
|
||||||
#include "PeripheralPins.h"
|
#include "PeripheralPins.h"
|
||||||
#include "PeripheralPinMaps.h"
|
#include "PeripheralPinMaps.h"
|
||||||
|
#include "mbed_assert.h"
|
||||||
|
#include "hal/gpio_api.h"
|
||||||
|
|
||||||
const PinMap *gpio_pinmap()
|
void gpio_get_capabilities(gpio_t *obj, gpio_capabilities_t *cap)
|
||||||
{
|
{
|
||||||
return PinMap_GPIO;
|
MBED_ASSERT(obj->pin != (PinName)NC);
|
||||||
|
// fixed pull-ups (for I2C)
|
||||||
|
if (obj->pin == PTE24 || obj->pin == PTE25) {
|
||||||
|
cap->pull_none = 0;
|
||||||
|
cap->pull_down = 0;
|
||||||
|
cap->pull_up = 0;
|
||||||
|
} else {
|
||||||
|
cap->pull_none = 1;
|
||||||
|
cap->pull_down = 1;
|
||||||
|
cap->pull_up = 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* mbed Microcontroller Library
|
/* mbed Microcontroller Library
|
||||||
* Copyright (c) 2006-2013 ARM Limited
|
* Copyright (c) 2006-2020 ARM Limited
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -20,9 +20,6 @@
|
||||||
#include "pinmap.h"
|
#include "pinmap.h"
|
||||||
#include "PeripheralNames.h"
|
#include "PeripheralNames.h"
|
||||||
|
|
||||||
/************GPIO***************/
|
|
||||||
extern const PinMap PinMap_GPIO[];
|
|
||||||
|
|
||||||
/************RTC***************/
|
/************RTC***************/
|
||||||
extern const PinMap PinMap_RTC[];
|
extern const PinMap PinMap_RTC[];
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue