mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-06-06 07:53:43 +08:00
add ADC to umarim board
This commit is contained in:
@@ -74,7 +74,7 @@ void imu_periodic( void )
|
||||
// Start reading the latest accelerometer data
|
||||
adxl345_periodic();
|
||||
|
||||
//RunOnceEvery(10,imu_umarim_downlink_raw());
|
||||
RunOnceEvery(10,imu_umarim_downlink_raw());
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ void imu_umarim_event( void )
|
||||
// If the itg3200 I2C transaction has succeeded: convert the data
|
||||
itg3200_event();
|
||||
if (itg3200_data_available) {
|
||||
RATES_COPY(imu.gyro_unscaled, itg3200_data);
|
||||
RATES_ASSIGN(imu.gyro_unscaled, itg3200_data.p, itg3200_data.q, itg3200_data.r);
|
||||
itg3200_data_available = FALSE;
|
||||
gyr_valid = TRUE;
|
||||
}
|
||||
@@ -99,6 +99,7 @@ void imu_umarim_event( void )
|
||||
// If the adxl345 I2C transaction has succeeded: convert the data
|
||||
adxl345_event();
|
||||
if (adxl345_data_available) {
|
||||
// Be careful with orientation of the ADXL (ITG axes are taken as default reference)
|
||||
VECT3_ASSIGN(imu.accel_unscaled, adxl345_data.y, -adxl345_data.x, adxl345_data.z);
|
||||
adxl345_data_available = FALSE;
|
||||
acc_valid = TRUE;
|
||||
|
||||
@@ -44,6 +44,39 @@
|
||||
|
||||
/* ADC */
|
||||
|
||||
#define ADC_0 AdcBank1(5)
|
||||
#ifdef USE_ADC_0
|
||||
#ifndef USE_AD1
|
||||
#define USE_AD1
|
||||
#endif
|
||||
#define USE_AD1_5
|
||||
#endif
|
||||
|
||||
#define ADC_1 AdcBank1(4)
|
||||
#ifdef USE_ADC_1
|
||||
#ifndef USE_AD1
|
||||
#define USE_AD1
|
||||
#endif
|
||||
#define USE_AD1_4
|
||||
#endif
|
||||
|
||||
#define ADC_2 AdcBank1(3)
|
||||
#ifdef USE_ADC_2
|
||||
#ifndef USE_AD1
|
||||
#define USE_AD1
|
||||
#endif
|
||||
#define USE_AD1_3
|
||||
#endif
|
||||
|
||||
#define ADC_3 AdcBank1(2)
|
||||
#ifdef USE_ADC_3
|
||||
#ifndef USE_AD1
|
||||
#define USE_AD1
|
||||
#endif
|
||||
#define USE_AD1_2
|
||||
#endif
|
||||
|
||||
|
||||
/* battery */
|
||||
#define ADC_CHANNEL_VSUPPLY AdcBank0(2)
|
||||
#ifndef USE_AD0
|
||||
|
||||
Reference in New Issue
Block a user