mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-19 01:53:34 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user