mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-20 03:23:35 +08:00
move hmc5883 i2c address into driver
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -115,12 +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_HMC5883 0x1e
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -131,13 +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_MPU6050 0x68
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -265,8 +265,6 @@ __BEGIN_DECLS
|
||||
|
||||
#define PX4_I2C_BUS_LED PX4_I2C_BUS_EXPANSION
|
||||
|
||||
#define PX4_I2C_OBDEV_HMC5883 0x1e
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -213,12 +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_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)
|
||||
|
||||
|
||||
@@ -222,12 +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_HMC5883 0x1e
|
||||
|
||||
/*----------------------------------------------------------*/
|
||||
/* FMUv3 Cube SPI chip selects and DRDY */
|
||||
/*----------------------------------------------------------*/
|
||||
|
||||
@@ -162,7 +162,6 @@
|
||||
*
|
||||
* Note that these are unshifted addresses.
|
||||
*/
|
||||
#define PX4_I2C_OBDEV_HMC5883 0x1e
|
||||
#define PX4_I2C_OBDEV_BMP280 0x76
|
||||
|
||||
/*
|
||||
|
||||
@@ -176,12 +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_HMC5883 0x1e
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -236,13 +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_HMC5883 0x1e
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -161,12 +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_HMC5883 0x1e
|
||||
|
||||
/*
|
||||
* ADC channels
|
||||
*
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user