A collection of Analog Devices drivers for the mbed platform

For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all

libraries/Thermocouple/Thermocouple_core_h.txt

Committer:
Adrian Suciu
Date:
2016-11-07
Revision:
33:c3ec596a29c2

File content as of revision 33:c3ec596a29c2:

#include "mbed.h"
#ifndef _THERMOCOUPLE_H_
#define _THERMOCOUPLE_H_

#define DEFINE_LOOKUP_TABLES
#ifdef DEFINE_LOOKUP_TABLES
#define TYPE_B_LUT
#define TYPE_E_LUT
#define TYPE_J_LUT
#define TYPE_K_LUT
#define TYPE_N_LUT
#define TYPE_R_LUT
#define TYPE_S_LUT
#define TYPE_T_LUT
#endif

class Thermocouple
{
private:

public:
	typedef struct
		{
			float min_voltage_range;
			float max_voltage_range;
			float coef[16];
			float power[16];
			int n;
		}thermocouple_poly_subrange;
	Thermocouple();
	virtual ~Thermocouple();
	static float convert(float voltage, const thermocouple_poly_subrange range[], const int n);
	static float lookup(const int32_t *lut, float voltage,uint16_t size,int16_t offset);
	virtual float convert(float voltage) = 0;
	virtual float convert_inv(float temp) = 0;
	virtual float lookup(float voltage) = 0;
	virtual float lookup_inv(float temp) = 0;

};