forked from Archive/PX4-Autopilot
Moving define to microhal.h files, for each ST architecture. Correct channels were verified with ST_CUBE header files. For the H7 its a simplification for the current used H7x3. Other devices in that family expect the temperarture on channel 18.
F1: channel 16 F3: channel 16 F4: channel 18 F7: channel 18 H7: channel 17, on STMf32Hx3
This commit is contained in:
parent
528dc41822
commit
6d04a67b02
|
@ -137,8 +137,6 @@
|
|||
#define ADC_HW_REV_SENSE_CHANNEL /* PC3 */ ADC1_CH(13)
|
||||
#define ADC1_SPARE_1_CHANNEL /* PC4 */ ADC1_CH(14)
|
||||
|
||||
#define ADC_INTERNAL_TEMP_SENSOR_CHANNEL (18) /* No Gpio assigned, internal channel*/
|
||||
|
||||
#if BOARD_HAS_NBAT_V == 2 && BOARD_HAS_NBAT_I == 2
|
||||
#define ADC_CHANNELS \
|
||||
((1 << ADC_BATTERY1_VOLTAGE_CHANNEL) | \
|
||||
|
|
|
@ -156,8 +156,6 @@
|
|||
#define ADC_HW_VER_SENSE_CHANNEL /* PF4 */ ADC3_CH(14)
|
||||
#define ADC_HW_REV_SENSE_CHANNEL /* PF5 */ ADC3_CH(15)
|
||||
|
||||
#define ADC_INTERNAL_TEMP_SENSOR_CHANNEL (18) /* No Gpio assigned, internal channel*/
|
||||
|
||||
#define ADC_CHANNELS \
|
||||
((1 << ADC_SCALED_VDD_3V3_SENSORS1_CHANNEL) | \
|
||||
(1 << ADC_SCALED_VDD_3V3_SENSORS2_CHANNEL) | \
|
||||
|
|
|
@ -235,11 +235,9 @@ float px4_arch_adc_reference_v()
|
|||
|
||||
uint32_t px4_arch_adc_temp_sensor_mask()
|
||||
{
|
||||
#ifdef ADC_INTERNAL_TEMP_SENSOR_CHANNEL
|
||||
return 1 << ADC_INTERNAL_TEMP_SENSOR_CHANNEL;
|
||||
#else
|
||||
return 1 << 16;
|
||||
#endif
|
||||
|
||||
return 1 << PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL;
|
||||
|
||||
}
|
||||
|
||||
uint32_t px4_arch_adc_dn_fullcount()
|
||||
|
|
|
@ -46,5 +46,6 @@ __BEGIN_DECLS
|
|||
# define PX4_BBSRAM_GETDESC_IOCTL STM32_BBSRAM_GETDESC_IOCTL
|
||||
#endif
|
||||
#define PX4_NUMBER_I2C_BUSES STM32_NI2C
|
||||
#define APX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL 16
|
||||
|
||||
__END_DECLS
|
||||
|
|
|
@ -46,6 +46,7 @@ __BEGIN_DECLS
|
|||
# define PX4_BBSRAM_GETDESC_IOCTL STM32_BBSRAM_GETDESC_IOCTL
|
||||
#endif
|
||||
#define PX4_NUMBER_I2C_BUSES STM32_NI2C
|
||||
#define APX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL 16
|
||||
|
||||
__END_DECLS
|
||||
|
||||
|
|
|
@ -46,6 +46,6 @@ __BEGIN_DECLS
|
|||
# define PX4_BBSRAM_GETDESC_IOCTL STM32_BBSRAM_GETDESC_IOCTL
|
||||
#endif
|
||||
#define PX4_NUMBER_I2C_BUSES STM32_NI2C
|
||||
|
||||
#define PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL 18
|
||||
__END_DECLS
|
||||
|
||||
|
|
|
@ -46,6 +46,8 @@ __BEGIN_DECLS
|
|||
#define PX4_BBSRAM_GETDESC_IOCTL STM32F7_BBSRAM_GETDESC_IOCTL
|
||||
#define PX4_FLASH_BASE 0x08000000
|
||||
#define PX4_NUMBER_I2C_BUSES STM32F7_NI2C
|
||||
#define PX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL 18
|
||||
|
||||
|
||||
int stm32_flash_lock(void);
|
||||
int stm32_flash_unlock(void);
|
||||
|
|
|
@ -315,7 +315,7 @@ float px4_arch_adc_reference_v()
|
|||
|
||||
uint32_t px4_arch_adc_temp_sensor_mask()
|
||||
{
|
||||
return 1 << 16;
|
||||
return 1 << APX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL;
|
||||
}
|
||||
|
||||
uint32_t px4_arch_adc_dn_fullcount()
|
||||
|
|
|
@ -62,5 +62,6 @@ int stm32h7_flash_lock(size_t addr);
|
|||
int stm32h7_flash_unlock(size_t addr);
|
||||
int stm32h7_flash_writeprotect(size_t block, bool enabled);
|
||||
#define stm32_flash_lock() stm32h7_flash_lock(PX4_FLASH_BASE)
|
||||
#define APX4_ADC_INTERNAL_TEMP_SENSOR_CHANNEL 17 //Valid for ADC3 on H7x3
|
||||
|
||||
__END_DECLS
|
||||
|
|
Loading…
Reference in New Issue