Commit Graph

1049 Commits (9d06732aae64d26de963f9d39a601956796fe5b5)

Author SHA1 Message Date
Christopher Haster aff49d8d1e Renamed files in platform to match source names
critical.h     -> mbed_critical.h
sleep.h        -> mbed_sleep.h
toolchain.h    -> mbed_toolchain.h
rtc_time.h     -> mbed_rtc_time.h
semihost_api.h -> mbed_semihost_api.h
wait_api.h     -> mbed_wait_api.h
2017-02-22 18:17:54 -06:00
0xc0170 bae0f97bc9 flash: add flash algo common layer
If target supports flash algo, it can get common HAL implementation, providing
feature "HAL_FLASH_CMSIS_ALGO". This simplifies target code, and having
one implementation that can be shared by many targets.

Be careful with flash cmsis algo, in some cases they execute code that
can affect the system. For instance, it can disable cache, or affect
some system clocks. Therefore this feature should be well tested.
2017-02-21 14:08:33 -06:00
0xc0170 fdfb82030c hal: add flash hal api
Add a flash api with functions to erase and program. The api also
includes functions to query flash start, flash size, page size and
sector size.
2017-02-21 14:08:09 -06:00
Bartek Szatkowski 6a045a49a9 Platform: Add sleep/deepsleep user facing functions
Add sleep/deepsleep functions to platform layer which are replacing HAL
functions with the same name, rename existing symbols in HAL layer
to hal_sleep/hal_deepsleep. This way sleep functions
are always available, even if target doesn't implement them, which makes
the code using sleep clearer. It also enables us to make decision on in
which builds (debug/release) the sleep will be enabled.
2017-01-19 09:39:29 +00:00
Martin Kojtal 72b1fa71b5 Merge pull request #3301 from 0xc0170/fix_issue#2725
I2C - correct return values for write functions (docs) - part 1
2016-12-02 15:47:08 +01:00
0xc0170 11d6f388d2 I2C - correct return values for write functions
The correction was made based on the i2c hal, and some target implementations
(early implementations like nxp 1768, freescale KLXX).
2016-11-21 11:26:02 +00:00
Christopher Haster b09ca768b6 Moved emac_api.h to the appropriate folder
Previously in hal/hal/emac_api.h, the emac_api must have
been missed during restructuring
2016-11-17 13:52:42 -06:00
Martin Kojtal f8b682c943 lwip-interface: fix issue #2993
DEVICE_ are passed as command line -D, thus no inclusion is required.
``platform.h`` is C++ header file, should not be pulled in C files
2016-10-13 11:42:31 +01:00
Sam Grove 3a16ca9855 Merge pull request #2911 from theotherjimmy/docs-generation
[Tools] Add documentation generation script
2016-10-06 15:57:08 -05:00
Jimmy Brisson f1a78027d3 Add tags to our code 2016-10-04 15:02:44 -05:00
Christopher Haster 5cd2d7869e Merge remote-tracking branch 'upstream/master' into feature_wifi_ublox_merge 2016-10-02 07:29:07 -05:00
Christopher Haster 13bf0bd470 Merge commit 'upstream/master~' into feature_wifi_ublox 2016-10-02 06:35:12 -05:00
Martin Kojtal 3f66a62f87 UBLOX_C029: remove emac implementation
It depends on the driver that will come separately, therefore this will be
enabled once driver is in place.
2016-10-01 19:35:10 +01:00
Sam Grove 301b77c4b2 For drivers, events, hal, platform, rtos and mbed.h add one level of path to make sure specific and unique includes files are found. 2016-10-01 02:11:36 -05:00
Sam Grove b7fcfd93d8 Move can_helper.h into hal/ given its a requirement of the can c hal. 2016-10-01 01:44:08 -05:00
Christopher Haster 15904b7544 restructure - Split hal into drivers+platform+hal
hal/common/AnalogIn.cpp -> drivers/AnalogIn.cpp
hal/api/AnalogIn.h -> drivers/AnalogIn.h
hal/api/AnalogOut.h -> drivers/AnalogOut.h
hal/common/BusIn.cpp -> drivers/BusIn.cpp
hal/api/BusIn.h -> drivers/BusIn.h
hal/common/BusInOut.cpp -> drivers/BusInOut.cpp
hal/api/BusInOut.h -> drivers/BusInOut.h
hal/common/BusOut.cpp -> drivers/BusOut.cpp
hal/api/BusOut.h -> drivers/BusOut.h
hal/common/CAN.cpp -> drivers/CAN.cpp
hal/api/CAN.h -> drivers/CAN.h
hal/api/CircularBuffer.h -> drivers/CircularBuffer.h
hal/api/DigitalIn.h -> drivers/DigitalIn.h
hal/api/DigitalInOut.h -> drivers/DigitalInOut.h
hal/api/DigitalOut.h -> drivers/DigitalOut.h
hal/api/DirHandle.h -> drivers/DirHandle.h
hal/common/Ethernet.cpp -> drivers/Ethernet.cpp
hal/api/Ethernet.h -> drivers/Ethernet.h
hal/common/FileBase.cpp -> drivers/FileBase.cpp
hal/api/FileBase.h -> drivers/FileBase.h
hal/api/FileHandle.h -> drivers/FileHandle.h
hal/common/FileLike.cpp -> drivers/FileLike.cpp
hal/api/FileLike.h -> drivers/FileLike.h
hal/common/FilePath.cpp -> drivers/FilePath.cpp
hal/api/FilePath.h -> drivers/FilePath.h
hal/common/FileSystemLike.cpp -> drivers/FileSystemLike.cpp
hal/api/FileSystemLike.h -> drivers/FileSystemLike.h
hal/common/I2C.cpp -> drivers/I2C.cpp
hal/api/I2C.h -> drivers/I2C.h
hal/common/I2CSlave.cpp -> drivers/I2CSlave.cpp
hal/api/I2CSlave.h -> drivers/I2CSlave.h
hal/common/InterruptIn.cpp -> drivers/InterruptIn.cpp
hal/api/InterruptIn.h -> drivers/InterruptIn.h
hal/common/InterruptManager.cpp -> drivers/InterruptManager.cpp
hal/api/InterruptManager.h -> drivers/InterruptManager.h
hal/common/LocalFileSystem.cpp -> drivers/LocalFileSystem.cpp
hal/api/LocalFileSystem.h -> drivers/LocalFileSystem.h
hal/api/LowPowerTicker.h -> drivers/LowPowerTicker.h
hal/api/LowPowerTimeout.h -> drivers/LowPowerTimeout.h
hal/api/LowPowerTimer.h -> drivers/LowPowerTimer.h
hal/api/PortIn.h -> drivers/PortIn.h
hal/api/PortInOut.h -> drivers/PortInOut.h
hal/api/PortOut.h -> drivers/PortOut.h
hal/api/PwmOut.h -> drivers/PwmOut.h
hal/common/RawSerial.cpp -> drivers/RawSerial.cpp
hal/api/RawSerial.h -> drivers/RawSerial.h
hal/common/SPI.cpp -> drivers/SPI.cpp
hal/api/SPI.h -> drivers/SPI.h
hal/common/SPISlave.cpp -> drivers/SPISlave.cpp
hal/api/SPISlave.h -> drivers/SPISlave.h
hal/common/Serial.cpp -> drivers/Serial.cpp
hal/api/Serial.h -> drivers/Serial.h
hal/common/SerialBase.cpp -> drivers/SerialBase.cpp
hal/api/SerialBase.h -> drivers/SerialBase.h
hal/common/Stream.cpp -> drivers/Stream.cpp
hal/api/Stream.h -> drivers/Stream.h
hal/common/Ticker.cpp -> drivers/Ticker.cpp
hal/api/Ticker.h -> drivers/Ticker.h
hal/common/Timeout.cpp -> drivers/Timeout.cpp
hal/api/Timeout.h -> drivers/Timeout.h
hal/common/Timer.cpp -> drivers/Timer.cpp
hal/api/Timer.h -> drivers/Timer.h
hal/common/TimerEvent.cpp -> drivers/TimerEvent.cpp
hal/api/TimerEvent.h -> drivers/TimerEvent.h
hal/api/Transaction.h -> drivers/Transaction.h
hal/api/can_helper.h -> drivers/can_helper.h
hal/.yotta_ignore
hal/CMakeLists.txt
hal/hal/analogin_api.h -> hal/analogin_api.h
hal/hal/analogout_api.h -> hal/analogout_api.h
hal/hal/buffer.h -> hal/buffer.h
hal/hal/can_api.h -> hal/can_api.h
hal/hal/dma_api.h -> hal/dma_api.h
hal/hal/ethernet_api.h -> hal/ethernet_api.h
hal/hal/gpio_api.h -> hal/gpio_api.h
hal/hal/gpio_irq_api.h -> hal/gpio_irq_api.h
hal/hal/i2c_api.h -> hal/i2c_api.h
hal/hal/lp_ticker_api.h -> hal/lp_ticker_api.h
hal/common/mbed_gpio.c -> hal/mbed_gpio.c
hal/common/mbed_lp_ticker_api.c -> hal/mbed_lp_ticker_api.c
hal/common/mbed_pinmap_common.c -> hal/mbed_pinmap_common.c
hal/common/mbed_ticker_api.c -> hal/mbed_ticker_api.c
hal/common/mbed_us_ticker_api.c -> hal/mbed_us_ticker_api.c
hal/module.json
hal/hal/pinmap.h -> hal/pinmap.h
hal/hal/port_api.h -> hal/port_api.h
hal/hal/pwmout_api.h -> hal/pwmout_api.h
hal/hal/rtc_api.h -> hal/rtc_api.h
hal/hal/serial_api.h -> hal/serial_api.h
hal/hal/sleep_api.h -> hal/sleep_api.h
hal/hal/spi_api.h -> hal/spi_api.h
hal/hal/storage_abstraction/Driver_Common.h -> hal/storage_abstraction/Driver_Common.h
hal/hal/storage_abstraction/Driver_Storage.h -> hal/storage_abstraction/Driver_Storage.h
hal/hal/ticker_api.h -> hal/ticker_api.h
hal/hal/trng_api.h -> hal/trng_api.h
hal/hal/us_ticker_api.h -> hal/us_ticker_api.h
hal/api/mbed.h -> mbed.h
hal/api/CThunk.h -> platform/CThunk.h
hal/common/CallChain.cpp -> platform/CallChain.cpp
hal/api/CallChain.h -> platform/CallChain.h
hal/api/Callback.h -> platform/Callback.h
hal/api/FunctionPointer.h -> platform/FunctionPointer.h
hal/api/PlatformMutex.h -> platform/PlatformMutex.h
hal/api/SingletonPtr.h -> platform/SingletonPtr.h
hal/api/critical.h -> platform/critical.h
hal/common/mbed_alloc_wrappers.cpp -> platform/mbed_alloc_wrappers.cpp
hal/common/mbed_assert.c -> platform/mbed_assert.c
hal/api/mbed_assert.h -> platform/mbed_assert.h
hal/common/mbed_board.c -> platform/mbed_board.c
hal/common/mbed_critical.c -> platform/mbed_critical.c
hal/api/mbed_debug.h -> platform/mbed_debug.h
hal/common/mbed_error.c -> platform/mbed_error.c
hal/api/mbed_error.h -> platform/mbed_error.h
hal/common/mbed_interface.c -> platform/mbed_interface.c
hal/api/mbed_interface.h -> platform/mbed_interface.h
hal/common/mbed_mem_trace.c -> platform/mbed_mem_trace.c
hal/api/mbed_mem_trace.h -> platform/mbed_mem_trace.h
hal/common/mbed_rtc_time.cpp -> platform/mbed_rtc_time.cpp
hal/common/mbed_semihost_api.c -> platform/mbed_semihost_api.c
hal/api/mbed_stats.h -> platform/mbed_stats.h
hal/common/mbed_wait_api_no_rtos.c -> platform/mbed_wait_api_no_rtos.c
hal/common/mbed_wait_api_rtos.cpp -> platform/mbed_wait_api_rtos.cpp
hal/api/platform.h -> platform/platform.h
hal/common/retarget.cpp -> platform/retarget.cpp
hal/api/rtc_time.h -> platform/rtc_time.h
hal/api/semihost_api.h -> platform/semihost_api.h
hal/api/toolchain.h -> platform/toolchain.h
hal/api/wait_api.h -> platform/wait_api.h
2016-09-30 19:18:09 -05:00
Christopher Haster 0bad622a16 restructure - Moved targets out to top level
hal/targets -> targets
hal/targets.json -> targets/targets.json
2016-09-30 19:18:09 -05:00
Sam Grove 7f8cadae7f Merge pull request #2869 from geky/callback-fix-overloads
callback - Remove problematic callback overloads
2016-09-30 15:39:13 -05:00
Sam Grove 20756cbf77 Merge pull request #2860 from ARMmbed/event_loop_mbed_events_new
Event loop with mbed-events
2016-09-30 15:24:24 -05:00
Sam Grove 4c79daf576 Merge pull request #2857 from MultiTechSystems/mtq-mdot-rtos-fixes
resolve multiple STM32F411RE configurations in mbed_rtx.h
2016-09-30 15:01:53 -05:00
Sam Grove b0b7b3cf9c Merge pull request #2849 from pan-/fix_nordic_critical_section
Fix nordic critical section entry and exit
2016-09-30 15:00:43 -05:00
Martin Kojtal 56a223e3f4 emac interface - typedef should be available for non-emac targets
As it's required by lwip_bringup function
2016-09-30 19:06:02 +01:00
Bogdan Marinescu 53218f9be8 Include events library headers in mbed.h
The inclusion is conditioned by the presence of the events library
(`MBED_CONF_EVENTS_PRESENT`). This ensures backward compatibility with
SDK builds.
2016-09-30 17:12:00 +03:00
Martin Kojtal bad51a56a1 targets: remove emac for k64f, not supported yet 2016-09-30 09:42:14 +01:00
Christopher Haster f8917e1cd9 callback - Removed problematic callback overloads
Unfortunately, it is very difficult to infer the parameters of
function-objects generically in C++03 without any additional type
information. The current implementation fails to do so, and the compiler
simply bails with "unable to deduce template parameter".

Rather than leaving the user with a small novel of error messages, this
patch removes the problematic callback overloads, leaving only callback
overloads for the original pointer types.
2016-09-29 16:30:49 -05:00
andreas.larsson f8ad018e14 Added 2016-09-29 12:01:35 +01:00
andreas.larsson 31a1a7fe9b Fixed bug in packetIndication for packetInfo->rxData + use mutexes + cleanup 2016-09-29 11:57:15 +01:00
andreas.larsson 2ce9039a1a Added wifi_emac_api.cpp 2016-09-29 11:51:44 +01:00
andreas.larsson 05974a6578 Added EMAC 2016-09-29 11:50:59 +01:00
Vincent Coubard dcf03310d0 NRF5 - Fix usage of volatile variable in nordic critical section implementations. 2016-09-29 10:05:02 +01:00
Martin Kojtal f12676dfc7 Merge branch 'master' into feature_wifi
Conflicts:
	features/net/FEATURE_IPV4/lwip-interface/lwip_stack.c
	hal/targets.json
2016-09-29 09:20:46 +01:00
svastm d37e4d876d STM32L4 - Rename RTC_LSI 2016-09-29 10:00:48 +02:00
svastm f361a430ef STM32L1 - Rename RTC_LSI 2016-09-29 10:00:45 +02:00
svastm da44e99a1c STM32L0 - Rename RTC_LSI 2016-09-29 10:00:41 +02:00
svastm 57208bb651 STM32F7 - Rename RTC_LSI 2016-09-29 10:00:38 +02:00
svastm a0fd0d39c1 STM32F4 - Rename RTC_LSI 2016-09-29 10:00:34 +02:00
svastm faae46385f STM32F3 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm 574e7b7622 STM32F2 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm a4db938b7a STM32F1 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
svastm 9053d3b9ea STM32F0 - Rename RTC_LSI 2016-09-29 09:52:05 +02:00
Sam Grove 2564a833c0 Merge pull request #2822 from anangl/master
TARGET_NRF5: Removed waiting for TX completed from 'serial_putc()'.
2016-09-28 15:37:58 -07:00
Sam Grove 9e1b53f6d3 Merge pull request #2851 from geky/callback-function-objects
callback - Add size-limited function-object overloads to Callback
2016-09-28 15:00:09 -07:00
Sam Grove 7608401f2b Merge pull request #2810 from toyowata/master
[LPC1347] Fix PwmOut prescaler for 16-bit timer
2016-09-28 14:58:55 -07:00
Sam Grove 3d1531fcb1 Merge pull request #2767 from mikaleppanen/lwip_2_0
Replace lwIP 1.4.1 with lwIP 2.0
2016-09-28 14:58:22 -07:00
Mike Fiore fdd267cadf resolve multiple STM32F411RE configurations in mbed_rtx.h 2016-09-28 14:57:46 -05:00
Christopher Haster 161a2ec259 callback - Added size-limited function-object overloads to Callback
The callback class can now accept generalized function-objects:

    class Thing {
    public:
        int value;

        void operator()() {
            printf("hi! %d\n", value);
        }
    };

    Callback<void()> cb(Thing(2));

However, with the intention of avoiding implicit dynamic-memory
allocations, the Callback class is limited to a single word of storage.
Exceeding this size will eliminate the function-object type from the
overload set and fail to compile.

Effort was invested to make this situation very clear to the user. Here
is an example error message with noise removed:

    [ERROR] ./main.cpp: In function 'int main()':
    ./mbed-os/hal/api/Ticker.h:101:10: note:
        no known conversion for argument 1 from 'BigFunc' to 'mbed::Callback<void()>'

The real benefit of this change is the ability for users to hook into
the attributes of the Callback class. This mostly allows lifetime
management of the function-objects from third-party libraries (such as
the Event class from mbed-events).

Note: The convenient `callback` function may become ambiguous if
provided with a type that defines multiple incompatible `operator()`
member functions.
2016-09-28 12:23:29 -05:00
Christopher Haster 804a621231 callback - Moved internal dispatch mechanism to generated op-table
This allows additional attributes to be attached to the internally
generated type such as move and destructor operations with no increase
in RAM footprint.

The current overloads can't take advantage of this, but it does open
the possibility for more powerful overloads that can provide these
additional attributes.

Changes to mbed-os memory consumption:

        .text   .data   .bss
before  57887   2292    7692
after   57842   2292    7691
2016-09-28 12:23:24 -05:00
Vincent Coubard c536392079 TARGET_NRF5 - Add critical section enter/exit overrides for NRF5 targets.
This change takes advantage of the reworked primitives of SDK v11.
2016-09-28 13:43:31 +01:00
svastm 0766d39746 STM32F4 - Enable the low power timer
Enable the low power timer for the following targets:
 - NUCLEO_F411RE
 - NUCLEO_F401RE
 - DISCO_F429ZI
 - NUCLEO_F446RE
 - NUCLEO_F410RB
 - DISCO_F469NI
 - NUCLEO_F446ZE
 - B86B_F446VE
2016-09-28 09:36:37 +02:00
svastm 21b11a26ec STM32F4 - Add low power timer 2016-09-28 09:31:03 +02:00