Reworked measurement ADC to use safety controller
This commit is contained in:
		@@ -90,8 +90,6 @@
 | 
			
		||||
 */
 | 
			
		||||
#define ADC_PT1000_WATCHDOG_SAMPLE_COUNT 25U
 | 
			
		||||
 | 
			
		||||
enum adc_pt1000_error {ADC_PT1000_NO_ERR= 0, ADC_PT1000_WATCHDOG_ERROR=(1UL<<0), ADC_PT1000_OVERFLOW=(1UL<<1), ADC_PT1000_INACTIVE = (1UL<<2)};
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief This function sets up the ADC measurement fo the external PT1000 temperature sensor
 | 
			
		||||
 *
 | 
			
		||||
@@ -162,18 +160,6 @@ int adc_pt1000_stream_raw_value_to_memory(volatile float *adc_array, uint32_t le
 | 
			
		||||
 | 
			
		||||
void adc_pt1000_convert_raw_value_array_to_resistance(float *resistance_dest, float *raw_source, uint32_t count);
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Check if the ADC measurement experienced any kind of error (DMA, Analog Watchdog, etc...)
 | 
			
		||||
 *
 | 
			
		||||
 * In case of an error, it may be necessary to call adc_pt1000_setup_meas() again in order to recover from the error
 | 
			
		||||
 */
 | 
			
		||||
enum adc_pt1000_error adc_pt1000_check_error();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Clear the error status of the PT1000 measurement
 | 
			
		||||
 */
 | 
			
		||||
void adc_pt1000_clear_error();
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Disable the PT1000 measurement
 | 
			
		||||
 */
 | 
			
		||||
 
 | 
			
		||||
@@ -35,6 +35,7 @@ enum safety_flag {
 | 
			
		||||
	ERR_FLAG_SAFETY_ADC = (1<<9),
 | 
			
		||||
	ERR_FLAG_SYSTICK = (1<<10),
 | 
			
		||||
	ERR_FLAG_WTCHDG_FIRED = (1<<11),
 | 
			
		||||
	ERR_FLAG_UNCAL = (1<<12),
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
enum timing_monitor {
 | 
			
		||||
@@ -80,4 +81,10 @@ enum analog_value_monitor {
 | 
			
		||||
#define SAFETY_ADC_TEMP_LOW_LIM (0.0f)
 | 
			
		||||
#define SAFETY_ADC_TEMP_HIGH_LIM (65.0f)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * @brief Key used to lock the safefety flags from external ack'ing
 | 
			
		||||
 */
 | 
			
		||||
#define MEAS_ADC_SAFETY_FLAG_KEY 0xe554dac3UL
 | 
			
		||||
 | 
			
		||||
#endif /* __SAFETY_CONFIG_H__ */
 | 
			
		||||
 
 | 
			
		||||
@@ -55,6 +55,8 @@ int safety_controller_handle();
 | 
			
		||||
 | 
			
		||||
int safety_controller_report_error(enum safety_flag flag);
 | 
			
		||||
 | 
			
		||||
int safety_controller_report_error_with_key(enum safety_flag flag, uint32_t key);
 | 
			
		||||
 | 
			
		||||
void safety_controller_report_timing(enum timing_monitor monitor);
 | 
			
		||||
 | 
			
		||||
void safety_controller_report_analog_value(enum analog_value_monitor monitor, float value);
 | 
			
		||||
@@ -69,6 +71,8 @@ int safety_controller_ack_flag(enum safety_flag flag);
 | 
			
		||||
 | 
			
		||||
int safety_controller_ack_flag_with_key(enum safety_flag flag, uint32_t key);
 | 
			
		||||
 | 
			
		||||
bool safety_controller_get_flags_by_mask(enum safety_flag mask);
 | 
			
		||||
 | 
			
		||||
#endif /* __SAFETY_CONTROLLER_H__ */
 | 
			
		||||
 | 
			
		||||
/** @} */
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user