* Improve uart dma ring buffer. Sending dma still missing
* Add digio module for controlling LEDs, Loudspeaker, and the Digital IOs * General code improvements
This commit is contained in:
@@ -15,7 +15,7 @@ static volatile enum adc_pt1000_error pt1000_error;
|
||||
static volatile uint8_t * volatile streaming_flag_ptr = NULL;
|
||||
static uint32_t filter_startup_cnt;
|
||||
static volatile float adc_pt1000_raw_reading_hf;
|
||||
|
||||
static volatile bool pt1000_measurement_active = false;
|
||||
static volatile uint16_t dma_sample_buffer[ADC_PT1000_DMA_AVG_SAMPLES];
|
||||
|
||||
#define ADC_TO_RES(adc) ((float)(adc) / 4096.0f * 2500.0f)
|
||||
@@ -49,6 +49,8 @@ static inline void adc_pt1000_disable_adc()
|
||||
ADC1->CR2 &= ~ADC_CR2_ADON;
|
||||
DMA2_Stream0->CR = 0;
|
||||
|
||||
pt1000_measurement_active = false;
|
||||
|
||||
rcc_manager_disable_clock(&RCC->APB2ENR, BITMASK_TO_BITNO(RCC_APB2ENR_ADC1EN));
|
||||
rcc_manager_disable_clock(&RCC->AHB1ENR, BITMASK_TO_BITNO(ADC_PT1000_PORT_RCC_MASK));
|
||||
}
|
||||
@@ -139,6 +141,8 @@ void adc_pt1000_setup_meas()
|
||||
adc_pt1000_enable_dma_stream();
|
||||
|
||||
adc_pt1000_setup_sample_frequency_timer();
|
||||
|
||||
pt1000_measurement_active = true;
|
||||
}
|
||||
|
||||
void adc_pt1000_set_moving_average_filter_param(float alpha)
|
||||
@@ -197,12 +201,12 @@ return_value:
|
||||
return ret_val;
|
||||
}
|
||||
|
||||
int adc_pt1000_stream_raw_value_to_memory(uint16_t *adc_array, uint32_t length, volatile uint8_t *flag_to_set)
|
||||
int adc_pt1000_stream_raw_value_to_memory(float *adc_array, uint32_t length, volatile uint8_t *flag_to_set)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void adc_pt1000_convert_raw_value_array_to_resistance(float *resistance_dest, uint16_t *raw_source, uint32_t count)
|
||||
void adc_pt1000_convert_raw_value_array_to_resistance(float *resistance_dest, float *raw_source, uint32_t count)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user