/* The one_wire_temperatur.h is a header file for the functions specific to read temperatur of sensor via one wire bus*/
#ifndef ONE_WIRE_TEMPERATURE__H
#define ONE_WIRE_TEMPERATURE__H
#include "api_define.h"
#include "api_global.h"
#include "api.h"

extern uint16_t owiTemperatureTimeoutMask;
extern uint8_t owiUseCommonTemperatureConversion_flag;

int8_t TempStored( uint8_t *pins ); /*  this function will read the IDÂ´s and temperatures of a certain number of devices limited between 1 and NUM-DEVICES */

uint32_t owiReadSingleTemperature( unsigned char bus, unsigned char * id );/* this function will read the data conteined in the scratchpad of the device identified by the id ID number*/

int owiMakeTemperatureConversions( uint8_t *pins );

void owiReadTemperatureSensors( struct uartStruct *ptr_uartStruct );/*this function contains all the functions that are necessary to
 read the temperatur of sensor*/

enum errorCodes
{
   eNoError = 0,
   eWrongCANAddress = 1, // bogus address set on hex-switches
   eCANDataSize = 2, // bogus amount of bytes arrived
   eI2CTimeout = 4, // I²C problem
   eI2CFatalError = 8, // I²C problem
   eI2CRetryFailed = 16, // I²C problem
   eADCTimeout = 32, // ADC conversion failed
   eCPLDAcknowledgeTimeout = 64
// CPLD communication problem
} ErrorCodes;

#endif
