#ifndef GAS_TEMP_H
#define GAS_TEMP__H
#include "canapi_define.h"
#include "canapi_global.h"
#include "canapi.h"
//#include "can.h"
int GetVoltage (unsigned int channel_nr);/*this function reads and converts the voltage of the ADC-4 channels */
void toggle_pin (unsigned char pin_number);
void init (void);/*This function initializes all input /output of the microcontroller*/
int 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 */
uint16_t ReadTemperature(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*/
void readTempSensor(struct uartStruct *ptr_uartStruct);/*this function reads the temperatur of sensor */
void readStatus(struct uartStruct *ptr_uartStruct); /*this function reads the pressure in the bus */
void readRegister(struct uartStruct *ptr_uartStruct); /*this function reads the status of a register with the of his adress */
void writeRegister(struct uartStruct *ptr_uartStruct);/* this function writes a value the status in the register with the of his adress */
void read_ADC(struct uartStruct *ptr_uartStruct); /* this function takes the value of the voltage read from the ADC-channel and convert it in the form of the API */




extern uint16_t Voltages[8];/* current supply voltages of the board*/

/*variable to store values*/
extern char tmp_str[BUFFER_SIZE];

extern uint8_t cur_state;
extern uint8_t usercommand;

extern volatile uint16_t thigh;/*the maximum gas pressure*/
extern volatile uint16_t tlow;/*the minimum gas pressure*/

extern uint8_t StartValue;/*variable to differentiate reading writing*/
extern uint8_t  *Ptr_Reg; /*pointer to the contents of the register*/
extern uint8_t  *Adr_Reg, *Val_Reg; /*pointer on the address and value of the register*/
extern uint8_t res0, res1, res2, res3; /*parameter back to reading the voltage on ADC-channel*/
//extern  uint8_t  *rAdr_Reg;

#endif
