Skip to content

Commit

Permalink
Merge pull request #13831 from akshaim/I2C_Address_Cleanup
Browse files Browse the repository at this point in the history
I2C Address Cleanup and Documentation
  • Loading branch information
leandrolanzieri committed Apr 17, 2020
2 parents 32694e0 + b75fc0c commit 369eda6
Show file tree
Hide file tree
Showing 8 changed files with 71 additions and 14 deletions.
29 changes: 28 additions & 1 deletion drivers/include/bmx055.h
Expand Up @@ -36,12 +36,39 @@ extern "C" {
#endif

/**
* @name The sensors default I2C addresses
* @defgroup drivers_bmx055_config BMX055 sensor driver compile configuration
* @ingroup config_drivers_sensors
* @{
*/
/**
* @brief Magnetometer default address
*
* The address depends on part number of SDO1, SDO2 and CSB3.
* For more information on SerialBus Address, refer section 11.2 in datasheet.
*/
#ifndef BMX055_MAG_ADDR_DEFAULT
#define BMX055_MAG_ADDR_DEFAULT (0x10U)
#endif

/**
* @brief Accelerometer default address
*
* The address depends on part number of SDO1, SDO2 and CSB3.
* For more information on SerialBus Address, refer section 11.2 in datasheet.
*/
#ifndef BMX055_ACC_ADDR_DEFAULT
#define BMX055_ACC_ADDR_DEFAULT (0x18U)
#endif

/**
* @brief Gyroscope default address
*
* The address depends on part number of SDO1, SDO2 and CSB3.
* For more information on SerialBus Address, refer section 11.2 in datasheet.
*/
#ifndef BMX055_GYRO_ADDR_DEFAULT
#define BMX055_GYRO_ADDR_DEFAULT (0x68U)
#endif
/** @} */

/**
Expand Down
2 changes: 0 additions & 2 deletions drivers/include/ds1307.h
Expand Up @@ -34,9 +34,7 @@ extern "C" {
/**
* @brief I2C address of DS1307 RTC
*/
#ifndef DS1307_I2C_ADDRESS
#define DS1307_I2C_ADDRESS (0x68)
#endif

/**
* @defgroup drivers_ds1307_config DS1307 RTC driver compile configuration
Expand Down
2 changes: 0 additions & 2 deletions drivers/include/hts221.h
Expand Up @@ -36,9 +36,7 @@ extern "C" {
/**
* @brief Default I2C bus address (7 Bit) of HTS221 devices
*/
#ifndef HTS221_I2C_ADDRESS
#define HTS221_I2C_ADDRESS (0x5F)
#endif

/**
* @brief Parameters needed for device initialization
Expand Down
19 changes: 16 additions & 3 deletions drivers/include/isl29020.h
Expand Up @@ -31,10 +31,23 @@
extern "C" {
#endif

/**
* @brief The sensors default I2C address
*/
/**
* @defgroup drivers_isl29020_config ISL29020 light sensor driver compile configuration
* @ingroup config_drivers_sensors
* @{
*/
/**
* @brief Default address
*
* The address depends on the status of A0 Pin.
* Default address corresponds to A0 connected to GND.
* For more information on SerialBus Address, refer Section I2C
* Interface on Page 3 of datasheet.
*/
#ifndef ISL29020_DEFAULT_ADDRESS
#define ISL29020_DEFAULT_ADDRESS 0x44
#endif
/** @} */

/**
* @brief Possible modes for the ISL29020 sensor
Expand Down
15 changes: 14 additions & 1 deletion drivers/include/l3g4200d.h
Expand Up @@ -37,9 +37,22 @@
#endif

/**
* @brief The sensors default I2C address
* @defgroup drivers_l3g4200d_config L3G4200D gyroscope driver compile configuration
* @ingroup config_drivers_sensors
* @{
*/
/**
* @brief Default address
*
* The address depends on the status of SDO Pin.
* Default address corresponds to SD0 connected to GND.
* For more information on SerialBus Address, refer Section 5.1.1
* I2C Operation on datasheet.
*/
#ifndef L3G4200D_DEFAULT_ADDRESS
#define L3G4200D_DEFAULT_ADDRESS 0x68
#endif
/** @} */

/**
* @brief Result vector for gyro measurement
Expand Down
9 changes: 9 additions & 0 deletions drivers/include/lpsxxx.h
Expand Up @@ -36,13 +36,22 @@ extern "C" {
#include <stdint.h>
#include "periph/i2c.h"

/**
* @defgroup drivers_lpsxxx_config LPS331AP/LPS25HB/LPS22HB driver compile configuration
* @ingroup config_drivers_sensors
* @{
*/
/**
* @brief The sensors default I2C address
*
* Default address corresponds to SDO/SA0 pad connected to ground. If SDO/SA0
* pad is connected to power supply, I2C address is 0x5C.
* Refer to 'I2C Operation' section on the datasheet
*/
#ifndef LPSXXX_DEFAULT_ADDRESS
#define LPSXXX_DEFAULT_ADDRESS (0x5d)
#endif
/** @} */

/**
* @brief Return codes
Expand Down
2 changes: 0 additions & 2 deletions drivers/include/mpl3115a2.h
Expand Up @@ -50,12 +50,10 @@ enum {
MPL3115A2_ERROR_CNF, /**< Device configuration failed */
};

#ifndef MPL3115A2_I2C_ADDRESS
/**
* @brief MPL3115A2 Default Address
*/
#define MPL3115A2_I2C_ADDRESS (0x60)
#endif

/**
* @name Oversample Ratio configuration
Expand Down
7 changes: 4 additions & 3 deletions drivers/include/tcs37727.h
Expand Up @@ -36,9 +36,10 @@ extern "C"
{
#endif

#ifndef TCS37727_I2C_ADDRESS
#define TCS37727_I2C_ADDRESS 0x29 /**< Default Device Address */
#endif
/**
* @brief Default Device Address
*/
#define TCS37727_I2C_ADDRESS 0x29

/**
* @defgroup drivers_tcs37727_config TCS37727 RGB Light Sensor driver compile configuration
Expand Down

0 comments on commit 369eda6

Please sign in to comment.