aerofc: Enable I2C1 for external compass

For now it is only checking if there is a external HMC5883, if
necessary more compass should be added and probe.
This commit is contained in:
José Roberto de Souza 2016-10-10 18:39:55 -03:00 committed by Lorenz Meier
parent c49c3f469e
commit 8fb15f1de8
3 changed files with 12 additions and 2 deletions

View File

@ -270,7 +270,11 @@ then
then
fi
if hmc5883 -R 4 start
if hmc5883 -I -R 4 start
then
fi
if hmc5883 -X start
then
fi
fi

View File

@ -255,6 +255,11 @@
* reset the bus to clear stuck slaves. They match the pin configuration,
* but are normally-high GPIOs.
*/
#define GPIO_I2C1_SDA GPIO_I2C1_SDA_2
#define GPIO_I2C1_SCL GPIO_I2C1_SCL_2
#define GPIO_I2C1_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN9)
#define GPIO_I2C1_SCL_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN8)
#define GPIO_I2C3_SDA GPIO_I2C3_SDA_1
#define GPIO_I2C3_SCL GPIO_I2C3_SCL_1
#define GPIO_I2C3_SDA_GPIO (GPIO_OUTPUT|GPIO_OPENDRAIN|GPIO_SPEED_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN9)

View File

@ -87,6 +87,7 @@
* I2C3_SDL PA8 COMPASS_I2C3_SCL JP1-25,26
*
*/
#define PX4_I2C_BUS_EXPANSION 1
#define PX4_I2C_BUS_ONBOARD 3
#define PX4_I2C_OBDEV_HMC5883 0x1E