Commit Graph

1424 Commits (39922228d6534d9331ccb6751d19a0bd1df7d736)

Author SHA1 Message Date
Kevin Bracey c887290db6 Adjust ticker tests 2020-09-14 13:25:12 +03:00
Kevin Bracey 65bc41a96b Optimise mbed_ticker_api.c
The generic code in mbed_ticker_api.c uses run-time polymorphism to
handle different tickers, and has generic run-time calculations for
different ticker widths and frequencies, with a single special-case for
1MHz.

Extend the run-time special casing to handle any conversion cases where
either the multiply or divide can be done as a shift. This is a speed
optimisation for certain platforms.

Add a new option `target.custom-tickers`. If turned off, it promises
that only USTICKER and LPTICKER devices will be used. This then permits
elimination and/or simplification of runtime calculations, saving size
and speed. If either both USTICKER and LPTICKER have the same width, or
same period numerator or denominator, or only one of them exists, then
operations can be hard-coded. This is a significant ROM space saving,
and a minor speed and RAM saving.

We get to optimise all the calculations, but the run-time polymorphism
is retained even if there is only one ticker, as it doesn't
significantly affect code size versus direct calls, and the existence of
lp_ticker_wrapper and various us_ticker optimisations requires it, even
if only LPTICKER is available.
2020-09-14 13:25:10 +03:00
Kevin Bracey 6423633122 Add documentation for LP_TICKER defines
They're now potentially useful, so document them as per the US_TICKER
defines.
2020-09-14 13:25:08 +03:00
Antti Kauppila c1dd8b9acd redundant code combined 2020-09-14 13:25:06 +03:00
Rajkumar Kanagaraj 2bc7bb7a52 - Remove components reference from travis
- update readme
2020-09-11 14:33:18 +01:00
Martin Kojtal 468372e759
Merge pull request #13492 from talorion/fix-PwmOut-resets-after-suspend
Fix pwm out resets after suspend
2020-09-10 12:40:18 +01:00
Jaeden Amero 39e69d328d Use boot stack size from config system
To allow overriding of the boot stack size from the Mbed configuration
system, consistently use MBED_CONF_TARGET_BOOT_STACK_SIZE rather than
MBED_BOOT_STACK_SIZE.

Fixes #10319
2020-09-10 10:08:38 +01:00
Roman Okhrimenko 877078003c Rename CY8CKIT_064B0S2_4343W to CY8CKIT064B0S2_4343W, which fits in 20 characters limit 2020-09-07 08:25:31 +03:00
talorion e55421aaa4 pwmout - add read methods for period and pulsewidth 2020-09-02 13:39:08 +02:00
Rajkumar Kanagaraj 159410bea7 Move greentea tests closure to library 2020-08-25 15:15:53 +01:00
Rajkumar Kanagaraj 993ed3b975 Refactor hal directory 2020-08-25 14:57:07 +01:00
Charley Chu ff74ea41c1 Use PSA TRNG if PSA is enabled and no TRNG device defined
Signed-off-by: Charley Chu <haoc@cypress.com>
2020-08-07 08:02:00 -07:00
Martin Kojtal d1ae0d570c
Merge pull request #12425 from kjbracey-arm/chrono
C++ Chrono support
2020-04-30 11:41:43 +02:00
Jaeden Amero fcf427ac11 psa: Remove S-mode only code
Remove all PSA S-mode only code, as it is unused. Only PSA S targets
would use the code, and we've removed those targets in a previous
commit.

Ensure all tests for S-mode code we are deleting is also removed, even
if that code would run in NS-mode. Keep any tests that also test our PSA
emulation support (for single v7-M targets).

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-27 09:51:13 +01:00
Kevin Bracey 8f490f6f24 Use Chrono in LowPowerTickerWrapper 2020-04-27 10:19:08 +03:00
Kevin Bracey 34428f9d4c Add Chrono support to Ticker et al 2020-04-27 10:19:08 +03:00
Jaeden Amero 07a84ec10a psa: Remove MBED_SPM code
All MBED_SPM targets have been removed previously, via commits
5cc66282dd ("PSOC6: remove PSA targets") and 115b09aba43b ("psoc6:
Remove FUTURE_SEQUANA and FUTURE_SEQUANA_M0"). Remove all the dead
MBED_SPM code, as no targets use it.

Signed-off-by: Jaeden Amero <jaeden.amero@arm.com>
2020-04-16 14:10:54 +01:00
Rajkumar Kanagaraj 20c3e38349 Remove the deprecated ethernet APIs 2020-03-17 06:00:07 -07:00
Martin Kojtal dc733d8883
Merge pull request #12477 from fkjagodzinski/hal-gpio-get_capabilities
HAL: Add a get_capabilities() function to GPIO API
2020-02-24 07:47:39 +00:00
Martin Kojtal ec836aeb3e hal: fix SPDX identifiers 2020-02-21 07:01:02 +00:00
Filip Jagodzinski bcfca4fa5e HAL: GPIO: Add the get_capabilities function
Add the gpio_get_capabilities() to GPIO HAL API.
Add a default, weak implementation, that every target can override.
2020-02-19 18:28:51 +01:00
Przemyslaw Stekiel 0d9a54f92e Provide pinmap_uart_restricted_peripherals() function under DEVICE_SERIAL 2020-02-10 08:17:55 +01:00
Przemyslaw Stekiel 3c0982d939 Add pinmap_gpio_restricted_pins() to provide list of restricted GPIO pins
This is a special case since targets do not provide by default GPIO pin-maps.
This extension is required for FPGA GPIO tests - if some pins have limitations (e.g. fixed pull-up) we need to skip these pins while testing.
To do that we were adding a dummy pin-map with commented out pins that can't be tested because of the limitations.
This solution is redundant and the proposition is to provide a list of restricted gpio pins if required (by default weak implementation is provided with an empty list).

This mechanism will be backward compatible, so the old method with dummy gpio pinmap will also work. The switch from dummy pin-maps to pinmap_gpio_restricted_pins() will be performed in separate commits/PRs.
2020-02-07 10:45:02 +01:00
Przemyslaw Stekiel 54f4777e64 Add STDIO UART as restricted for FPGA testing for all targets
Substantiation for this is that the STDIO UART peripheral is used by Mbed, so it should never be tested.

Also solve the potential problem with accidenty skipped peripherals in FPGA testing. Currently, we have a one `pinmap_restricted_peripherals()` function for all interfaces (UART, I2C, SPI, etc.).
The problem can be encountered if different interfaces have the same peripheral ids (e.g. `UART_0` = 0, `SPI_0` = 0). In this case, if `UART_0` is on the restricted list, then SPI tests will be also skipped for `SPI_0`.
The good news is that usually, the peripheral ids are the base addresses of the peripheral's register set, but we can't rely on this. It is also good that `pinmap_restricted_peripherals()` at this moment is only required for STDIO UART (Nuvoton and STM).

To solve this issue we will change name of `pinmap_restricted_peripherals()` to `pinmap_uart_restricted_peripherals()`, make STDIO UART restricted by default for all targets and update FPGA test utilily functions to use `pinmap_uart_restricted_peripherals()` to skip only uart peripherals.
In the future if needed we can consider to add support to restrict peripherals of other interfaces(SPI, I2C, etc).
2020-02-07 10:45:02 +01:00
Martin Kojtal 62cc4ece8d
Merge pull request #12345 from VeijoPesonen/fix_compiler_warnings
USBMSD; NFCEEPROM; mbed_compat: Fix compiler warnings
2020-02-03 16:59:35 +00:00
Kevin Bracey ba5dd4d8c1
Merge pull request #12153 from mprse/spi_fpga_test_extend
Hackathon: Increase coverage of the SPI master FPGA test
2020-01-31 15:00:02 +02:00
Veijo Pesonen 4278de1f54 HAL: Drops unused variable 2020-01-31 10:19:36 +02:00
Przemyslaw Stekiel d298f963cf Add mapping between SPI defined behavior and test cases 2020-01-29 08:23:58 +01:00
Martin Kojtal 3dbf780322
Merge pull request #12253 from VeijoPesonen/remove_depr_storage_abstraction
storage_abstraction: deprecated since Mbed OS 5.5 and now removed
2020-01-17 14:02:45 +00:00
Martin Kojtal 31988d85fe
Merge pull request #12139 from fkjagodzinski/hal-reset_reason-get_capabilities
HAL: Add a get_capabilities() function to ResetReason API
2020-01-16 14:44:31 +00:00
Veijo Pesonen 25628eb7b8 storage_abstraction: deprecated API removed before Mbed OS 6 2020-01-14 13:12:45 +02:00
Filip Jagodzinski 57420fc2f5 HAL: ResetReason: Add the get_capabilities function
Add the hal_reset_reason_get_capabilities() to ResetReason HAL API.
Add a default, weak implementation, that every target can override.
2020-01-03 12:11:44 +01:00
Heath Petersen a6b0909794 namespace and extern C don't need semicolon 2019-12-26 16:08:22 -06:00
Przemyslaw Stekiel 689e0be00c Extend SPI capabilities
Add setting if block transfer allows different sizes of rx/tx buffers.
2019-12-20 12:56:08 +01:00
Kevin Bracey fe22bc023e Update HAL CRC API
* Change "is supported" check to be a macro, so it can be done at
  compile-time.
* Eliminate weird shift on 7-bit CRCs.
* Add support for 32-bit CRCs and reversals to TMPM3HQ.
2019-12-02 14:45:37 +02:00
Przemyslaw Stekiel b2dad08387 Change explicit pinmap to static pinmap 2019-11-28 08:32:12 +01:00
Przemyslaw Stekiel caf438ed9b get_qspi_pinmap(): Fix invalid condition 2019-11-28 08:32:07 +01:00
Przemyslaw Stekiel 6489bb7c99 STM: Add support for internal ADC pins 2019-11-28 08:32:06 +01:00
Przemyslaw Stekiel dac3c218ef NRF52840_DK: Add explicit pinmap support 2019-11-28 08:32:06 +01:00
Przemyslaw Stekiel 097f3b4969 Explicit pinmap: Add support for CAN and QSPI 2019-11-28 08:32:04 +01:00
Przemyslaw Stekiel 37714c7894 Add can_init_direct() functions to HAL API 2019-11-28 08:32:03 +01:00
Przemyslaw Stekiel 2970e5c699 Add qspi_init_direct() function to HAL API 2019-11-28 08:32:03 +01:00
Przemyslaw Stekiel ba12228556 Explicit pinmap: Fix build failures reported by CI 2019-11-28 08:32:03 +01:00
Przemyslaw Stekiel d75cc97d80 Explicit pinmap - fix style 2019-11-28 08:32:02 +01:00
Przemyslaw Stekiel 17c1b9a860 Fix spelling error 2019-11-28 08:32:02 +01:00
Przemyslaw Stekiel 9a62195810 Add constexpr utility functions to search for pin mapping 2019-11-28 08:32:01 +01:00
Przemyslaw Stekiel f1367c057c Add serial_init_direct(), serial_set_flow_control_direct() functions to HAL API 2019-11-28 08:31:59 +01:00
Przemyslaw Stekiel 618bd18ef5 Add i2c_init_direct() function to HAL API 2019-11-28 08:31:58 +01:00
Przemyslaw Stekiel 60f1cf613e Add analogout_init_direct() function to HAL API 2019-11-28 08:31:58 +01:00
Przemyslaw Stekiel a67e6f0a90 Add analogin_init_direct() function to HAL API 2019-11-28 08:31:57 +01:00
Przemyslaw Stekiel 2ffb0ab65b Add pwmout_init_direct function to HAL API 2019-11-28 08:31:56 +01:00
Przemyslaw Stekiel 582d1b7a37 Add default implementations of xxx_init_direct() functions for explicit pinmap. 2019-11-28 08:31:55 +01:00
Przemyslaw Stekiel fd05ebf96d Add spi_init_direct() function to HAL API 2019-11-28 08:31:55 +01:00
Przemyslaw Stekiel 5aae19792f Add spi_pinmap_t struct 2019-11-28 08:31:55 +01:00
Martin Kojtal 5f7ecea00b
Revert "MbedCRC and CRC HAL revisions" 2019-11-26 13:45:37 +00:00
Kevin Bracey 1f94428a56 Update HAL CRC API
* Change "is supported" check to be a macro, so it can be done at
  compile-time.
* Eliminate weird shift on 7-bit CRCs.
* Add support for 32-bit CRCs and reversals to TMPM3HQ.
2019-11-13 14:31:49 +02:00
Martin Kojtal 33e392e9d9
Merge pull request #11682 from mprse/fpga_tests_CI_targets
Make FPGA tests to pass on CI targets (SPI, analogIn, PWM)
2019-11-07 11:46:40 +01:00
Przemyslaw Stekiel 4b1b4f72af Add spi_get_capabilities() function to HAL API
Add also default weak version of spi_get_capabilities() which provides default/most common SPI parameters.
This function can be replaced if a specific target has different capabilities.
2019-11-06 09:48:25 +01:00
Seppo Takalo 168b51c415 Add storage related files to baseline unittest.
* Refactor some headers to use relative path from Mbed OS root.
* Refactor some data types to compile on 64bit machines.
* Refactor some debug traces to use mbed_trace.
2019-11-04 16:12:36 +02:00
Martin Kojtal eea83007be
Merge pull request #11203 from Tharazi97/Watchdog_lower_limit_timeout_test
Add watchdog lower limit timeout test
2019-10-31 14:25:52 +01:00
Przemyslaw Stekiel 7a6cf2cb51 Add weak implementations of xxx_free() functions 2019-10-29 14:18:17 +01:00
Przemyslaw Stekiel b8a6792ded I2C: Add i2c_free() function to HAL 2019-10-29 10:58:39 +01:00
Przemyslaw Stekiel f19681fc6f GPIO: Add gpio_free() function to HAL 2019-10-29 10:48:31 +01:00
Przemyslaw Stekiel 05d8e1bb89 Analogin: Add analogin_free() function to HAL 2019-10-29 10:48:03 +01:00
Przemyslaw Stekiel b8a8c98d54 HAL API requirements updates after review 2019-10-28 13:10:52 +01:00
Przemyslaw Stekiel 40c4b44385 HAL: Serial: Update the header file doxy (FIXME) 2019-10-28 13:10:51 +01:00
Filip Jagodzinski e98cc2077e HAL: Serial: Update the header file doxy
Clarified defined/undefined behavior.
2019-10-28 13:10:51 +01:00
Przemyslaw Stekiel 1bbcc8fd56 SPI: add defined behavior 2019-10-28 12:52:30 +01:00
Przemyslaw Stekiel 6cec7bbd6d Serial: add defined behavior 2019-10-28 12:52:30 +01:00
Przemyslaw Stekiel 96b48bc241 PWM: add defined behavior 2019-10-28 12:52:30 +01:00
Przemyslaw Stekiel b8d225e860 I2C: add defined behavior 2019-10-28 12:52:30 +01:00
Przemyslaw Stekiel d35e8e3001 GPIO IRQ: add defined behavior 2019-10-28 12:52:30 +01:00
Przemyslaw Stekiel d68bafe472 GPIO: add defined behavior 2019-10-28 12:52:29 +01:00
Przemyslaw Stekiel 85a2cb27a3 Analogout: add defined behavior 2019-10-28 12:52:29 +01:00
Przemyslaw Stekiel 2929895fb1 Analogin: add defined behavior 2019-10-28 12:52:29 +01:00
Kyle Kearney bb872ee196 Restore old qspi_alt_size_t values as compatibility macros 2019-10-16 09:37:27 -07:00
Martin Kojtal 3ca2e14a71
Merge pull request #11627 from jeromecoutant/PR_PINMAP_ERROR
pinmap_peripheral function: update error code for easier debug
2019-10-14 09:27:30 +02:00
jeromecoutant 78ef24dd34 pinmap_peripheral: update error code 2019-10-04 12:50:05 +02:00
Matthew Macovsky baf375f8cb Allow for arbitrary QSPI alt sizes
The QSPI spec allows alt to be any size that is a multiple of the
number of data lines. For example, Micron's N25Q128A uses only a
single alt cycle for all read modes (1, 2, or 4 bits depending on
how many data lines are in use).
2019-09-30 14:45:08 -07:00
int_szyk b54222adf1 Change assumptions of watchdog_api. 2019-09-30 08:10:25 +02:00
int_szyk 69ba9ec916 Add clock_typical_frequency and clock_max_frequency to watchdog api 2019-09-27 16:51:42 +02:00
Martin Kojtal ba7b4799f9
Merge pull request #11439 from hugueskamba/hk-remove-unreachable-statement-warnings
Remove unreachable statements warnings
2019-09-26 14:35:44 +02:00
Hugues Kamba 5724c4cf39 Remove unreachable statements warnings
The warnings are observed when building with the IAR toolchain.
2019-09-23 11:58:49 +01:00
Martin Kojtal 99c19b5288
Merge pull request #10940 from mjm2017/master
Deinitialize the pin definition
2019-09-20 14:18:37 +02:00
Mariwan 358df27c30
Remove Note as requested 2019-09-16 21:46:12 +02:00
Hugues Kamba de231b8664 Move USB Templates to `mbed-os/hal/usb` 2019-08-16 15:42:43 +01:00
Martin Kojtal 69bfc3460b
Merge pull request #11157 from mprse/us_ticker_freq_fix
Relax us ticker frequency requirement + test update
2019-08-13 11:02:16 +02:00
Hugues Kamba c6b0a1488b Fix Ethernet driver build (#11096)
Include the missing header file inclusion to find the added
MBED_DEPRECATED macro.
2019-08-02 12:23:47 +01:00
George Psimenos df5baf6031 USB public APIs cleanup (#11034)
The contents of the usb directory were moved to appropriate locations and the usb directory removed.

* Public USB headers moved under drivers/
* Internal USB headers moved under drivers/internal/
* USB Source code moved under drivers/source/usb/
* Moved usb/device/hal/ under hal/usb/
* Moved usb/device/USBPhy/ under hal/usb/
* Merged usb/device/targets/ into targets/
* Separated public and private USB API documentation under Doxygen groups drivers-public-api and drivers-internal-api.
2019-08-02 12:23:47 +01:00
Hugues Kamba bfa1b4dd84 Drivers/Events/RTOS Public and internal APIs cleanup (#10955)
Separate drivers, events, and rtos internal APIs from public APIs.

* Move source files to source subdirs
* Move internal headers to internal subdirs
* Add Doxygen comments for documenting internal and public APIs
* Remove source code from header files in order to remove include pre-processor directives
that included header files not directly used by said header files
* Explicitly include header files instead of implicit inclusions via third-party header files.

Release Notes

This will break user code that was using an internal API as the internal header files have been moved.
This will only break if the user was including the header file using a namespace (i.e #include "foo/bar.h" instead of #include "bar.h"
2019-08-02 12:23:47 +01:00
Przemyslaw Stekiel 13dff4ae3d Relax us ticker frequency requirement.
This change is required by the Samsung S111(S5JS100). On this board timer clock used for us ticker operates at 26MHz.
According to current requirements, 8 MHz is the top limit for us ticker timer.

This change relaxes top limit to 100 MHz, but only for 32-bit timers.

Ticker common layer schedules one interrupt per timer rollover to trace elapsed time. We need to ensure that this operation is not performed too frequently. I.e. in case of 16-bit timer at 32 MHz, the timer rollover will happen after ~2 ms. This may cause that there will be no time for other tasks. That is why we increase the top limit, but only for 32-bit timers.
2019-08-02 13:13:38 +02:00
Filip Jagodzinski bd5ecaadcd Add HAL API for GPIO-IRQ pinmap 2019-07-25 10:56:04 +02:00
Seppo Takalo 3d5489a6f8
Merge pull request #10644 from fkjagodzinski/hal-gpio_pinmap
Add a gpio pinmap
2019-07-17 14:39:40 +03:00
Seppo Takalo 0425ffda9b
Merge pull request #11026 from c1728p9/skip_peripherals
Add a restricted peripheral list
2019-07-17 14:32:08 +03:00
Russ Butler 57d75538da Add a restricted peripheral list
Allow peripherals to be excluded from testing.
2019-07-11 16:08:33 +01:00
Filip Jagodzinski 07baf079b9 HAL: Serial: Add DEVICE_SERIAL_FC guards
Functions related to serial flow control should not be exposed
if DEVICE_SERIAL_FC is not defined
* serial_set_flow_control,
* serial_cts_pinmap,
* serial_rts_pinmap.
2019-07-09 10:53:08 +02:00
Martin Kojtal ccb63d771e
Merge pull request #10857 from ARMmbed/feature-watchdog
Add Watchdog and ResetReason
2019-07-03 11:43:52 +01:00
Martin Kojtal 85c477c1dc
Merge pull request #10609 from kjbracey-arm/us_ticker_optimise
wait_us optimization
2019-06-28 14:29:00 +01:00
Amanda Butler 9d5757eb52 Edit watchdog_api.h
Edit file, mostly for active voice, consistent tense and international spelling.
2019-06-27 09:26:42 +01:00
Amanda Butler bd5de8d769 Edit reset_reason_api.h
Edit file, mostly for correct grammar.
2019-06-27 09:23:45 +01:00