esp32-warm-water
esp32 based project for the control of a heating element based on temperature
|
implementation for wrapper component to help setup and interface with temp sensor More...
#include <stdbool.h>
#include "ds18b20_wrapper.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
#include "esp_system.h"
#include "esp_log.h"
#include "owb.h"
#include "ds18b20.h"
Go to the source code of this file.
Macros | |
#define | GPIO_DS18B20_0 (CONFIG_TEMP_OWB_GPIO) |
the gpio pin to search for sensors on More... | |
#define | MAX_DEVICES (CONFIG_TEMP_MAX_DEVS) |
maximum number of devices to search for More... | |
#define | DS18B20_RESOLUTION (DS18B20_RESOLUTION_12_BIT) |
the resolution of the temp sensor More... | |
Functions | |
int | ds18b20_wrapped_init (void) |
init the sensor intitialises the onewire bus and finds and intialises ds18b20 sensors along the pin More... | |
void | ds18b20_wrapped_deinit (void) |
deinit the sensor cleans up and frees all of the devices and the onewire bus More... | |
void | ds18b20_wrapped_read (void) |
print the temps runs conversion on all the owb devices, waits for the conversion and then prints out the results when it receives them More... | |
void | ds18b20_wrapped_capture (float *results, int size) |
capture temps to results this function runs conversion on all the owb devices, waits for conversion to finish and then reads the temperatures into the provided results array More... | |
Variables | |
OneWireBus * | owb |
onewire bus pointer More... | |
int | num_devices = 0 |
current number of devices found More... | |
DS18B20_Info * | devices [MAX_DEVICES] = {0} |
list of devices More... | |
owb_rmt_driver_info | rmt_driver_info |
the rmt driver info for communicating over the owb More... | |
implementation for wrapper component to help setup and interface with temp sensor
Definition in file ds18b20_wrapper.c.
#define DS18B20_RESOLUTION (DS18B20_RESOLUTION_12_BIT) |
the resolution of the temp sensor
Definition at line 48 of file ds18b20_wrapper.c.
#define GPIO_DS18B20_0 (CONFIG_TEMP_OWB_GPIO) |
the gpio pin to search for sensors on
Definition at line 46 of file ds18b20_wrapper.c.
#define MAX_DEVICES (CONFIG_TEMP_MAX_DEVS) |
maximum number of devices to search for
Definition at line 47 of file ds18b20_wrapper.c.
void ds18b20_wrapped_capture | ( | float * | results, |
int | size | ||
) |
capture temps to results this function runs conversion on all the owb devices, waits for conversion to finish and then reads the temperatures into the provided results array
[in] | results | a pointer to the array to capture results to |
[out] | results | the array pointer that has been populated with data |
size | the number of devices found and the size of the results array |
Definition at line 248 of file ds18b20_wrapper.c.
void ds18b20_wrapped_deinit | ( | void | ) |
deinit the sensor cleans up and frees all of the devices and the onewire bus
Definition at line 174 of file ds18b20_wrapper.c.
int ds18b20_wrapped_init | ( | void | ) |
init the sensor intitialises the onewire bus and finds and intialises ds18b20 sensors along the pin
Definition at line 61 of file ds18b20_wrapper.c.
void ds18b20_wrapped_read | ( | void | ) |
print the temps runs conversion on all the owb devices, waits for the conversion and then prints out the results when it receives them
Definition at line 195 of file ds18b20_wrapper.c.
DS18B20_Info* devices[MAX_DEVICES] = {0} |
list of devices
Definition at line 52 of file ds18b20_wrapper.c.
int num_devices = 0 |
current number of devices found
Definition at line 51 of file ds18b20_wrapper.c.
OneWireBus* owb |
onewire bus pointer
Definition at line 50 of file ds18b20_wrapper.c.
owb_rmt_driver_info rmt_driver_info |
the rmt driver info for communicating over the owb
Definition at line 53 of file ds18b20_wrapper.c.