A library to use Honeywell pressure sensors from HSC series with SPI connection. For calibration scale and pressure range you have to set the declarations inside the hsc_spi.h file - Default values are for 10-90% calibration and 1.6bar absolute sensor

hsc_spi.h

Committer:
brunoalfano
Date:
2014-02-16
Revision:
0:0056857990b9

File content as of revision 0:0056857990b9:

#ifndef hsc_spi_h
#define hsc_spi_h

#include "mbed.h"

#define OUTPUT_MAX 0x399A
#define OUTPUT_MIN 0x0666
#define P_MAX 1600
#define P_MIN 0

class hsc_spi
{
    SPI& spi;
    DigitalOut ncs;
    Timer pollTimer;
  public:
  
    hsc_spi(SPI& _spi, PinName _ncs);
    //void initialise(int out_max,int out_min,int pmax, int pmin);
    float read_press();
    float read_temp();
    void spi_init();
    void select();
    void deselect();
    
  private:
    PinName _CS_pin;
    PinName _SO_pin;
    PinName _SCK_pin;
    float _error;
};

#endif