For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found.

pull/2878/head
Sam Grove 2016-10-01 02:11:36 -05:00
parent b7fcfd93d8
commit 301b77c4b2
114 changed files with 336 additions and 552 deletions

View File

@ -14,9 +14,7 @@
* limitations under the License.
*/
#include "mbed.h"
#include "AnalogIn.h"
#include "drivers/AnalogIn.h"
#if DEVICE_ANALOGIN

View File

@ -16,13 +16,13 @@
#ifndef MBED_ANALOGIN_H
#define MBED_ANALOGIN_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_ANALOGIN
#include "analogin_api.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "hal/analogin_api.h"
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_ANALOGOUT_H
#define MBED_ANALOGOUT_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_ANALOGOUT
#include "analogout_api.h"
#include "PlatformMutex.h"
#include "hal/analogout_api.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BusIn.h"
#include "mbed_assert.h"
#include "drivers/BusIn.h"
#include "platform/mbed_assert.h"
namespace mbed {

View File

@ -16,9 +16,9 @@
#ifndef MBED_BUSIN_H
#define MBED_BUSIN_H
#include "platform.h"
#include "DigitalIn.h"
#include "PlatformMutex.h"
#include "platform/platform.h"
#include "drivers/DigitalIn.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BusInOut.h"
#include "mbed_assert.h"
#include "drivers/BusInOut.h"
#include "platform/mbed_assert.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_BUSINOUT_H
#define MBED_BUSINOUT_H
#include "DigitalInOut.h"
#include "PlatformMutex.h"
#include "drivers/DigitalInOut.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "BusOut.h"
#include "mbed_assert.h"
#include "drivers/BusOut.h"
#include "platform/mbed_assert.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_BUSOUT_H
#define MBED_BUSOUT_H
#include "DigitalOut.h"
#include "PlatformMutex.h"
#include "drivers/DigitalOut.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "CAN.h"
#include "drivers/CAN.h"
#if DEVICE_CAN

View File

@ -16,14 +16,13 @@
#ifndef MBED_CAN_H
#define MBED_CAN_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_CAN
#include "can_api.h"
#include "can_helper.h"
#include "Callback.h"
#include "PlatformMutex.h"
#include "hal/can_api.h"
#include "platform/Callback.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -1,115 +0,0 @@
/* 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_CIRCULARBUFFER_H
#define MBED_CIRCULARBUFFER_H
#include "critical.h"
namespace mbed {
/** Templated Circular buffer class
*
* @Note Synchronization level: Interrupt safe
*/
template<typename T, uint32_t BufferSize, typename CounterType = uint32_t>
class CircularBuffer {
public:
CircularBuffer() : _head(0), _tail(0), _full(false) {
}
~CircularBuffer() {
}
/** Push the transaction to the buffer. This overwrites the buffer if it's
* full
*
* @param data Data to be pushed to the buffer
*/
void push(const T& data) {
core_util_critical_section_enter();
if (full()) {
_tail++;
_tail %= BufferSize;
}
_pool[_head++] = data;
_head %= BufferSize;
if (_head == _tail) {
_full = true;
}
core_util_critical_section_exit();
}
/** Pop the transaction from the buffer
*
* @param data Data to be pushed to the buffer
* @return True if the buffer is not empty and data contains a transaction, false otherwise
*/
bool pop(T& data) {
bool data_popped = false;
core_util_critical_section_enter();
if (!empty()) {
data = _pool[_tail++];
_tail %= BufferSize;
_full = false;
data_popped = true;
}
core_util_critical_section_exit();
return data_popped;
}
/** Check if the buffer is empty
*
* @return True if the buffer is empty, false if not
*/
bool empty() {
core_util_critical_section_enter();
bool is_empty = (_head == _tail) && !_full;
core_util_critical_section_exit();
return is_empty;
}
/** Check if the buffer is full
*
* @return True if the buffer is full, false if not
*/
bool full() {
core_util_critical_section_enter();
bool full = _full;
core_util_critical_section_exit();
return full;
}
/** Reset the buffer
*
*/
void reset() {
core_util_critical_section_enter();
_head = 0;
_tail = 0;
_full = false;
core_util_critical_section_exit();
}
private:
T _pool[BufferSize];
volatile CounterType _head;
volatile CounterType _tail;
volatile bool _full;
};
}
#endif

View File

@ -16,10 +16,10 @@
#ifndef MBED_DIGITALIN_H
#define MBED_DIGITALIN_H
#include "platform.h"
#include "platform/platform.h"
#include "gpio_api.h"
#include "critical.h"
#include "hal/gpio_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,10 +16,10 @@
#ifndef MBED_DIGITALINOUT_H
#define MBED_DIGITALINOUT_H
#include "platform.h"
#include "platform/platform.h"
#include "gpio_api.h"
#include "critical.h"
#include "hal/gpio_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,9 +16,9 @@
#ifndef MBED_DIGITALOUT_H
#define MBED_DIGITALOUT_H
#include "platform.h"
#include "gpio_api.h"
#include "critical.h"
#include "platform/platform.h"
#include "hal/gpio_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Ethernet.h"
#include "drivers/Ethernet.h"
#if DEVICE_ETHERNET
#include "ethernet_api.h"
#include "hal/ethernet_api.h"
namespace mbed {

View File

@ -16,7 +16,7 @@
#ifndef MBED_ETHERNET_H
#define MBED_ETHERNET_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_ETHERNET

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FileBase.h"
#include "drivers/FileBase.h"
namespace mbed {

View File

@ -41,9 +41,9 @@ typedef long off_t;
# include <sys/syslimits.h>
#endif
#include "platform.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "platform/platform.h"
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FileLike.h"
#include "drivers/FileLike.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_FILELIKE_H
#define MBED_FILELIKE_H
#include "FileBase.h"
#include "FileHandle.h"
#include "drivers/FileBase.h"
#include "drivers/FileHandle.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FilePath.h"
#include "drivers/FilePath.h"
namespace mbed {

View File

@ -16,10 +16,10 @@
#ifndef MBED_FILEPATH_H
#define MBED_FILEPATH_H
#include "platform.h"
#include "platform/platform.h"
#include "FileSystemLike.h"
#include "FileLike.h"
#include "drivers/FileSystemLike.h"
#include "drivers/FileLike.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "FileSystemLike.h"
#include "drivers/FileSystemLike.h"
namespace mbed {

View File

@ -16,11 +16,11 @@
#ifndef MBED_FILESYSTEMLIKE_H
#define MBED_FILESYSTEMLIKE_H
#include "platform.h"
#include "platform/platform.h"
#include "FileBase.h"
#include "FileHandle.h"
#include "DirHandle.h"
#include "drivers/FileBase.h"
#include "drivers/FileHandle.h"
#include "drivers/DirHandle.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "I2C.h"
#include "drivers/I2C.h"
#if DEVICE_I2C

View File

@ -16,18 +16,18 @@
#ifndef MBED_I2C_H
#define MBED_I2C_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_I2C
#include "i2c_api.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "hal/i2c_api.h"
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
#if DEVICE_I2C_ASYNCH
#include "CThunk.h"
#include "dma_api.h"
#include "FunctionPointer.h"
#include "platform/CThunk.h"
#include "hal/dma_api.h"
#include "platform/FunctionPointer.h"
#endif
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "I2CSlave.h"
#include "drivers/I2CSlave.h"
#if DEVICE_I2CSLAVE

View File

@ -16,11 +16,11 @@
#ifndef MBED_I2C_SLAVE_H
#define MBED_I2C_SLAVE_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_I2CSLAVE
#include "i2c_api.h"
#include "hal/i2c_api.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "InterruptIn.h"
#include "drivers/InterruptIn.h"
#if DEVICE_INTERRUPTIN

View File

@ -16,15 +16,15 @@
#ifndef MBED_INTERRUPTIN_H
#define MBED_INTERRUPTIN_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_INTERRUPTIN
#include "gpio_api.h"
#include "gpio_irq_api.h"
#include "Callback.h"
#include "critical.h"
#include "toolchain.h"
#include "hal/gpio_api.h"
#include "hal/gpio_irq_api.h"
#include "platform/Callback.h"
#include "platform/critical.h"
#include "platform/toolchain.h"
namespace mbed {

View File

@ -1,8 +1,23 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 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.
*/
#include "cmsis.h"
#if defined(NVIC_NUM_VECTORS)
#include "InterruptManager.h"
#include "critical.h"
#include "drivers/InterruptManager.h"
#include "platform/critical.h"
#include <string.h>
#define CHAIN_INITIAL_SIZE 4

View File

@ -1,9 +1,24 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 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_INTERRUPTMANAGER_H
#define MBED_INTERRUPTMANAGER_H
#include "cmsis.h"
#include "CallChain.h"
#include "PlatformMutex.h"
#include "platform/CallChain.h"
#include "platform/PlatformMutex.h"
#include <string.h>
namespace mbed {

View File

@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "LocalFileSystem.h"
#include "drivers/LocalFileSystem.h"
#if DEVICE_LOCALFILESYSTEM
#include "semihost_api.h"
#include "platform/semihost_api.h"
#include <string.h>
#include <stdio.h>

View File

@ -16,12 +16,12 @@
#ifndef MBED_LOCALFILESYSTEM_H
#define MBED_LOCALFILESYSTEM_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_LOCALFILESYSTEM
#include "FileSystemLike.h"
#include "PlatformMutex.h"
#include "drivers/FileSystemLike.h"
#include "platform/PlatformMutex.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_LOWPOWERTICKER_H
#define MBED_LOWPOWERTICKER_H
#include "platform.h"
#include "Ticker.h"
#include "platform/platform.h"
#include "drivers/Ticker.h"
#if DEVICE_LOWPOWERTIMER
#include "lp_ticker_api.h"
#include "hal/lp_ticker_api.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_LOWPOWERTIMEOUT_H
#define MBED_LOWPOWERTIMEOUT_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_LOWPOWERTIMER
#include "lp_ticker_api.h"
#include "LowPowerTicker.h"
#include "hal/lp_ticker_api.h"
#include "drivers/LowPowerTicker.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_LOWPOWERTIMER_H
#define MBED_LOWPOWERTIMER_H
#include "platform.h"
#include "Timer.h"
#include "platform/platform.h"
#include "drivers/Timer.h"
#if DEVICE_LOWPOWERTIMER
#include "lp_ticker_api.h"
#include "hal/lp_ticker_api.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_PORTIN_H
#define MBED_PORTIN_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_PORTIN
#include "port_api.h"
#include "critical.h"
#include "hal/port_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_PORTINOUT_H
#define MBED_PORTINOUT_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_PORTINOUT
#include "port_api.h"
#include "critical.h"
#include "hal/port_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,12 +16,12 @@
#ifndef MBED_PORTOUT_H
#define MBED_PORTOUT_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_PORTOUT
#include "port_api.h"
#include "critical.h"
#include "hal/port_api.h"
#include "platform/critical.h"
namespace mbed {
/** A multiple pin digital out

View File

@ -16,11 +16,11 @@
#ifndef MBED_PWMOUT_H
#define MBED_PWMOUT_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_PWMOUT
#include "pwmout_api.h"
#include "critical.h"
#include "hal/pwmout_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "RawSerial.h"
#include "wait_api.h"
#include "drivers/RawSerial.h"
#include "platform/wait_api.h"
#include <cstdarg>
#if DEVICE_SERIAL

View File

@ -16,12 +16,12 @@
#ifndef MBED_RAW_SERIAL_H
#define MBED_RAW_SERIAL_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_SERIAL
#include "SerialBase.h"
#include "serial_api.h"
#include "drivers/SerialBase.h"
#include "hal/serial_api.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SPI.h"
#include "critical.h"
#include "drivers/SPI.h"
#include "platform/critical.h"
#if DEVICE_SPI

View File

@ -16,20 +16,20 @@
#ifndef MBED_SPI_H
#define MBED_SPI_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_SPI
#include "PlatformMutex.h"
#include "spi_api.h"
#include "SingletonPtr.h"
#include "platform/PlatformMutex.h"
#include "hal/spi_api.h"
#include "platform/SingletonPtr.h"
#if DEVICE_SPI_ASYNCH
#include "CThunk.h"
#include "dma_api.h"
#include "CircularBuffer.h"
#include "FunctionPointer.h"
#include "Transaction.h"
#include "platform/CThunk.h"
#include "hal/dma_api.h"
#include "platform/CircularBuffer.h"
#include "platform/FunctionPointer.h"
#include "platform/Transaction.h"
#endif
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SPISlave.h"
#include "drivers/SPISlave.h"
#if DEVICE_SPISLAVE

View File

@ -16,11 +16,11 @@
#ifndef MBED_SPISLAVE_H
#define MBED_SPISLAVE_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_SPISLAVE
#include "spi_api.h"
#include "hal/spi_api.h"
namespace mbed {

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Serial.h"
#include "wait_api.h"
#include "drivers/Serial.h"
#include "platform/wait_api.h"
#if DEVICE_SERIAL

View File

@ -16,7 +16,7 @@
#ifndef MBED_SERIAL_H
#define MBED_SERIAL_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_SERIAL

View File

@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "SerialBase.h"
#include "wait_api.h"
#include "critical.h"
#include "drivers/SerialBase.h"
#include "platform/wait_api.h"
#include "platform/critical.h"
#if DEVICE_SERIAL

View File

@ -16,7 +16,7 @@
#ifndef MBED_SERIALBASE_H
#define MBED_SERIALBASE_H
#include "platform.h"
#include "platform/platform.h"
#if DEVICE_SERIAL

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Stream.h"
#include "drivers/Stream.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_STREAM_H
#define MBED_STREAM_H
#include "platform.h"
#include "FileLike.h"
#include "platform/platform.h"
#include "drivers/FileLike.h"
#include <cstdarg>
namespace mbed {

View File

@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Ticker.h"
#include "drivers/Ticker.h"
#include "TimerEvent.h"
#include "FunctionPointer.h"
#include "ticker_api.h"
#include "critical.h"
#include "drivers/TimerEvent.h"
#include "platform/FunctionPointer.h"
#include "hal/ticker_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,9 +16,9 @@
#ifndef MBED_TICKER_H
#define MBED_TICKER_H
#include "TimerEvent.h"
#include "Callback.h"
#include "toolchain.h"
#include "drivers/TimerEvent.h"
#include "platform/Callback.h"
#include "platform/toolchain.h"
namespace mbed {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Timeout.h"
#include "drivers/Timeout.h"
namespace mbed {

View File

@ -16,7 +16,7 @@
#ifndef MBED_TIMEOUT_H
#define MBED_TIMEOUT_H
#include "Ticker.h"
#include "drivers/Ticker.h"
namespace mbed {

View File

@ -13,10 +13,10 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "Timer.h"
#include "ticker_api.h"
#include "us_ticker_api.h"
#include "critical.h"
#include "drivers/Timer.h"
#include "hal/ticker_api.h"
#include "hal/us_ticker_api.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_TIMER_H
#define MBED_TIMER_H
#include "platform.h"
#include "ticker_api.h"
#include "platform/platform.h"
#include "hal/ticker_api.h"
namespace mbed {

View File

@ -13,12 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "TimerEvent.h"
#include "drivers/TimerEvent.h"
#include "cmsis.h"
#include <stddef.h>
#include "ticker_api.h"
#include "us_ticker_api.h"
#include "hal/ticker_api.h"
#include "hal/us_ticker_api.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_TIMEREVENT_H
#define MBED_TIMEREVENT_H
#include "ticker_api.h"
#include "us_ticker_api.h"
#include "hal/ticker_api.h"
#include "hal/us_ticker_api.h"
namespace mbed {

View File

@ -1,75 +0,0 @@
/* 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_TRANSACTION_H
#define MBED_TRANSACTION_H
#include "platform.h"
#include "FunctionPointer.h"
namespace mbed {
/** Transaction structure
*/
typedef struct {
void *tx_buffer; /**< Tx buffer */
size_t tx_length; /**< Length of Tx buffer*/
void *rx_buffer; /**< Rx buffer */
size_t rx_length; /**< Length of Rx buffer */
uint32_t event; /**< Event for a transaction */
event_callback_t callback; /**< User's callback */
uint8_t width; /**< Buffer's word width (8, 16, 32, 64) */
} transaction_t;
/** Transaction class defines a transaction.
*
* @Note Synchronization level: Not protected
*/
template<typename Class>
class Transaction {
public:
Transaction(Class *tpointer, const transaction_t& transaction) : _obj(tpointer), _data(transaction) {
}
Transaction() : _obj(), _data() {
}
~Transaction() {
}
/** Get object's instance for the transaction
*
* @return The object which was stored
*/
Class* get_object() {
return _obj;
}
/** Get the transaction
*
* @return The transaction which was stored
*/
transaction_t* get_transaction() {
return &_data;
}
private:
Class* _obj;
transaction_t _data;
};
}
#endif

View File

@ -1,53 +0,0 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 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_CAN_HELPER_H
#define MBED_CAN_HELPER_H
#if DEVICE_CAN
#ifdef __cplusplus
extern "C" {
#endif
enum CANFormat {
CANStandard = 0,
CANExtended = 1,
CANAny = 2
};
typedef enum CANFormat CANFormat;
enum CANType {
CANData = 0,
CANRemote = 1
};
typedef enum CANType CANType;
struct CAN_Message {
unsigned int id; // 29 bit identifier
unsigned char data[8]; // Data field
unsigned char len; // Length of data field in bytes
CANFormat format; // 0 - STANDARD, 1- EXTENDED IDENTIFIER
CANType type; // 0 - DATA FRAME, 1 - REMOTE FRAME
};
typedef struct CAN_Message CAN_Message;
#ifdef __cplusplus
};
#endif
#endif
#endif // MBED_CAN_HELPER_H

View File

@ -16,8 +16,8 @@
#ifndef EVENT_H
#define EVENT_H
#include "EventQueue.h"
#include "mbed_assert.h"
#include "events/EventQueue.h"
#include "platform/mbed_assert.h"
namespace events {

View File

@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "EventQueue.h"
#include "events/EventQueue.h"
#include "mbed_events.h"
#include "events/mbed_events.h"
#include "mbed.h"

View File

@ -17,7 +17,7 @@
#define EVENT_QUEUE_H
#include "equeue/equeue.h"
#include "Callback.h"
#include "platform/Callback.h"
#include <cstddef>
#include <new>

View File

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "equeue.h"
#include "equeue/equeue.h"
#include <stdlib.h>
#include <string.h>

View File

@ -23,7 +23,7 @@ extern "C" {
#endif
// Platform specific files
#include "equeue_platform.h"
#include "equeue/equeue_platform.h"
#include <stddef.h>
#include <stdint.h>

View File

@ -16,7 +16,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "equeue_platform.h"
#include "equeue/equeue_platform.h"
#if defined(EQUEUE_PLATFORM_MBED)

View File

@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "equeue_platform.h"
#include "equeue/equeue_platform.h"
#if defined(EQUEUE_PLATFORM_POSIX)

View File

@ -22,8 +22,8 @@
#ifdef __cplusplus
#include "EventQueue.h"
#include "Event.h"
#include "events/EventQueue.h"
#include "events/Event.h"
using namespace events;

View File

@ -22,7 +22,7 @@
#include "PinNames.h"
#include "PeripheralNames.h"
#include "can_helper.h"
#include "hal/can_helper.h"
#ifdef __cplusplus
extern "C" {

View File

@ -17,10 +17,10 @@
#define MBED_I2C_API_H
#include "device.h"
#include "buffer.h"
#include "hal/buffer.h"
#if DEVICE_I2C_ASYNCH
#include "dma_api.h"
#include "hal/dma_api.h"
#endif
#if DEVICE_I2C

View File

@ -20,7 +20,7 @@
#if DEVICE_LOWPOWERTIMER
#include "ticker_api.h"
#include "hal/ticker_api.h"
#ifdef __cplusplus
extern "C" {

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "gpio_api.h"
#include "hal/gpio_api.h"
static inline void _gpio_init_in(gpio_t* gpio, PinName pin, PinMode mode)
{

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "lp_ticker_api.h"
#include "hal/lp_ticker_api.h"
#if DEVICE_LOWPOWERTIMER

View File

@ -13,8 +13,8 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "pinmap.h"
#include "mbed_error.h"
#include "hal/pinmap.h"
#include "platform/mbed_error.h"
void pinmap_pinout(PinName pin, const PinMap *map) {
if (pin == NC)

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
#include <stddef.h>
#include "ticker_api.h"
#include "critical.h"
#include "hal/ticker_api.h"
#include "platform/critical.h"
void ticker_set_handler(const ticker_data_t *const data, ticker_event_handler handler) {
data->interface->init();

View File

@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "us_ticker_api.h"
#include "hal/us_ticker_api.h"
static ticker_event_queue_t events;

View File

@ -17,8 +17,8 @@
#define MBED_SERIAL_API_H
#include "device.h"
#include "buffer.h"
#include "dma_api.h"
#include "hal/buffer.h"
#include "hal/dma_api.h"
#if DEVICE_SERIAL

View File

@ -17,8 +17,8 @@
#define MBED_SPI_API_H
#include "device.h"
#include "dma_api.h"
#include "buffer.h"
#include "hal/dma_api.h"
#include "hal/buffer.h"
#if DEVICE_SPI

View File

@ -17,7 +17,7 @@
#define MBED_US_TICKER_API_H
#include <stdint.h>
#include "ticker_api.h"
#include "hal/ticker_api.h"
#ifdef __cplusplus
extern "C" {

76
mbed.h
View File

@ -30,56 +30,56 @@
#include "events/mbed_events.h"
#endif
#include "toolchain.h"
#include "platform.h"
#include "platform/toolchain.h"
#include "platform/platform.h"
// Useful C libraries
#include <math.h>
#include <time.h>
// mbed Debug libraries
#include "mbed_error.h"
#include "mbed_interface.h"
#include "mbed_assert.h"
#include "platform/mbed_error.h"
#include "platform/mbed_interface.h"
#include "platform/mbed_assert.h"
// mbed Peripheral components
#include "DigitalIn.h"
#include "DigitalOut.h"
#include "DigitalInOut.h"
#include "BusIn.h"
#include "BusOut.h"
#include "BusInOut.h"
#include "PortIn.h"
#include "PortInOut.h"
#include "PortOut.h"
#include "AnalogIn.h"
#include "AnalogOut.h"
#include "PwmOut.h"
#include "Serial.h"
#include "SPI.h"
#include "SPISlave.h"
#include "I2C.h"
#include "I2CSlave.h"
#include "Ethernet.h"
#include "CAN.h"
#include "RawSerial.h"
#include "drivers/DigitalIn.h"
#include "drivers/DigitalOut.h"
#include "drivers/DigitalInOut.h"
#include "drivers/BusIn.h"
#include "drivers/BusOut.h"
#include "drivers/BusInOut.h"
#include "drivers/PortIn.h"
#include "drivers/PortInOut.h"
#include "drivers/PortOut.h"
#include "drivers/AnalogIn.h"
#include "drivers/AnalogOut.h"
#include "drivers/PwmOut.h"
#include "drivers/Serial.h"
#include "drivers/SPI.h"
#include "drivers/SPISlave.h"
#include "drivers/I2C.h"
#include "drivers/I2CSlave.h"
#include "drivers/Ethernet.h"
#include "drivers/CAN.h"
#include "drivers/RawSerial.h"
// mbed Internal components
#include "Timer.h"
#include "Ticker.h"
#include "Timeout.h"
#include "LowPowerTimeout.h"
#include "LowPowerTicker.h"
#include "LowPowerTimer.h"
#include "LocalFileSystem.h"
#include "InterruptIn.h"
#include "wait_api.h"
#include "sleep_api.h"
#include "rtc_time.h"
#include "drivers/Timer.h"
#include "drivers/Ticker.h"
#include "drivers/Timeout.h"
#include "drivers/LowPowerTimeout.h"
#include "drivers/LowPowerTicker.h"
#include "drivers/LowPowerTimer.h"
#include "drivers/LocalFileSystem.h"
#include "drivers/InterruptIn.h"
#include "platform/wait_api.h"
#include "hal/sleep_api.h"
#include "platform/rtc_time.h"
// mbed Non-hardware components
#include "Callback.h"
#include "FunctionPointer.h"
#include "platform/Callback.h"
#include "platform/FunctionPointer.h"
using namespace mbed;
using namespace std;

View File

@ -1,6 +1,6 @@
#include "CallChain.h"
#include "platform/CallChain.h"
#include "cmsis.h"
#include "critical.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_CALLCHAIN_H
#define MBED_CALLCHAIN_H
#include "Callback.h"
#include "toolchain.h"
#include "platform/Callback.h"
#include "platform/toolchain.h"
#include <string.h>
namespace mbed {

View File

@ -19,8 +19,8 @@
#include <string.h>
#include <stdint.h>
#include <new>
#include "mbed_assert.h"
#include "toolchain.h"
#include "platform/mbed_assert.h"
#include "platform/toolchain.h"
namespace mbed {

View File

@ -16,7 +16,7 @@
#ifndef MBED_CIRCULARBUFFER_H
#define MBED_CIRCULARBUFFER_H
#include "critical.h"
#include "platform/critical.h"
namespace mbed {

View File

@ -16,8 +16,8 @@
#ifndef MBED_FUNCTIONPOINTER_H
#define MBED_FUNCTIONPOINTER_H
#include "Callback.h"
#include "toolchain.h"
#include "platform/Callback.h"
#include "platform/toolchain.h"
#include <string.h>
#include <stdint.h>

View File

@ -17,7 +17,7 @@
#define PLATFORM_MUTEX_H
#ifdef MBED_CONF_RTOS_PRESENT
#include "Mutex.h"
#include "rtos/Mutex.h"
typedef rtos::Mutex PlatformMutex;
#else
/** A stub mutex for when an RTOS is not present

View File

@ -18,7 +18,7 @@
#include <stdint.h>
#include <new>
#include "mbed_assert.h"
#include "platform/mbed_assert.h"
#ifdef MBED_CONF_RTOS_PRESENT
#include "cmsis_os.h"
#endif

View File

@ -16,8 +16,8 @@
#ifndef MBED_TRANSACTION_H
#define MBED_TRANSACTION_H
#include "platform.h"
#include "FunctionPointer.h"
#include "platform/platform.h"
#include "platform/FunctionPointer.h"
namespace mbed {

View File

@ -14,11 +14,11 @@
* limitations under the License.
*/
#include "mbed_mem_trace.h"
#include "mbed_stats.h"
#include "toolchain.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "platform/mbed_mem_trace.h"
#include "platform/mbed_stats.h"
#include "platform/toolchain.h"
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
#include <stddef.h>
#include <stdio.h>
#include <string.h>

View File

@ -13,11 +13,11 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "mbed_assert.h"
#include "platform/mbed_assert.h"
#include "device.h"
#include "mbed_interface.h"
#include "critical.h"
#include "platform/mbed_interface.h"
#include "platform/critical.h"
void mbed_assert_internal(const char *expr, const char *file, int line)
{

View File

@ -14,12 +14,12 @@
* limitations under the License.
*/
#include <stdio.h>
#include "gpio_api.h"
#include "wait_api.h"
#include "toolchain.h"
#include "mbed_interface.h"
#include "critical.h"
#include "serial_api.h"
#include "hal/gpio_api.h"
#include "platform/wait_api.h"
#include "platform/toolchain.h"
#include "platform/mbed_interface.h"
#include "platform/critical.h"
#include "hal/serial_api.h"
#if DEVICE_SERIAL
extern int stdio_uart_inited;

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
#include "critical.h"
#include "platform/critical.h"
#include "cmsis.h"
#include "mbed_assert.h"
#include "toolchain.h"
#include "platform/mbed_assert.h"
#include "platform/toolchain.h"
#define EXCLUSIVE_ACCESS (!defined (__CORTEX_M0) && !defined (__CORTEX_M0PLUS))

View File

@ -16,9 +16,9 @@
#include <stdlib.h>
#include <stdarg.h>
#include "device.h"
#include "toolchain.h"
#include "mbed_error.h"
#include "mbed_interface.h"
#include "platform/toolchain.h"
#include "platform/mbed_error.h"
#include "platform/mbed_interface.h"
#if DEVICE_STDIO_MESSAGES
#include <stdio.h>
#endif

View File

@ -14,13 +14,13 @@
* limitations under the License.
*/
#include <stdio.h>
#include "mbed_interface.h"
#include "platform/mbed_interface.h"
#include "gpio_api.h"
#include "wait_api.h"
#include "semihost_api.h"
#include "mbed_error.h"
#include "toolchain.h"
#include "hal/gpio_api.h"
#include "platform/wait_api.h"
#include "platform/semihost_api.h"
#include "platform/mbed_error.h"
#include "platform/toolchain.h"
#if DEVICE_SEMIHOST

View File

@ -17,8 +17,8 @@
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "mbed_mem_trace.h"
#include "critical.h"
#include "platform/mbed_mem_trace.h"
#include "platform/critical.h"
/******************************************************************************
* Internal variables, functions and helpers

View File

@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "rtc_api.h"
#include "hal/rtc_api.h"
#include <time.h>
#include "critical.h"
#include "rtc_time.h"
#include "us_ticker_api.h"
#include "SingletonPtr.h"
#include "PlatformMutex.h"
#include "platform/critical.h"
#include "platform/rtc_time.h"
#include "hal/us_ticker_api.h"
#include "platform/SingletonPtr.h"
#include "platform/PlatformMutex.h"
static SingletonPtr<PlatformMutex> _mutex;

Some files were not shown because too many files have changed in this diff Show More