Commit Graph

303 Commits (b69dc2bdae61bb0401ea98d7d565640c7ca33be0)

Author SHA1 Message Date
Martin Kojtal 64575fe586
Merge pull request #10480 from kjbracey-arm/spi_prime
SPI: Prime asynch transaction buffer on construction
2019-05-14 09:28:41 +01:00
Kevin Bracey 3fbad10337 SPI: Prime asynch transaction buffer on construction
SPI peripherals' asynch transaction buffers are now wrapped by
SingletonPtr, which needs to take the singleton_lock Mutex when first
accessed. If it was first accessed by an asynch transaction started from
IRQ, that would not be possible.

Add a SingletonPtr::get() call to the SPI construction process so that
the peripheral's buffer is fully constructed before any SPI methods can
be called, meaning asynch methods won't fail from IRQ.

(Other pre-existing synchronisation issues with async remain, but this
avoids a new trap in Mbed OS 5.12).
2019-04-25 17:19:01 +03:00
Martin Kojtal 8c696076fc
Merge pull request #10408 from sg-/docs-businout
Update comments and improve readability for the BusInOut class
2019-04-18 18:00:07 +01:00
Amanda Butler 04552a1409
Fix typos in BusInOut.h
Fix typos.
2019-04-17 15:12:19 -05:00
Martin Kojtal 14b9229b13
Merge pull request #10415 from 0xc0170/fix_licenses
rtos/drivers: add license information
2019-04-17 12:26:43 +01:00
Martin Kojtal 5a96f45ce0 license: fix files list 2019-04-16 11:43:14 +01:00
Martin Kojtal 5f985f56dc drivers: add license information 2019-04-16 11:29:14 +01:00
samgrove d88f2d9eed Update comments and improve readability for the BusInOut class 2019-04-15 14:58:24 -05:00
Kevin Bracey 380b27e741 Fix UARTSerial emergency unbuffered write
The length calculation in UARTSerial::write_unbuffered was wrong,
meaning it would truncate output data to half length.

This would show up if `platform.stdio-buffered-serial` was configured to
true, `platform.stdio-convert-newlines` was still false - `mbed_error`
crashes would be garbled.

This wasn't usually spotted because applications generally have both
settings false or both true, and if newline conversion is on, then
`mbed_error_puts` writes 1 character at a time to FileHandle::write,
avoiding the length error.
2019-04-09 16:15:09 +03:00
Cruz Monrreal d2c9d9ddc8
Merge pull request #9111 from embeddedteam103/can_signness_mismatch
CAN: Fix signness mismatch in `CANMessage` constructors
2019-04-01 17:06:09 -05: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
Cruz Monrreal d7bec657ef
Merge pull request #10043 from ithinuel/add_vprintf_to_rawserial
add vprintf to Rawserial.
2019-03-28 17:09:29 -05:00
Cruz Monrreal d3db0a8c2d
Merge pull request #9476 from lrusinowicz/asynch_serial_api
Asynchronous Serial API fixes and refactoring
2019-03-28 17:09:22 -05:00
CoolUsername 6f3ad9a93b CR: Add signed overload 2019-03-26 16:11:50 +02:00
Ryan Morse 51a47139f3 Fixed issue with PWM not being freed when the object is destroyed 2019-03-21 07:48:42 -07: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
Wilfried Chauveau 8b605069f7
add vprintf to Rawserial. 2019-03-15 07:07:16 +00:00
Martin Kojtal 7c9a71846e
Merge pull request #9469 from kjbracey-arm/spi_muxing
SPI upgrade - per-peripheral mutex and GPIO-based SSEL
2019-03-01 18:38:27 +01: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
Kevin Bracey 649856f3ff Implement enable calls in UARTSerial
Implement enable calls so that reception can be shut down to save
power without closing the device.
2019-02-22 11:01:01 +02:00
Leszek Rusinowicz 8586528ff6 Asynchronous Serial API fixes and refactoring, part 3
Updated API documentation to better explain API operation and to explicitly
point out that any event ends the operation.
2019-02-12 17:13:02 +01:00
Leszek Rusinowicz cbb84d8ad3 Asynchronous Serial API fixes and refactoring, part 2
Aborting of asynchronous operation is necessarily hazardous, as
operation can end in interrupt anywhere from the point of decision
until it is actually aborted down the abort_...() method.
Proper deep sleep unlocking requires then use of the critical
section and should be contained completely within API implementation.
2019-02-12 17:09:48 +01:00
Leszek Rusinowicz 6d648092e1 Asynchronous Serial API fixes and refactoring, part 1
1. As RX and TX flows are separate on Serial device, read and write
   functionalities should be completely separate, including any deep
   sleep locking etc.
2. User may want to use asynchronous API without a callback (especially
   for write operations), for example in a command-response scheme
   end of write operation is usually meaningless. The intuitive
   method is to submit NULL pointer for a callback. For this reason
   depending on the _callback field in determining whether the
   operation is in progress seems to be uncertain, so introduced
   additional flags for this purpose.
2019-02-12 17:04:19 +01:00
David Saada 48a3ae9636 FlashIAP driver: Add retries to erase and program operations.
Few boards may fail the write actions due to HW limitations (like critical
drivers that disable flash operations). Just retry a few times until success.
In addition, remove the redundant retries in NVStore (not needed now).
2019-01-30 16:05:27 +02:00
Przemyslaw Stekiel af02b23bf7 Fix for Issue #7308 (Deep_sleep_lock Ticker.h Issue) 2019-01-24 08:22:24 +01:00
kegilbert 70b9b753db Add doxygen spellcheck jobs to Travis
Currently tests
    - drivers
    - platform
    - rtos
    - events
    - features/netsocket
2019-01-11 10:22:15 -06:00
Martin Kojtal ab1c2be997
Merge pull request #8957 from InfernoEmbedded/fix-8913
Fix incorrect #ifdefs on DEVICE_FOO macros
2018-12-20 10:52:06 +00:00
Alastair D'Silva 2617c5d55b Don't use define checks on DEVICE_FOO macros (mbed code)
The DEVICE_FOO macros are always defined (either 0 or 1).

This patch replaces any instances of a define check on a DEVICE_FOO
macro with value test instead.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 10:16:42 +11:00
Alastair D'Silva 24dbfb6b09 Remove #ifdefs for DEVICE_SERIAL & friends
DEVICE_SERIAL is always defined (either 0 or 1).
Remove the faulty checks introduces in commit
26b9a1f6a3 and replace them with
value checks as originally implemented.

Fixes #8913

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
2018-12-20 09:42:02 +11:00
David Saada f3bac3451c Fix FLASHIAP_ROM_END macro for GCC_ARM & IAR toolchains
- Consider data section in GCC_ARM toolchain
- Consider init_array section in IAR toolchain
- Rename macro to FLASHIAP_APP_ROM_END_ADDR for clarity sake
2018-12-19 12:05:08 +02:00
embeddedteam103 0210cefa9e Add unsigned everywhere in the driver for
compatibility with the CAN HAL
2018-12-17 16:49:17 +02:00
Martin Kojtal aec8bb6046 drivers: add spdx license 2018-11-28 10:39:50 +00:00
Russ Butler caa7b93921 Rename lock functions and classes
Invert the name of the lock functions and classes so you are not
locking a negative.
2018-11-27 09:29:32 +00:00
Russ Butler 58ed5c2f7d Change MPU lock name for readability in FlashIAP
Change the variable names in FlashIAP from
'xn' to 'make_ram_executable' and from 'wn' to 'make_rom_writable' to
make the code more readable.
2018-11-27 09:29:32 +00:00
Russ Butler 1821d37621 Overhaul MPU for new requirements
Make the following changes:
-Allow a vector specific ARM MPU driver by defining MBED_MPU_CUSTOM
-Allow ROM address to be configured for ARMv7-M devices by
    setting the define MBED_MPU_ROM_END
-Add ROM write protection
    -Add new functions and lock
    -enable at boot
    -disable during flash programming
2018-11-27 09:29:32 +00:00
Russ Butler d27566c955 Rename MpuXnLock
Rename MpuXnLock  to ScopedMpuXnLock so it has the same naming
convention as ScopedMutexLock. Also make this class inherit from
NonCopyable to prevent misuse.
2018-11-27 09:29:32 +00:00
Russ Butler c0ff98614a Disable the MPU when flashing
When programming flash using the FlashIAP API allow execution from
ram. Many devices require flashing to be done from RAM.

Also allow execution from ram when running the low level flash tests.
2018-11-27 09:29:31 +00:00
Martin Kojtal 9aef9d3661
Merge pull request #8671 from mray19027/uart_break
Feature: Add non-blocking serial break/unbreak functions
2018-11-19 13:14:55 +00:00
Martin Kojtal fbdbffffb9 drivers: fix coding style for doxygen 2018-11-15 07:20:11 +00:00
Michael Ray b7559e315c Feature: Added non-blocking serial break/unbreak functions
Current serial implementation has a send_break() command which
sends a break command on the UART for a fixed amount of time.

Added functions to allow users to send a break in a non-blocking
fashion, as well as for a user-specified amount of time.
2018-11-13 12:46:05 -06:00
Deepika a21a4224c5 Docs update in platform folder
1. Remove protected member functions and protected attributes from rendering
   on docs site
2. Update BusInOut doxygen
2018-11-08 17:31:11 -06:00
David Saada 542744d03c Support erase value in Flash HAL drivers, FlashIAP and block devices 2018-11-07 14:23:07 +02:00
Cruz Monrreal 5549c52da2
Merge pull request #8606 from pea-pod/fix-bus-oboe
Fix off-by-one-error in BusIn/Out
2018-11-06 13:43:27 -06:00
William Kelly III 74f72597a8 Fix off-by-one-error in BusIn/Out 2018-10-31 12:28:53 -05:00
Kevin Bracey 3da44f67ce Add format checking to RawSerial::printf 2018-10-31 15:36:32 +02:00
kegilbert e8e9076662 Fix typos in Drivers doxygen 2018-10-30 15:04:54 -05:00
Russ Butler 3b970c179f Move #endif to fix PwmOut.h doxygen
Move the #endif up so it does not include the closing bracket of
PwmOut. This allows the doxygen for PwmOut, classmbed_1_1_pwm_out.html,
to build.
2018-10-29 10:52:30 -05:00
Cruz Monrreal II b364dcb48e Merge branch 'doc-fix-spi' of ssh://github.com/paul-szczepanek-arm/mbed-os into rollup 2018-10-26 11:43:01 -05:00