Loading...
Searching...
No Matches
example_thermo.c File Reference

1-Wire thermometer example. More...

#include <gui/gui.h>
#include <gui/view_port.h>
#include <core/thread.h>
#include <core/kernel.h>
#include <locale/locale.h>
#include <one_wire/maxim_crc.h>
#include <one_wire/one_wire_host.h>
#include <furi_hal_power.h>

Data Structures

union  DS18B20Scratchpad
 
struct  ExampleThermoContext
 

Macros

#define UPDATE_PERIOD_MS   1000UL
 
#define TEXT_STORE_SIZE   64U
 
#define DS18B20_CMD_SKIP_ROM   0xccU
 
#define DS18B20_CMD_CONVERT   0x44U
 
#define DS18B20_CMD_READ_SCRATCHPAD   0xbeU
 
#define DS18B20_CFG_RESOLUTION_POS   5U
 
#define DS18B20_CFG_RESOLUTION_MASK   0x03U
 
#define DS18B20_DECIMAL_PART_MASK   0x0fU
 
#define DS18B20_SIGN_MASK   0xf0U
 
#define THERMO_GPIO_PIN   (gpio_ibutton)
 

Enumerations

enum  ReaderThreadFlag { ReaderThreadFlagExit = 1 }
 

Functions

int32_t example_thermo_main (void *p)
 

Detailed Description

1-Wire thermometer example.

This file contains an example application that reads and displays the temperature from a DS18B20 1-wire thermometer.

It also covers basic GUI, input handling, threads and localisation.

References: [1] DS18B20 Datasheet: https://www.analog.com/media/en/technical-documentation/data-sheets/DS18B20.pdf