1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
Commit Graph

282 Commits

Author SHA1 Message Date
Ollrogge
72d47013dd periph/flashpage: extend API 2021-10-19 22:33:09 +02:00
Benjamin Valentin
0ee0c5e40e drivers/periph: define periph_rtc_mem 2021-09-03 11:43:42 +02:00
Francisco
a1cbcc9ede
Merge pull request #15902 from maribu/spi-api-change-1
drivers/periph_spi: let spi_acquire return void
2021-09-02 08:50:56 +02:00
Benjamin Valentin
f903ec90d4 drivers/flashpage: flashpage_page() takes a const argument
All addresses to flashpage_page() must be in flash. Flash memory is
`const`, therefore this function must also take `const` pointers.
2021-08-27 14:08:25 +02:00
benpicco
025770968b
Merge pull request #16036 from bergzand/pr/gd32vf103/initial
gd32v/seeedstudio-gd32: Initial support
2021-08-25 00:38:00 +02:00
Benjamin Valentin
75e2a65681 drivers/flashpage: add missing include 2021-08-24 14:30:23 +02:00
Jan Romann
4384795cb9
treewide: Remove excessive newlines 2021-08-13 19:50:38 +02:00
Marian Buschsieweke
9e5f7b6797
drivers/periph_spi: make spi_acquire() return void
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.
2021-08-06 12:46:57 +02:00
benpicco
feac187d54
Merge pull request #16506 from benpicco/drivers/dose-rx_start
drivers/dose: make use of start condition received interrupt
2021-07-28 17:21:29 +02:00
Benjamin Valentin
9194440ead drivers/periph/uart: add periph_uart_rx_start feature 2021-07-27 16:29:30 +02:00
Marian Buschsieweke
e7cacf6f60
periph/uart: Fix doc, use errno for return values
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.
2021-07-09 17:06:01 +02:00
benpicco
619a444741
Merge pull request #16347 from benpicco/drivers/rtt_rtc-rtc_get_time_ms
drivers/rtt_rtc: implement rtc_get_time_ms()
2021-05-05 19:13:21 +02:00
Benjamin Valentin
dcebc7d480 drivers/rtt_rtc: implement rtc_get_time_ms()
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.
2021-05-03 00:09:18 +02:00
Benjamin Valentin
917cf85225 drivers/periph: flashpage: add common helper functions 2021-04-27 16:52:36 +02:00
Marian Buschsieweke
40859b61f0
drivers/periph_spi: fix Doxygen commands
use @retval to document individual return values rather than @return
2021-03-17 10:34:20 +01:00
Marian Buschsieweke
b9cb75fedf
drivers/periph/rtt: add periph_rtt_set_counter feature
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()`.
2021-03-04 18:05:06 +01:00
Jean Pierre Dudey
a30184b5a9
Merge pull request #15896 from maribu/spi-api-cleanup
drivers/periph/spi: clean up error codes and doc
2021-02-27 01:09:49 +01:00
Marian Buschsieweke
acd9f4cc1a
drivers/periph_ptp: fix adjustment API
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*)
2021-02-10 09:55:52 +01:00
Francisco Molina
85caf7cbc7
drivers/flashpage: add FLASHPAGE_ERASE_STATE definition 2021-02-09 11:11:46 +01:00
c93c3e46d6
flashpage: Support non uniform flashpage sizes 2021-02-01 14:27:22 +01:00
Marian Buschsieweke
ae79f5fc59
drivers/periph/spi: clean up error codes and doc
- 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
2021-02-01 11:02:14 +01:00
Marian Buschsieweke
7d1edd51f4
drivers/periph: Added PTP clock API 2020-12-02 17:53:00 +01:00
Hauke Petersen
c4a8c45a3e periph/rtt: fix tick conversion macros 2020-11-16 10:00:24 +01:00
41bbaa7442
flashpage: Make pagewise API optional
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.
2020-11-11 22:26:33 +01:00
Marian Buschsieweke
125c892c03
drivers/periph/timer: Use uint32_t for frequency
For all currently supported platforms `unsigned long` is 32 bit in width. But
better use `uint32_t` to be safe.
2020-10-30 22:02:12 +01:00
Bas Stottelaar
26835a949f drivers/*: remove unused assert.h include 2020-10-22 11:29:27 +02:00
dc8d32d30e
drivers/periph/gpio: fix typo 'occured' -> 'occurred' 2020-10-02 08:05:55 +02:00
MrKevinWeiss
7893158b5a drivers/dev_enums: Remove unused dev_enums.h 2020-09-24 09:27:39 +02:00
chrysn
9295f69da4
Merge pull request #15062 from kaspar030/fix_efm32_16b_timer_set_absolute
cpu/efm32/periph/timer: fix timer_set_absolute() in 16bit case
2020-09-23 11:28:00 +02:00
chrysn
d8d56e5e3a periph/timer: Document that set_absolute is expected to wrap
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.
2020-09-23 10:59:18 +02:00
MrKevinWeiss
cc1c2ab811 drivers/periph: Remove unused timer enum from dev_enums 2020-09-22 16:26:01 +02:00
Benjamin Valentin
696ddf3dbb drivers/periph/timer: amend documentation for timer_set_periodic()
The function needs the `periph_timer_periodic` feature.
Add a `@note` about that to the documentation.
2020-09-13 19:06:28 +02:00
MrKevinWeiss
bdeb39576e drivers/periph: Remove UART from dev_enums.h 2020-09-09 10:25:38 +02:00
benpicco
6f271b7d3e
Merge pull request #14903 from benpicco/drivers/include/periph/rtc-fix
drivers/periph_common: RTC: fix doxygen
2020-09-01 15:15:55 +02:00
Benjamin Valentin
bd57640d5b drivers/periph_common: RTC: fix doxygen 2020-08-31 14:16:42 +02:00
Gunar Schorcht
147b79169c drivers/periph/gpio: add comparison functions
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.
2020-08-31 13:10:28 +02:00
Francisco
ad3568be87
Merge pull request #14712 from benpicco/gpio_init_int-clarify
periph/gpio: clarify behavior of gpio_irq_enable()
2020-08-11 11:30:05 +02:00
Benjamin Valentin
7543e714c1 drivers/periph_common: RTC: move RIOT_EPOCH to header, document it. 2020-08-07 13:22:19 +02:00
Benjamin Valentin
8c95198cbb periph/gpio: clarify behavior of gpio_irq_enable()
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.
2020-08-05 17:41:27 +02:00
benpicco
ecab75b529
Merge pull request #13632 from benpicco/cpu/sam0_common/uart-deinit
drivers/periph/uart: add periph_uart_reconfigure feature & implementation for sam0
2020-07-28 11:12:19 +02:00
Benjamin Valentin
3eb54179ae drivers/periph/uart: add periph_uart_reconfigure feature 2020-07-28 10:10:15 +02:00
Benjamin Valentin
7af8a3e2d3 drivers/periph/timer: add note about TIM_FLAG_RESET_ON_MATCH 2020-07-27 17:17:08 +02:00
Francisco Molina
9dde6ec53d
drivers/rtt: overrite RTT_MAX_VALUE and RTT_FREQUENCY for mock
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.
2020-07-22 08:52:54 +02:00
Benjamin Valentin
896fcd43b0 drivers/periph/spi: add periph_spi_reconfigure feature 2020-06-21 21:19:17 +02:00
Francisco Molina
8d329942df
drivers/periph/rtt: introduce RTT_MIN_OFFSET 2020-06-11 09:30:25 +02:00
Leandro Lanzieri
48759eccdc
drivers/wdt: Add feature to indicate a configurable warning period
This adds the feature `periph_wdt_warning_period` that indicates that a
platform WDT driver implementation supports a configurable
CONFIG_WDT_WARNING_PERIOD.
2020-06-02 12:54:25 +02:00
Benjamin Valentin
cd107be976 drivers/periph/timer: add timer_set_periodic() 2020-05-28 17:37:41 +02:00
Marian Buschsieweke
568404134a
drivers/periph/cpuid: Fix typo in doc 2020-05-14 16:53:05 +02:00
Francisco
cea0d1c532
Merge pull request #13421 from benpicco/cpu/sam0_common/i2c-deinit
drivers/periph/i2c: add periph_i2c_reconfigure feature & implementation for sam0
2020-05-05 19:09:47 +02:00
Benjamin Valentin
21958ff531 drivers/periph/i2c: add periph_i2c_reconfigure feature
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.
2020-05-05 16:12:19 +02:00