pkg/arduino_lis3dh: Arduino library for LIS3DH#12518
pkg/arduino_lis3dh: Arduino library for LIS3DH#12518gschorcht wants to merge 6 commits intoRIOT-OS:masterfrom
Conversation
|
I was a bit confused at first because we already have a driver for That would show how an Arduino driver can be used with minimal extra code. |
pkg/arduino_lis3dh/Makefile
Outdated
| .PHONY: all | ||
|
|
||
| all: | ||
| "$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.arduino_lis3dh |
There was a problem hiding this comment.
| "$(MAKE)" -C $(PKG_BUILDDIR) -f $(CURDIR)/Makefile.arduino_lis3dh | |
| "$(MAKE)" -C $(PKG_BUILDDIR) -f $(RIOTBASE)/Makefile.base MODULE=arduino_lis3dh |
And you can remove the Makefile.arduino_lis3dh
tests/arduino_lis3dh/Makefile
Outdated
| USEMODULE += arduino_lib | ||
| USEMODULE += cpp11-compat |
There was a problem hiding this comment.
I think these dependencies could moved to the package dependencies.
tests/arduino_lis3dh/Makefile
Outdated
| USEMODULE += periph_i2c | ||
| USEMODULE += periph_spi |
There was a problem hiding this comment.
Maybe conditionally add the right module to the build:
ARDUINO_LIS3DH_MODE ?= i2c
ifeq (i2c,$(ARDUINO_LIS3DH_MODE))
FEATURES_REQUIRED += periph_i2c
else ifeq (spi,$(ARDUINO_LIS3DH_MODE))
FEATURES_REQUIRED += periph_spi
CFLAGS += -DARDUINO_LIS3DH_USE_SPI
endifThere was a problem hiding this comment.
After trying a lot, it is not possible to define such dependencies without changing the original source completely by patching what is not the intention of package. The reason is that both interfaces are implemented by the driver which are not selected statically but by member values.
+1 This package could have an empty |
5e0b7d7 to
c21e104
Compare
c21e104 to
cbdcf86
Compare
6516b75 to
33e62e1
Compare
858886c to
bed156b
Compare
bed156b to
2ec2515
Compare
2ec2515 to
780b7bb
Compare
9657881 to
cef86b8
Compare
In difference to the |
A number of Adafruit sensor drivers use the class Adafruit_Sensor from the Adafruit Unified Sensor Driver. To support such drivers, the Adafruit Unified Sensor Driver is imported as package.
The library can be used for testing Arduino I2C and SPI interfaces.
cef86b8 to
1ca6b75
Compare
17460: pkg/arduino_adafruit_sensor: add Adafruit Unified Sensor Driver as package r=benpicco a=gschorcht ### Contribution description This PR provides the [Adafruit Unified Sensor Driver](https://github.com/adafruit/Adafruit_Sensor) as package. There are a number of Adafruit sensor drivers which all use a common base class `Adafruit_Sensor` from the [Adafruit Unified Sensor Driver](https://github.com/adafruit/Adafruit_Sensor). To support such drivers, the Adafruit Unified Sensor Driver is provided as package. Adafruit sensor driver for ST LSM9DS0 will be provided as separat PR as package for demonstration and testing. PR #12518 will be rebased for testing to have an Adafruit sensor driver for a sensor for which there is a native driver in RIOT. ### Testing procedure Use a board that provides the `arduino` feature and flash ``` BOARD=... make -C tests/pkg_arduino_adafruit_sensor flash test ``` PR #12518 can be used as a more complex test for using the package. ### Issues/PRs references Prerequisite for PR #12518 Co-authored-by: Gunar Schorcht <gunar@schorcht.net>
Contribution description
This PR was initially provided for testing PR #12180, #12118 and #10592 along with a complex library and a known sensor. Now where these PRs are merged, the PR is for demonstrating and testing the Adafruit Unified Sensor Driver package in PR #17460.
It includes PR #17460 (commits ac18140 and fa7d4d9).
Testing procedure
Compilation should succeed in CI. The driver package can be tested with any board that support
arduinofeature.Issues/PRs references
Used for PR #12180, #12118 and #10592
Depends on PR #17460