From 8567bd1c5c0211cc17685c0f846de339c50341f1 Mon Sep 17 00:00:00 2001 From: Michael Ingraham <34340210+meingraham@users.noreply.github.com> Date: Fri, 14 Jun 2019 15:05:50 -0400 Subject: [PATCH] Updated Sensor API (markdown) --- Sensor-API.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sensor-API.md b/Sensor-API.md index cdfd1c24..8b934806 100644 --- a/Sensor-API.md +++ b/Sensor-API.md @@ -21,7 +21,7 @@ Using generic libraries from external sources for sensors should be avoided as f # API structure ## Pre-processor directives -Conditional compiling of a sensor driver is achieved by commenting/uncommenting a pre-processor directive of the scheme `USE_` in `my_user_config.h`. Accordingly the driver code has to be wrapped in `#ifdef USE_ ... #endif // USE_`. Any Sensor driver must contain a pre-processor directive defining the driver ID by the scheme `#define XSNS_`. +Conditional compiling of a sensor driver is achieved by adding a pre-processor directive of the scheme `USE_` in `user_config_override.h`. Accordingly the driver code has to be wrapped in `#ifdef USE_ ... #endif // USE_`. Any Sensor driver must contain a pre-processor directive defining the driver ID by the scheme `#define XSNS_`. ## Callback function @@ -117,7 +117,7 @@ Setting a flag that the driver was successful in detecting the attached chip/boa When writing your function responsible for detecting an externally connected I2C device try to create a method by which you read or write to specific registers that would be applicable to that specific I2C device only as to confirm a positive detect for the device. If this is not done extensively it will lead to some drivers getting false detects for a different device type simply because it shares the same I2C address. -Unless your driver is specifically going to use the entire array of addresses provisioned by the manufacturer please consider using a #define USE_MYCHIPNAME_ADDR in the user_config.h so that the user may specify the address on which to expect the device. This is of course only applicable to drivers that are not enabled by default in any of the pre-built binaries. +Unless your driver is specifically going to use the entire array of addresses provisioned by the manufacturer please consider using a #define USE_MYCHIPNAME_ADDR in the `user_config_override.h` so that the user may specify the address on which to expect the device. This is of course only applicable to drivers that are not enabled by default in any of the pre-built binaries. **I2C address auto-detection example** ```