Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

move constant driver I2C addresses out of board configs #9076

Merged
merged 2 commits into from
Mar 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions platforms/qurt/include/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
#define PX4_I2C_BUS_EXPANSION 3
#define PX4_I2C_BUS_LED 3

#define PX4_I2C_OBDEV_LED 0x55

#define BOARD_OVERRIDE_UUID "SYSMEMID"

#include "../common/board_common.h"
2 changes: 0 additions & 2 deletions src/drivers/boards/aerofc-v1/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@
#define PX4_I2C_BUS_EXPANSION1 2
#define PX4_I2C_BUS_ONBOARD 3

#define PX4_I2C_OBDEV_HMC5883 0x1e

#define GPIO_SPI_CS_MPU6500 (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_SET|GPIO_PORTA|GPIO_PIN4)
#define PX4_SPI_BUS_SENSORS 1
#define PX4_SPIDEV_MPU PX4_MK_SPI_SEL(PX4_SPI_BUS_SENSORS, 1)
Expand Down
7 changes: 0 additions & 7 deletions src/drivers/boards/auav-x21/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,6 @@
#define PX4_I2C_BUS_EXPANSION 1
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION

/* Devices not on the onboard bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*
* ADC channels
*
Expand Down
1 change: 0 additions & 1 deletion src/drivers/boards/eagle/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
#define PX4_I2C_BUS_EXPANSION 3
#define PX4_I2C_BUS_LED 3
#define PX4_NUMBER_I2C_BUSES 3
#define PX4_I2C_OBDEV_LED 0x55

#include <system_config.h>
#include "../common/board_common.h"
8 changes: 0 additions & 8 deletions src/drivers/boards/mindpx-v2/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,6 @@
#define PX4_I2C_BUS_EXPANSION 2
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION

/* Devices on the onboard bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_HMC5883 0x1e
#define PX4_I2C_OBDEV_LED 0x55
// #define PX4_I2C_OBDEV_MPU6050 0x68

/*
* ADC channels
*
Expand Down
3 changes: 0 additions & 3 deletions src/drivers/boards/nxphlite-v3/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,6 @@ __BEGIN_DECLS

#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION

#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*
* ADC channels
*
Expand Down
1 change: 0 additions & 1 deletion src/drivers/boards/ocpoc/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
#define BOARD_NUMBER_I2C_BUSES 4
#define BOARD_MAX_LEDS 1 // Number external of LED's this board has
#define PX4_I2C_BUS_LED 1
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_BUS_EXPANSION 1

// Battery ADC channels
Expand Down
7 changes: 0 additions & 7 deletions src/drivers/boards/px4-same70xplained-v1/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,6 @@ __BEGIN_DECLS
/* No Onboard Sensors #define PX4_I2C_BUS_ONBOARD 0 */
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION

/* Devices on the onboard bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/* Define the follwoing to output the clock on J500-1 */
//#define GPIO_PCK1 (GPIO_PERIPHB | GPIO_CFG_DEFAULT | GPIO_PORT_PIOA | GPIO_PIN17)

Expand Down
7 changes: 0 additions & 7 deletions src/drivers/boards/px4fmu-v2/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,13 +222,6 @@
#define PX4_I2C_BUS_ONBOARD 2
#define PX4_I2C_BUS_LED PX4_I2C_BUS_ONBOARD

/* Devices on the onboard bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*----------------------------------------------------------*/
/* FMUv3 Cube SPI chip selects and DRDY */
/*----------------------------------------------------------*/
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/boards/px4fmu-v4/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e
#define PX4_I2C_OBDEV_BMP280 0x76

/*
Expand Down
7 changes: 0 additions & 7 deletions src/drivers/boards/px4fmu-v4pro/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,13 +176,6 @@
#define PX4_I2C_BUS_EXPANSION 2
#define PX4_I2C_BUS_LED PX4_I2C_BUS_ONBOARD

/* Devices on the external bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*
* ADC channels
*
Expand Down
8 changes: 0 additions & 8 deletions src/drivers/boards/px4fmu-v5/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -236,14 +236,6 @@
#define BOARD_NUMBER_I2C_BUSES 4
#define BOARD_I2C_BUS_CLOCK_INIT {100000, 100000, 100000, 100000}

/* Devices on the external bus.
*
* Note that these are unshifted addresses.
*/

#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*
* ADC channels
*
Expand Down
7 changes: 0 additions & 7 deletions src/drivers/boards/px4nucleoF767ZI-v1/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ __BEGIN_DECLS
#define PX4_I2C_BUS_EXPANSION 4
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION

/* Devices on the external bus.
*
* Note that these are unshifted addresses.
*/
#define PX4_I2C_OBDEV_LED 0x55
#define PX4_I2C_OBDEV_HMC5883 0x1e

/*
* ADC channels
*
Expand Down
2 changes: 0 additions & 2 deletions src/drivers/boards/tap-v1/board_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,6 @@
#define PX4_I2C_BUS_SONAR 2
#define PX4_I2C_BUS_EXPANSION 3

#define PX4_I2C_OBDEV_HMC5883 0x1e

#define PX4_I2C_BUS_ONBOARD_HZ 400000
#define PX4_I2C_BUS_SONAR_HZ 400000
#define PX4_I2C_BUS_EXPANSION_HZ 400000
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/imu/mpu6000/mpu6000_i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,4 @@ MPU6000_I2C::probe()
return (read(MPUREG_WHOAMI, &whoami, 1) > 0 && (whoami == expected)) ? 0 : -EIO;

}
#endif /* PX4_I2C_OBDEV_HMC5883 */
#endif /* USE_I2C */
6 changes: 1 addition & 5 deletions src/drivers/magnetometer/hmc5883/hmc5883_i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@

#include "board_config.h"

#ifdef PX4_I2C_OBDEV_HMC5883

#define HMC5883L_ADDRESS PX4_I2C_OBDEV_HMC5883
#define HMC5883L_ADDRESS 0x1E

device::Device *HMC5883_I2C_interface(int bus);

Expand Down Expand Up @@ -172,5 +170,3 @@ HMC5883_I2C::read(unsigned address, void *data, unsigned count)
uint8_t cmd = address;
return transfer(&cmd, 1, (uint8_t *)data, count);
}

#endif /* PX4_I2C_OBDEV_HMC5883 */
2 changes: 1 addition & 1 deletion src/drivers/rgbled/rgbled.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
#define RGBLED_ONTIME 120
#define RGBLED_OFFTIME 120

#define ADDR PX4_I2C_OBDEV_LED /**< I2C adress of TCA62724FMG */
#define ADDR 0x55 /**< I2C adress of TCA62724FMG */
#define SUB_ADDR_START 0x01 /**< write everything (with auto-increment) */
#define SUB_ADDR_PWM0 0x81 /**< blue (without auto-increment) */
#define SUB_ADDR_PWM1 0x82 /**< green (without auto-increment) */
Expand Down