ruuvi.drivers.c  ${PROJECT_VERSION}
Drivers for external sensors and peripherals on embedded systems.
ruuvi_interface_adc_ntc.c File Reference

Go to the source code of this file.

Macros

#define ADC_NTC_USE_CHANNEL   1
 
#define ADC_NTC_USE_DIVIDER   1.00f
 
#define ADC_NTC_USE_VDD   3.60f
 
#define ADC_NTC_BALANCE   10000.00f
 
#define ADC_NTC_DEFAULT_RES   10000.00f
 
#define ADC_NTC_DEFAULT_TEMP   25.00f
 
#define ADC_NTC_DEFAULT_BETA   3974.0f
 
#define ADC_NTC_DATA_COUNTER   1
 
#define ADC_NTC_DEFAULT_BITFIELD   0
 
#define ADC_NTC_ENABLE_BYTE   1
 
#define ADC_K_TO_C_CONST   273.15f
 
#define ADC_NTC_DEFAULT_TEMP_K   (ADC_NTC_DEFAULT_TEMP + ADC_K_TO_C_CONST)
 

Functions

rd_status_t ri_adc_ntc_samplerate_set (uint8_t *samplerate)
 rd_sensor_setup_fp More...
 
rd_status_t ri_adc_ntc_resolution_set (uint8_t *resolution)
 rd_sensor_setup_fp More...
 
rd_status_t ri_adc_ntc_scale_set (uint8_t *scale)
 rd_sensor_setup_fp More...
 
rd_status_t ri_adc_ntc_dsp_set (uint8_t *dsp, uint8_t *parameter)
 rd_sensor_dsp_fp More...
 
rd_status_t ri_adc_ntc_dsp_get (uint8_t *dsp, uint8_t *parameter)
 rd_sensor_dsp_fp More...
 
rd_status_t ri_adc_ntc_init (rd_sensor_t *environmental_sensor, rd_bus_t bus, uint8_t handle)
 rd_sensor_init_fp More...
 
rd_status_t ri_adc_ntc_uninit (rd_sensor_t *sensor, rd_bus_t bus, uint8_t handle)
 rd_sensor_init_fp More...
 
rd_status_t ri_adc_ntc_mode_set (uint8_t *mode)
 rd_sensor_setup_fp More...
 
rd_status_t ri_adc_ntc_mode_get (uint8_t *mode)
 rd_sensor_setup_fp More...
 
rd_status_t ri_adc_ntc_data_get (rd_sensor_data_t *const p_data)
 rd_sensor_data_fp More...
 

Variables

float m_temperture
 Last measured temperature. More...
 

Detailed Description

Author
Oleg Protasevich
Date
2020-06-05

ADC_NTC sensor driver.

Definition in file ruuvi_interface_adc_ntc.c.

Macro Definition Documentation

◆ ADC_K_TO_C_CONST

#define ADC_K_TO_C_CONST   273.15f

Definition at line 71 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_BALANCE

#define ADC_NTC_BALANCE   10000.00f

Definition at line 47 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DATA_COUNTER

#define ADC_NTC_DATA_COUNTER   1

Definition at line 68 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DEFAULT_BETA

#define ADC_NTC_DEFAULT_BETA   3974.0f

Definition at line 65 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DEFAULT_BITFIELD

#define ADC_NTC_DEFAULT_BITFIELD   0

Definition at line 69 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DEFAULT_RES

#define ADC_NTC_DEFAULT_RES   10000.00f

Definition at line 53 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DEFAULT_TEMP

#define ADC_NTC_DEFAULT_TEMP   25.00f

Definition at line 59 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_DEFAULT_TEMP_K

#define ADC_NTC_DEFAULT_TEMP_K   (ADC_NTC_DEFAULT_TEMP + ADC_K_TO_C_CONST)

Definition at line 72 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_ENABLE_BYTE

#define ADC_NTC_ENABLE_BYTE   1

Definition at line 70 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_USE_CHANNEL

#define ADC_NTC_USE_CHANNEL   1

Definition at line 29 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_USE_DIVIDER

#define ADC_NTC_USE_DIVIDER   1.00f

Definition at line 35 of file ruuvi_interface_adc_ntc.c.

◆ ADC_NTC_USE_VDD

#define ADC_NTC_USE_VDD   3.60f

Definition at line 41 of file ruuvi_interface_adc_ntc.c.

Function Documentation

◆ ri_adc_ntc_data_get()

rd_status_t ri_adc_ntc_data_get ( rd_sensor_data_t *const  p_data)

rd_sensor_data_fp

Definition at line 347 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_dsp_get()

rd_status_t ri_adc_ntc_dsp_get ( uint8_t *  dsp,
uint8_t *  parameter 
)

rd_sensor_dsp_fp

Definition at line 198 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_dsp_set()

rd_status_t ri_adc_ntc_dsp_set ( uint8_t *  dsp,
uint8_t *  parameter 
)

rd_sensor_dsp_fp

Definition at line 174 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_init()

rd_status_t ri_adc_ntc_init ( rd_sensor_t environmental_sensor,
rd_bus_t  bus,
uint8_t  handle 
)

rd_sensor_init_fp

Definition at line 204 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_mode_get()

rd_status_t ri_adc_ntc_mode_get ( uint8_t *  mode)

rd_sensor_setup_fp

Definition at line 323 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_mode_set()

rd_status_t ri_adc_ntc_mode_set ( uint8_t *  mode)

rd_sensor_setup_fp

Definition at line 277 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_resolution_set()

rd_status_t ri_adc_ntc_resolution_set ( uint8_t *  resolution)

rd_sensor_setup_fp

Definition at line 160 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_samplerate_set()

rd_status_t ri_adc_ntc_samplerate_set ( uint8_t *  samplerate)

rd_sensor_setup_fp

Definition at line 154 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_scale_set()

rd_status_t ri_adc_ntc_scale_set ( uint8_t *  scale)

rd_sensor_setup_fp

Definition at line 167 of file ruuvi_interface_adc_ntc.c.

◆ ri_adc_ntc_uninit()

rd_status_t ri_adc_ntc_uninit ( rd_sensor_t sensor,
rd_bus_t  bus,
uint8_t  handle 
)

rd_sensor_init_fp

Definition at line 256 of file ruuvi_interface_adc_ntc.c.

Variable Documentation

◆ m_temperture

float m_temperture

Last measured temperature.

Definition at line 100 of file ruuvi_interface_adc_ntc.c.