mirror of https://github.com/ARMmbed/mbed-os.git
Silabs - Fix unblock/block declaration, implement gpio_is_connected
parent
299385b833
commit
0074b34e34
|
@ -17,6 +17,7 @@
|
||||||
#include "pinmap.h"
|
#include "pinmap.h"
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
#include "mbed_assert.h"
|
#include "mbed_assert.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
uint8_t gpio_get_index(gpio_t *obj)
|
uint8_t gpio_get_index(gpio_t *obj)
|
||||||
{
|
{
|
||||||
|
|
|
@ -25,6 +25,7 @@
|
||||||
#include "em_int.h"
|
#include "em_int.h"
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
#define NUM_GPIO_CHANNELS (16)
|
#define NUM_GPIO_CHANNELS (16)
|
||||||
#define GPIO_LEAST_ACTIVE_SLEEPMODE EM3
|
#define GPIO_LEAST_ACTIVE_SLEEPMODE EM3
|
||||||
|
|
|
@ -48,6 +48,10 @@ static inline int gpio_read(gpio_t *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline int gpio_is_connected(const gpio_t *obj) {
|
||||||
|
return obj->pin != (PinName)NC;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "i2c_api.h"
|
#include "i2c_api.h"
|
||||||
#include "PeripheralPins.h"
|
#include "PeripheralPins.h"
|
||||||
#include "pinmap_function.h"
|
#include "pinmap_function.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
#include "em_i2c.h"
|
#include "em_i2c.h"
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
#include "em_rtc.h"
|
#include "em_rtc.h"
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
static bool rtc_inited = false;
|
static bool rtc_inited = false;
|
||||||
static time_t time_base = 0;
|
static time_t time_base = 0;
|
||||||
|
|
|
@ -36,6 +36,7 @@
|
||||||
#include "dma_api.h"
|
#include "dma_api.h"
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
#include "buffer.h"
|
#include "buffer.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
#define SERIAL_LEAST_ACTIVE_SLEEPMODE EM1
|
#define SERIAL_LEAST_ACTIVE_SLEEPMODE EM1
|
||||||
#define SERIAL_LEAST_ACTIVE_SLEEPMODE_LEUART EM2
|
#define SERIAL_LEAST_ACTIVE_SLEEPMODE_LEUART EM2
|
||||||
|
@ -227,7 +228,7 @@ inline IRQn_Type serial_get_rx_irq_index(serial_t *obj)
|
||||||
default:
|
default:
|
||||||
MBED_ASSERT(0);
|
MBED_ASSERT(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return (IRQn_Type)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -270,7 +271,7 @@ inline IRQn_Type serial_get_tx_irq_index(serial_t *obj)
|
||||||
default:
|
default:
|
||||||
MBED_ASSERT(0);
|
MBED_ASSERT(0);
|
||||||
}
|
}
|
||||||
return 0;
|
return (IRQn_Type)0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -18,6 +18,7 @@
|
||||||
#if DEVICE_SLEEP
|
#if DEVICE_SLEEP
|
||||||
|
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
#include "cmsis.h"
|
#include "cmsis.h"
|
||||||
#include "em_emu.h"
|
#include "em_emu.h"
|
||||||
#include "em_int.h"
|
#include "em_int.h"
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
/* mbed Microcontroller Library
|
||||||
|
* Copyright (c) 2015 ARM Limited
|
||||||
|
*
|
||||||
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
* you may not use this file except in compliance with the License.
|
||||||
|
* You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
#ifndef MBED_SLEEPMODES_H
|
||||||
|
#define MBED_SLEEPMODES_H
|
||||||
|
|
||||||
|
#include "em_gpio.h"
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
|
void blockSleepMode(sleepstate_enum minimumMode);
|
||||||
|
void unblockSleepMode(sleepstate_enum minimumMode);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif
|
|
@ -30,6 +30,7 @@
|
||||||
#include "em_cmu.h"
|
#include "em_cmu.h"
|
||||||
#include "em_dma.h"
|
#include "em_dma.h"
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
static uint16_t fill_word = SPI_FILL_WORD;
|
static uint16_t fill_word = SPI_FILL_WORD;
|
||||||
#define SPI_LEAST_ACTIVE_SLEEPMODE EM1
|
#define SPI_LEAST_ACTIVE_SLEEPMODE EM1
|
||||||
|
|
|
@ -23,6 +23,7 @@
|
||||||
#include "device.h"
|
#include "device.h"
|
||||||
#include "clocking.h"
|
#include "clocking.h"
|
||||||
#include "sleep_api.h"
|
#include "sleep_api.h"
|
||||||
|
#include "sleepmodes.h"
|
||||||
|
|
||||||
#define TIMER_LEAST_ACTIVE_SLEEPMODE EM1
|
#define TIMER_LEAST_ACTIVE_SLEEPMODE EM1
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue