main/task_ds18b20.h

Sat, 06 Jun 2020 13:28:46 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Sat, 06 Jun 2020 13:28:46 +0200
changeset 77
66c77497d86d
parent 1
ad2c8b13eb88
permissions
-rw-r--r--

Changed the recipe database so that it is expandable, version 2. More mash fields and allow 16 steps. Allow 20 Additions. Removed separate mash steps from the state machine, the steps are moved to the runtime data. There is no fixed step number for mashout anymore. There is no fixed step for mash-in anymore, just use the first step and heat to the infusion temperature. After malt add, switch to the normal step temperature. Implemented decoction steps.


/**
 * @file task_ds18b20.h
 * @brief The FreeRTOS task to query the DS18B20 sensors on one or two
 *        one-wire busses. Each bus must have only one sensor. That way
 *        we don't need to care about the DS18B20 internal ROM address.
 *        The task will update the DS18B20_State structure.
 *
 * Using a compile setting with make menuconfig it is possible to compile
 * a simulator instead of real hardware sensors. The simulator includes
 * fake kettles so that the temperature actually changes with the 
 * activation of the kettle Solid State Relays. Only usefull for developers.
 */

#ifndef	_TASK_DS18B20_H
#define	_TASK_DS18B20_H

/*
 * Error codes in this task
 */
#define	DS18B20_ERR_NONE		0			///< No errors
#define DS18B20_ERR_NOSENSOR		1			///< No sensor detected
#define	DS18B20_ERR_TOOMANY		2			///< Too many sensors
#define	DS18B20_ERR_CRC			3			///< CRC read error
#define	DS18B20_ERR_READ		4			///< Generic read error


/**
 * @brief Structure containing the variables for the DS18B20 task.
 */
typedef struct {
    bool   mlt_valid;			///< MLT sensor valid reading.
    double mlt_temperature;		///< Current MLT temperature.
    int    mlt_error;			///< MLT error number.
    bool   hlt_valid;			///< HLT sensor valid reading.
    double hlt_temperature;		///< Current HLT temperature.
    int    hlt_error;			///< HLT error number.
} DS18B20_State;


/**
 * @brief The FreeRTOS task to update the DS18B20 temperature sensors.
 */
void task_ds18b20(void *);


#endif

mercurial