The string formatter initially used doesn't seem to be supported by the AVR toolchain. Correctly closing the buffer with a null byte and using plain %s formatter works in all cases
If the user or the board definition doesn't enable `esp_wifi` or `esp_eth`, `esp_now` is defined as default netdev.
fixup! cpu/esp32: defines esp_now as default netdev
- Use standard RIOT style `ina2xx_params_t` on initialization as explained in
[1] instead of a custom API
- Provided a default configuration via `ina2xx_params_t` as required by [1] that
works fine for the INA219 breakout board and with an optimal resolution that
still covers the whole range of USB high-power devices (500 mA @ 5V) with a
comfortable safe margin.
- Changed initialization procedure to include a device reset and connectivity
test, as required by [1]
- The calibration value is now calculated by the driver
- This simplifies using the driver a lot
- The user can still choose a trade-off between range and resolution that
matches the application requirements, but now among predefined values
- This allows the driver to easily convert the raw data into meaningful
physical data, as the resolution of the raw data is known
- All measurements are provided as meaningful physical data as required by [1]
[1]: https://github.com/RIOT-OS/RIOT/wiki/Guide:-Writing-a-device-driver-in-RIOT
The INA219 has the exact same interface as the INA220 (including values and
semantics of the configuration register). Thus, this driver can be used for
both. The ina220 has been renamed to ina2xx to reflect this and pseudo modules
for the ina220 and ina219 have been added.
The tests doesn't work when length_encoding is above the maximum uint16
value.
Also add a set that checks the right error code is returned with too
small length_encoding.
functional changes:
- enable test to test the driver in SPI mode
style changes and code simplification:
- enable SPI mode
- fixed typos in doxygen
- fixed line length issues
- simplified code
- use fmt for formatting numbers
- use US_PER_SEC instead of magic value
- use named return values provided by driver
- use puts where ever applicable
Newer gcc versions have an option to enable overflow warnings for string operations. This option is enabled by default. For this test, it is necessary to disable this warning if the compiler supports this option.
To be able to catch a core panic in debugger and to get the last output from asynchronous UART , e.g., if the stack is smashed, the system is not rebooted immediately anymore but breaks, which stops the execution in debugger or reboots the system after WDT timeout.
This test application defines a packages which imports a very simple Arduino library that is used by test application to demonstrate how an Arduino library can be imported as package and used by an application.