`DOSE_TIMER_DEV` is defined in `board.h`, so we have to include it.
It's not included by the header (and should not), so move the check
to the .c file.
The RSSI values reported by LoRa transceiver can be less than -127.
Therefore, `int8_t` is not enough. This commit defines the RSSI of
`netdev_lora_rx_info` as `int16_t` and adapt the drivers accordingly
(sx126x, sx127x).
This moves the following parts of ethos' state machine out of ISR
context:
- Sending and replying to HELLO messages
- Byte-unstuffing
Some escape handling is still needed in the ISR handler, due to ethos'
protocol design, to determine if a received byte must go into the
netdev queue (tsrb) or the STDIO queue (isrpipe), but the actual
unstuffing is now done in the STDIO and netdev handler threads,
respectively.
When the measurement results are read from the `ALG_RESULT_DATA` register set including the STATUS register, the `DATA_RDY` flag in the STATUS register is already cleared during reading. Therefore it is not possible to check this flag after the `ALG_RESULT_DATA` has been read. Therefore the function `ccs811_read_iaq` always returned `CCS811_ERROR_NO_NEW_DATA` although the data were valid either after checking for new data with the function `ccs811_data_ready` or after triggering the Data Ready interrupt.
This is a temporary fix for Issue #17060. It allows to disable
auto inclusion of `ztimer_periph_rtt` in cases where another
module or application requires direct access.
Limitations:
- as ifeq are involved order of inclusion matters, therefore
these modules should be included early in the build at application
level and not in modules `Makefile.dep`
- this does not disallow direct inclusions of `ztimer_periph_rtt`,
since this only disables auto inclusion of these modules
This is a temporary solution since this is already possible with
Kconfig, but not in make.
Since all implementations simply return 0 and most drivers do not check the return value, it is better to return void and use an assert to ensure that the given device identifier and given device parameters are correct.
The default driver type is just an index into a device array defined
by the board.
If a platform wants to encode additional information in the device type,
it can define a custom type.
This means we can just set the default type to whatever fits the target
CPU best.
On ARM this will still be a 32 bit word, but on AVR it will by a 8 bit byte.
This API change refactors the usbdev API to supply buffers via the
usbdev_ep_xmit function. This changes from the usbdev_ep_ready call to allow
separate buffers per call. An usbdev_ep_buf_t pseudotype is available and must
be used when defining buffers used for endpoints to adhere to the DMA alignment
restrictions often required with usb peripherals.
Main advantage is that the usbdev peripherals no longer have to allocate
oversized buffers for the endpoint data, potentially saving multiple KiB
of unused buffer space. These allocations are now the responsibility of
the individual USB interfaces in the firmware
This API change refactors the usbdev API to supply buffers via the
usbdev_ep_xmit function. This changes from the usbdev_ep_ready call to allow
separate buffers per call. An usbdev_ep_buf_t pseudotype is available and must
be used when defining buffers used for endpoints to adhere to the DMA alignment
restrictions often required with usb peripherals.
Main advantage is that the usbdev peripherals no longer have to allocate
oversized buffers for the endpoint data, potentially saving multiple KiB
of unused buffer space. These allocations are now the responsibility of
the individual USB interfaces in the firmware
By moving all the single byte struct elements to the end, we can reduce
padding inside `dose_t` and ensure that `recv_buf` is always aligned.
This saves some RAM:
master
------
text data bss dec hex filename
36384 136 12944 49464 c138 tests/driver_dose/bin/samr21-xpro/tests_driver_dose.e
this patch
----------
text data bss dec hex filename
36484 136 12936 49556 c194 tests/driver_dose/bin/samr21-xpro/tests_driver_dose.elf
Some CAN transceivers have a standby pin that has to be pulled low
in order to use it.
If the interface is disabled we can set it to high again to save some
power.
BOARDs with RF switch might only support one of the TX modes, and
on init the BOARD needs to be configured accordingly and the correct
mode selected on TX.
The bogus packed attribute added to lis3dh_data_t resulted in the
structure being aligned two 1 byte. It was later casted to an
uint16_t pointer (which is aligned two 2 bytes). By dropping the
packed attribute the alignment mismatch is fixed.
A fixed timeout is either too long for high symbol rates or too short
for low symbol rates.
To fix this, calculate the timeout based on the symbol rate.
For this, the old 5ms timeout is equivalent to 58 bytes being transmitted
at 115200 baud (8 data bit + start & stop bit).
I rounded this to 50 bytes which should yield 4340 µs.
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.
The Silicon Labs Si705x sensors (Si7050/1/3/4/5) are very similar to the
Si7021 sensors featuring only a temperature sensor and no humidity
sensor. The only difference between the Si705x is the temperature
accuracy of the reading, ranging from +/- 0.1 C in the Si7051 to +/- 1 C
in the Si7050.
This patch adds support for this family of sensors extending the
functionality of the existing si70xx driver. Following the style of
other modules, this implements a pseudomodule per supported chip, adding
si7050, si7051, si7053, si7054 and si7055 pseudomodules.
As a minor change this patch also implements the missing
si70xx_get_serial, si70xx_get_id and si70xx_get_revision functions that
were declared in the si70xx.h header but implemented as private
functions. The si70xx_get_id() may be relevant for the application to
know at run time exactly which version of the hardware is installed.
The updated test running with a Si7051 shows the following output, which
seems consistent with the room temperature conditions during the test.
```
make SI70XX_VARIANT=si7051 -C tests/driver_si70xx/ all flash
```
```
SI70XX temperature and humidity sensor test application
Initializing sensor...
[OK]
Found SI7051 sensor, revision 32
temperature: 24.71 C
temperature: 24.69 C
```
tests/driver_ds3231
drivers/ds3231: add alarm support with IRQ
drivers/ds3231: alarm support and documentation
drivers/ds3231: alarm interrupt with mutex
drivers/ds3231: alarm, _unlock function
fixup! drivers/ds3231: add alarm support
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
The driver uses the netdev interface. Due to the limited
capabilities of the transceiver (32 byte FIFO and no source address in the layer2 frame),
it relies on 6LowPAN compression and adds the source address to the frame for that.
Changed the API of `netdev_driver_t`:
- The `send()` function should no longer return the number of bytes and should
not block
- The upper layer now must call the new `confirm_send()` function after
calling `send()`; either busy waiting until something different to `-EBUSY`
is returned, or after `NETDEV_EVENT_TX_COMPLETE` was signaled
During transition to the new API, the upper layer must remain backward
compatible and must assume the legacy API if `netdev_driver_t::confirm_send()`
is `NULL`.
The SI1133 from Silicon Labs is a UV Index Sensor and Ambient Light
Sensor in a small 2x2 mm DFN package. The sensor can measure
independently ultra violet (UV) light, infra red (IR) light and
ambient light, however the ambient light is also influenced by the
IR light requiring compensation from the IR readings.
The SI1133 is quite different from other Silicon Labs chips in RIOT OS
and therefore needs its own driver. In particular, the SI1133 has 7
different photodiode configurations to read but only 6 channels to
read them in parallel so only some channels can be read each time.
This patch implements a new driver allowing to read the data directly
and a saul interface for the three kinds of light source. There are
many configuration options including interrupts and continous modes
that are left out of this initial driver.
This adds an API function to play a buffer of Audio samples using a DAC.
Double buffered operation is supported by specifying a callback that will
be called when the next buffer can be queued with dac_dds_play().
To calibrate the at86rf215 radio, trim value has to be set at run-time
during board production.
Add two helper functions to control the trim value and clock output register.
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.