mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #1091 from stevew817/master
Silicon Labs - Set the default status for an input pin to PullUp instead of PullDownpull/1093/head
commit
4ba4c0d5b9
|
@ -64,7 +64,7 @@
|
||||||
#define HFRCO_FREQUENCY CMU_HFRCOCTRL_BAND_14MHZ
|
#define HFRCO_FREQUENCY CMU_HFRCOCTRL_BAND_14MHZ
|
||||||
|
|
||||||
#define LFXO_FREQUENCY 32768
|
#define LFXO_FREQUENCY 32768
|
||||||
#define HFXO_FREQUENCY 32000000
|
#define HFXO_FREQUENCY 48000000
|
||||||
|
|
||||||
#if (LOW_ENERGY_CLOCK_SOURCE == LFXO)
|
#if (LOW_ENERGY_CLOCK_SOURCE == LFXO)
|
||||||
#define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY
|
#define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY
|
||||||
|
|
|
@ -64,7 +64,7 @@
|
||||||
#define HFRCO_FREQUENCY CMU_HFRCOCTRL_BAND_14MHZ
|
#define HFRCO_FREQUENCY CMU_HFRCOCTRL_BAND_14MHZ
|
||||||
|
|
||||||
#define LFXO_FREQUENCY 32768
|
#define LFXO_FREQUENCY 32768
|
||||||
#define HFXO_FREQUENCY 32000000
|
#define HFXO_FREQUENCY 48000000
|
||||||
|
|
||||||
#if (LOW_ENERGY_CLOCK_SOURCE == LFXO)
|
#if (LOW_ENERGY_CLOCK_SOURCE == LFXO)
|
||||||
#define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY
|
#define LOW_ENERGY_CLOCK_FREQUENCY LFXO_FREQUENCY
|
||||||
|
|
|
@ -59,6 +59,12 @@ void gpio_mode(gpio_t *obj, PinMode mode)
|
||||||
{
|
{
|
||||||
obj->mode = mode; // Update object
|
obj->mode = mode; // Update object
|
||||||
pin_mode(obj->pin, mode); // Update register
|
pin_mode(obj->pin, mode); // Update register
|
||||||
|
|
||||||
|
//Handle pullup for input
|
||||||
|
if(mode == InputPullUp) {
|
||||||
|
//Set DOUT
|
||||||
|
GPIO->P[obj->port & 0xF].DOUTSET = 1 << (obj->pin & 0xF);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Used by DigitalInOut to set correct mode when direction is set
|
// Used by DigitalInOut to set correct mode when direction is set
|
||||||
|
|
Loading…
Reference in New Issue