63#ifndef NTC_FILTER_BUFFER_SIZE
64 #define NTC_FILTER_BUFFER_SIZE 32
117 uint8_t (*
adc_read)(uint32_t *counter, uint16_t len);
174#define DRIVER_NTC_LINK_INIT(HANDLE, STRUCTURE) memset(HANDLE, 0, sizeof(STRUCTURE))
182#define DRIVER_NTC_LINK_ADC_INIT(HANDLE, FUC) (HANDLE)->adc_init = FUC
190#define DRIVER_NTC_LINK_ADC_DEINIT(HANDLE, FUC) (HANDLE)->adc_deinit = FUC
198#define DRIVER_NTC_LINK_ADC_READ(HANDLE, FUC) (HANDLE)->adc_read = FUC
206#define DRIVER_NTC_LINK_DELAY_MS(HANDLE, FUC) (HANDLE)->delay_ms = FUC
214#define DRIVER_NTC_LINK_DEBUG_PRINT(HANDLE, FUC) (HANDLE)->debug_print = FUC
651 float q_process_noise_covariance,
652 float r_measurement_noise_covariance,
653 float p_estimation_error_covariance,
654 float x_estimated_value);
uint8_t ntc_read_temperature(ntc_handle_t *handle, float *ohm, float *degrees_celsius)
read temperature
uint8_t ntc_set_algorithm_steinhart_hart(ntc_handle_t *handle, double a, double b, double c)
set algorithm steinhart hart
uint8_t ntc_set_circuit(ntc_handle_t *handle, ntc_circuit_t circuit)
set circuit
uint8_t ntc_load_algorithm_lookup_table(ntc_handle_t *handle, const ntc_table_t *table, uint16_t table_len)
load algorithm lookup table
uint8_t ntc_set_algorithm(ntc_handle_t *handle, ntc_algorithm_t algorithm)
set algorithm
#define NTC_FILTER_BUFFER_SIZE
ntc filter buffer size definition
ntc_filter_t
ntc filter enumeration definition
uint8_t ntc_get_circuit_fixed_resistor(ntc_handle_t *handle, float *r_fixed_ohm)
get circuit fixed resistor
uint8_t ntc_info(ntc_info_t *info)
get chip's information
uint8_t ntc_set_algorithm_beta_formula_r25_ohm(ntc_handle_t *handle, float r25_ohm)
set algorithm beta formula r25 ohm
ntc_algorithm_t
ntc algorithm enumeration definition
uint8_t ntc_init(ntc_handle_t *handle)
initialize the chip
ntc_circuit_t
ntc circuit enumeration definition
uint8_t ntc_get_circuit(ntc_handle_t *handle, ntc_circuit_t *circuit)
get circuit
uint8_t ntc_get_algorithm_beta_formula_beta_value(ntc_handle_t *handle, float *beta)
get algorithm beta formula beta value
uint8_t ntc_calculate_temperature_with_filter(ntc_handle_t *handle, float *ohm, uint16_t len, float *degrees_celsius)
calculate temperature with filter
struct ntc_info_s ntc_info_t
ntc information structure definition
uint8_t ntc_get_algorithm(ntc_handle_t *handle, ntc_algorithm_t *algorithm)
get algorithm
uint8_t ntc_set_algorithm_beta_formula_beta_value(ntc_handle_t *handle, float beta)
set algorithm beta formula beta value
uint8_t ntc_get_algorithm_beta_formula_r25_ohm(ntc_handle_t *handle, float *r25_ohm)
get algorithm beta formula r25 ohm
struct ntc_handle_s ntc_handle_t
ntc handle structure definition
uint8_t ntc_get_algorithm_steinhart_hart(ntc_handle_t *handle, double *a, double *b, double *c)
get algorithm steinhart hart
uint8_t ntc_deinit(ntc_handle_t *handle)
close the chip
struct ntc_table_s ntc_table_t
ntc table structure definition
uint8_t ntc_calculate_temperature(ntc_handle_t *handle, float ohm, float *degrees_celsius)
calculate temperature
uint8_t ntc_set_circuit_fixed_resistor(ntc_handle_t *handle, float r_fixed_ohm)
set circuit fixed resistor
@ NTC_FILTER_ANTI_SPIKE_AVERAGE
@ NTC_FILTER_FIRST_ORDER_LAG
@ NTC_FILTER_MOVING_AVERAGE
@ NTC_FILTER_WEIGHTED_MOVING_AVERAGE
@ NTC_ALGORITHM_LOOKUP_TABLE
@ NTC_ALGORITHM_BETA_FORMULA
@ NTC_ALGORITHM_STEINHART_HART
@ NTC_CIRCUIT_VCC_R_NTC_GND
@ NTC_CIRCUIT_VCC_NTC_R_GND
uint8_t ntc_set_filter_first_order_lag(ntc_handle_t *handle, float alpha)
set filter first order lag
uint8_t ntc_set_filter_moving_average_length(ntc_handle_t *handle, uint16_t length)
set filter moving average length
uint8_t ntc_get_filter(ntc_handle_t *handle, ntc_filter_t *filter)
get filter
uint8_t ntc_set_filter_limiting(ntc_handle_t *handle, float degrees_celsius)
set filter limiting
uint8_t ntc_set_filter_median_length(ntc_handle_t *handle, uint16_t length)
set filter median length
uint8_t ntc_reset_filter(ntc_handle_t *handle)
reset the filter
uint8_t ntc_set_filter_anti_spike_average_length(ntc_handle_t *handle, uint16_t length)
set filter anti spike average length
uint8_t ntc_set_filter(ntc_handle_t *handle, ntc_filter_t filter)
set filter
uint8_t ntc_set_filter_kalman(ntc_handle_t *handle, float q_process_noise_covariance, float r_measurement_noise_covariance, float p_estimation_error_covariance, float x_estimated_value)
set filter kalman
uint8_t ntc_set_filter_weighted_moving_average_length(ntc_handle_t *handle, float *weight, uint16_t length)
set filter weighted moving average length
ntc handle structure definition
float buf_flt[NTC_FILTER_BUFFER_SIZE]
uint32_t buf[NTC_FILTER_BUFFER_SIZE]
const ntc_table_t * table
void(* delay_ms)(uint32_t ms)
uint8_t(* adc_read)(uint32_t *counter, uint16_t len)
float cache_flt[NTC_FILTER_BUFFER_SIZE]
uint8_t(* adc_init)(uint32_t *vcc_counter)
float param_flt[NTC_FILTER_BUFFER_SIZE]
void(* debug_print)(const char *const fmt,...)
uint8_t(* adc_deinit)(void)
ntc information structure definition
float supply_voltage_max_v
char manufacturer_name[32]
float supply_voltage_min_v
ntc table structure definition