I am trying to add a sensor to my project. I have already verified that it is electrically connected to the i2c bus correctly with a simple test program which reads the WHO_AM_I register using direct i2c_transfer calls:
struct i2c_msg msgs;
msgs.buf = data;
msgs.len = num_bytes;
msgs.flags = I2C_MSG_READ | I2C_MSG_STOP;
return i2c_transfer(i2c_dev, &msgs, 1, addr);
Now I want to enable the sensor subsystem, that seems easy enough, just add a few lines to the prj.conf file:
And finally since the drivers are already in the zephyrproject tree, I want to use the LSM9DS1 drivers that are in modules/hal/st/sensor/stmemsc/lsm9ds1_STdC/driver
Here is where I get stuck, I know I need to add a few things:
‘ninja menuconfig’ doesn’t know anything about the external modules, although west build did put the name of the directory in build/zephyr_modules.txt
I couldn’t find any examples even for other sensors in the zephyr/samples directory, or in the zephyrproject documentation (although but I may have missed it).
Does someone have an example of the device tree entries, and the build process for an external sensor module?
Connected Transport Market Unit
CONFIDENTIAL: This e-mail and any attachments are confidential and intended solely for the use of the individual(s) to whom it is addressed. It can contain proprietary confidential information and be subject to legal privilege and/or subject to a non-disclosure Agreement. Unauthorized use, disclosure or copying is strictly prohibited. If you are not the/an addressee and are in possession of this e-mail, please delete the message and notify us immediately. Please consider the environment before printing this e-mail. Thank you.