#ifndef SENSOR_UNIVERSAL_H_
#define SENSOR_UNIVERSAL_H_

#include "DriverLibrary.h"

#define MASK_8BITS			0xFF
#define MASK_12BITS         0x0FFF
#define MASK_14BITS			0x3FFF
#define MASK_16BITS         0xFFFF
#define MASK_24BITS         0xFFFFFF

#define LSB_POSITION_0		0x00
#define LSB_POSITION_1      0x01
#define LSB_POSITION_2		0x02
#define LSB_POSITION_3      0x03
#define LSB_POSITION_7      0x07
          
uint16_t sensor_read_native_16bit (sensor_select_e decoder, uint16_t address);
uint8_t sensor_read_8bit (sensor_select_e decoder, uint8_t address);
void sensor_write_8bit (sensor_select_e decoder, uint8_t address, uint8_t data);
uint16_t sensor_read_16bit (sensor_select_e decoder, uint8_t addressLower);
float two_complement_decode(uint32_t raw_data, uint32_t mask, uint32_t lsb, float range);

#endif /* SENSOR_UNIVERSAL_H_ */