Commit Graph

1383 Commits (4d8127223c57cbf2db82c1bda3503ab12b447387)

Author SHA1 Message Date
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
Martin Kojtal fa76620afd watchdog hal: remove space 2019-06-26 14:03:11 +01:00
Martin Kojtal 9cf7a9a327 watchdog: fix astyle issue
Missing a space after group and before license
2019-06-26 11:32:18 +01:00
Filip Jagodzinski 9935bdcb72 HAL: Watchdog: Update the header file
Minor doxygen fixes.
2019-06-26 09:58:31 +01:00
Filip Jagodzinski f084bd5a9d HAL: ResetReason: Update the header file
Add defined & undefined behavior.
Minor doxygen fixes.
2019-06-26 09:58:18 +01:00
Martin Kojtal e40a76575f watchdog: fix copyright 2019-06-26 09:43:21 +01:00
Filip Jagodzinski a33536e78e HAL: Watchdog: Update the header file
Add a SPDX license identifier.
Add defined & undefined behavior.
2019-06-26 09:09:59 +01:00
Martin Kojtal 6229322c64
Merge pull request #10846 from bulislaw/crc_doxy
MbedCRC doxygen fixes
2019-06-25 11:09:43 +01:00
Bartek Szatkowski 9e2b516bca Fix doxygen for MbedCRC 2019-06-17 10:21:33 +01:00
Kevin Bracey 57310729d4 wait_us optimization
As the timer code became more generic, coping with initialization on
demand, and variable width and speed us_ticker_api implementations,
wait_us has gradually gotten slower and slower.

Some platforms have reportedly seen overhead of wait_us() increase from
10µs to 30µs. These changes should fully reverse that drop, and even
make it better than ever.

Add fast paths for platforms that provide compile-time information about
us_ticker. Speed and code size is improved further if:

* Timer has >= 2^32 microsecond range, or better still is 32-bit 1MHz.
* Platform implements us_ticker_read() as a macro
* Timer is initialised at boot, rather than first use

The latter initialisation option is the default for STM, as this has
always been the case.
2019-06-14 10:22:08 +03:00
Przemyslaw Stekiel 869585a196 Ticker common layer: run interrupt reschedule if the inserted event has already expired.
On some platforms, if low power ticker interrupt is set to very close value (e.g. timestamp < current tick + 3), then interrupt may not fire. This is one use case of lp ticker wrapper, but not all platforms use the wrapper. Some platforms cheat a bit and in this case, simply schedules interrupt a bit later. The problem has been found while working on the low-level lp ticker wrapper for ST boards which run lp ticker using LPTIM. These platforms have such limitation.

Failing test: tests-mbed_drivers-lp_timeout (Test Case: Zero delay)

In the test scenarion, the lp ticker callback is attached with 0.0 s delay in the loop. The new events are put in the front of the lp ticker event list and interrupt reschedule is performed. Usually, the new event is already expired, interrupt fires immediately and next event from the list is then scheduled (e.g. system tick). When the next event (e.g. system tick) is very close to the current time it might be scheduled a bit later (because of lp ticker limitation). Let's assume that system tick has been delayed by 3 ticks and while inserting new zero delay event, absolute system tick time on the event list has already expired. In this case, zero delay event may be added after the expired system tick event and no reschedule is performed (because the head of the list has not changed). Interrupt also didn't fire yet since it has been delayed, so after return from attach_callback(0) we are still waiting for the delayed interrupt and zero delay callback has not been called instantly.

This may also affect other platforms which use such delays (Cypress, NORDIC, etc.).

The proposition is to add extra condition while adding an event to the event list. If the inserted event is already expired, then perform reschedule immediately.
2019-06-04 08:50:22 +02:00
Filip Jagodzinski 63fd9f9488 Provide a default gpio_pinmap() for arduino_ff 2019-05-24 16:36:56 +02:00
Donatien Garnier 91ef36809f Apply new astyle config style 2019-05-24 12:23:36 +02:00
Steven Cartmell bafe99ced3 Add text to watchdog documentation indicating that it will continue to run in sleep modes 2019-05-24 11:35:35 +02:00
Bartek Szatkowski f3c6c569d1 Document reset reason enum 2019-05-24 11:35:31 +02:00
Bartek Szatkowski 808ccaf12e Add definition of reset reason and watchdog doxy groups 2019-05-24 11:35:25 +02:00
Steven Cartmell 7c392a16d4 Remove window and sleep mode options for watchdog API 2019-05-24 11:35:13 +02:00
Steven Cartmell 8fa38bb25b Add Watchdog driver API 2019-05-24 11:20:26 +02:00
Steven Cartmell 3c18dcb882 Amend reset reason driver API
- Change API to match C++ API throughout drivers
- Amend HAL API documentation to be more specific
2019-05-24 11:20:26 +02:00
Steven Cartmell 6b3d790fc1 Add function to fetch platform specific reset reason register values 2019-05-24 11:20:24 +02:00
Steven Cartmell 41878bc3de Add Reset Reason platform API 2019-05-24 11:20:23 +02:00
Steven Cartmell 8a97101988 Fix watchdog API issues
- Fix typo in module comment
- Redefine the default system behaviour in sleep mode
- Guard K64F enableWait flag
- Remove bit shifts from reset reason enum
2019-05-24 11:20:22 +02:00
Steven Cartmell c258acc222 Add simple watchdog reference implementation for K64F
- Add preprocessor guard to watchdog api that errors if the reset reason api is not also implemented
- Add RESET_REASON and WATCHDOG to K64F targets.json
- Add watchdog reference implementation
2019-05-24 11:20:21 +02:00
Steven Cartmell 7fe3a387e3 Add Watchdog HAL API specification headers
HAL watchdog functionality will be implemented as two separate APIs. The reset
reason API allows a user to detect the last system reset reason to identify if
a Watchdog was triggered. The Watchdog API allows configuring and updating
Watchdog timers on all boards. This commit defines the headers.
2019-05-24 11:20:20 +02:00
Filip Jagodzinski a6eb48c2de Add HAL API for GPIO pinmap 2019-05-23 14:29:26 +02:00
Kevin Bracey 66f446b9a9 Add GPIO NC test
Check two items of defined behaviour - that you can initialise a
gpio_t with NC, and you can detect that state with gpio_is_connected().
2019-05-02 16:12:21 +03:00
Kevin Bracey ad1acf9af7 gpio_api.h: Clarify desired behaviour for NC
It would probably be worth adding tests for the ability to initialise NC
pins and check `is_connected`. Some platforms are assert failing the
init, and can't be 100% sure `is_connected` is working on those
platforms either.
2019-05-02 12:16:34 +03:00
Cruz Monrreal ab22ab8ce3
Merge pull request #10150 from kjbracey-arm/timer_sleepcheck
Timer: remove hard-coded lp_ticker knowledge
2019-03-28 17:09:36 -05:00
Michael Schwarcz 568feaf7da Remove dependency on us_ticker HAL apis for non USTICKER targets
- Surround mbed_us_ticker_api.c with if DEVICE_USTICKER
- get_us_ticker_data() returns NULL for non-usticker targets.
2019-03-26 09:52:17 +02:00
Kevin Bracey 534a3d2333 Timer: remove hard-coded lp_ticker knowledge
The knowledge that lp_ticker runs in deep sleep was hard-coded with a
comparison check of a ticker_data_t pointer against get_lp_ticker_data.

Remove this hard-coded check, which adds a linker dependency against
the low power ticker even if not being used - put a flag into the
ticker_interface_t.

A future extension might be to move this flag into the ticker_info_t
provided by the HAL, but for the moment keep the assumption that
lp_ticker does run, us_ticker doesn't.
2019-03-20 10:18:49 +02:00
Kevin Bracey b12be6bb80 Rename SPI_COUNT to DEVICE_SPI_COUNT
Avoid collision with some HALs that already define SPI_COUNT.
2019-03-01 14:37:04 +02:00
Kevin Bracey df7e3367f7 Cope with HALs not defining SPIName 2019-03-01 14:33:34 +02:00
Kevin Bracey 5e059b7d1d SPI upgrade - per-peripheral mutex and GPIO-based SSEL
This commit takes some of the work done on the SPI class from #8445, and
refines it, to provide the per-peripheral mutex functionality.

This also implements GPIO-based SSEL, which exposes a new
select()/deselect() API for users to group transfers, and should work on
every platform (unlike the HAL-based SSEL). This requires users to use a
new constructor to avoid backwards compatibility issues.

To activate the per-peripheral mutex, the HAL must define SPI_COUNT and
provide spi_get_peripheral_name().  (In #8445 this is a reworked
spi_get_module, but the name is changed here to avoid a collision with
existing HALs - this commit is designed to work without wider HAL
changes).

Fixes: #9149
2019-03-01 14:33:33 +02:00
Russ Butler 7071513d7f Add form factor pinmap support
Add support for listing all the pins of one or more form factors.
This is in preparation for automated testing of the default form
factor.

This patch includes the following:
-A function to get a list of restricted pins which should not be
    used for testing due to some caveat.
-The target config "default-form-factor" which can specify which form
    factor should be tested
-Form factor information for the arduino form factor
2019-02-08 09:10:45 -06:00
Russ Butler 0dee05a843 Add pinmap utility functions
Add 2 new pinmap utility functions:
-pinmap_find_peripheral_pins
-pinmap_list_has_pin

Also add the new type PinList which contains a list of pins allowing
for NC and duplicate entries.
2019-02-08 09:10:44 -06:00
Russ Butler 8669417e7b Add HAL API for spi pinmap
Add the functions to get spi pinmaps to all targets.
2019-02-08 09:10:37 -06:00
Russ Butler 34c176654d Add HAL API for serial pinmap
Add the functions serial_tx_pinmap, serial_rx_pinmap, serial_cts_pinmap
and serial_rts_pinmap to all targets.
2019-02-08 09:10:28 -06:00
Russ Butler 2ed1dc2bfa Add HAL API for qspi pinmap
Add the functions qspi_master_sclk_pinmap, qspi_master_ssel_pinmap and
qspi_master_data0_pinmap-qspi_master_data3_pinmap to all targets with
qspi support.
2019-02-08 09:10:25 -06:00
Russ Butler be492fe07a Add HAL API for pwmout pinmap
Add the function pwm_pinmap to all targets.
2019-02-08 09:10:19 -06:00
Russ Butler 22a89773fa Add HAL API for i2c pinmap
Add the functions i2c_master_sda_pinmap, i2c_master_scl_pinmap,
i2c_slave_sda_pinmap and i2c_slave_scl_pinmap to all targets.
2019-02-08 09:10:12 -06:00
Russ Butler 7e8695a2c5 Add HAL API for can pinmap
Add the functions can_rd_pinmap and can_td_pinmap to all targets.
2019-02-08 09:10:10 -06:00
Russ Butler 3bd3aca6db Add HAL API for analog out pinmap
Add the function analogout_pinmap to all targets.
2019-02-08 09:10:05 -06:00