There is no way to properly handle incorrect SPI parameters at run time, so
just having an assertion blow up is the better choice here.
As most instances of `spi_acquire()` don't check the return value anyway, this
will improve debugging experience quite a bit. Some implementation of
spi_acquire() don't even check parameters anyway.
Some terminology issues are fixed. (The speed of an UART interface is
the symbol rate. The unit it is measured in is baud, which is symbols
per second. There is no such thing as baudrate or even baud/s.)
The return codes are changed to use negative errno constants on error
to match the driver design rules. For backward compatibility, the
enum was updated to match the error codes. Unless an application
depends on the exact numerical value (which would be insane), this is
not breaking any code.
RTC on RTT usually runs at a frequency greater than 1 Hz, so sub-second
precision is available.
Add a function to get the current RTC timestamp together with it's sub-second
component.
Some periph_rtt implementations do not provide `rtt_set_counter()`. This
adds `periph_rtt_set_counter` as feature to allow testing for its
availability. The feature is provided at CPU level if periph_rtt is
provided by the board for all CPUs implementing `rtt_set_counter()`.
The clock adjustment API only used a 16 bit integer for speed correction. This
is to course grained to allow compensating clock drifts at high accuracy.
Using a 32 bit integer instead would allow to fix for a drift of up to
about 1 nanosecond drift per each 5 seconds.
That ought to be enough for anyone! (*cough* *cough*)
- Use negative errno as error codes, rather than home-grown enums
- Update the home-grown enum with negative errno codes for backward
compatibility and mark it deprecated
- Update API doc to use negative errno codes
- Fix various style issues in Doxygen doc
- Use `@retval` to document specific return values instead of abusing
`@return` for this
- Align parameters to proper indent level
flashpage currently requires pagewise implementation with an optional
extension for per block writes (flashpage_raw). Most implementations
with flashpage_raw implement the pagewise access via the flashpage_raw
functions. This commit makes the flashpage raw the main access method
and adds an extension feature for the pagewise access.
The functions and defines are renamed to reflect this. The API is also
extended with a dedicated function for erasing a sector.
Most timers are implemented this way already, and keeping (documenting)
it that way allows the generic timer_set implementation to stay as
simple as it is.
The expandable GPIO API requires the comparison of structured GPIO types. This means that inline functions must be used instead of direct comparisons. For the migration process, drivers and other modules must first be changed so that they use the inline comparison functions.
What happens with events that occured after `gpio_irq_disable()` is
currently not defined.
If they are not cleared, they will generate an interrupt on `gpio_irq_enable()`.
This does not seem like the intended behavior, so make the documentation more
explicit.
mock_rtt relies on setting mock values for RTT_MAX_VALUE and
RTT_FREQUENCY. Platforms with a rtt will already define these
values which leads to mock_rtt working with different values than
rtt_rtc.
This commit changes the ifdef logic so that when using mock_rtt
RTT_MAX_VALUE and RTT_FREQUENCY are redefined.
This adds the feature `periph_wdt_warning_period` that indicates that a
platform WDT driver implementation supports a configurable
CONFIG_WDT_WARNING_PERIOD.
It is often desireable to re-configure the pins of a bus back to GPIO mode,
either to save power when an external peripheral is turned off and current
would leak, or because a device may need a non-standard in-band signal to
be generated on the bus lines.
To serve those use cases, this patch introduces four new functions to the
I2C API:
- `i2c_init_pins()` equivalent to spi_init_pins(), restores I2C pin configuration
- `i2c_deinit_pins()` to switch the configuration of the I2C pins back to GPIO
mode and block access to the bus.
- `i2c_pin_sda()` to get the data pin for a given bus
- `i2c_pin_scl()` to get the clock pin for a given bus
Since it's unreasonable to expect having implementations for all platforms
already, those functions are only availiable when the periph_i2c_reconfigure
feature is availiable.
Applications should use FEATURES_REQUIRED += periph_i2c_reconfigure or
FEATURES_OPTIONAL if they want to make use of those functions.