12bit 8ch ADC with SPI interface

mcp3208.h

Committer:
ykuroda
Date:
2012-10-24
Revision:
1:0876e83ba21b
Parent:
0:2300f3b42cdb

File content as of revision 1:0876e83ba21b:

//
//
//
#ifndef _MCP3208_H
#define _MCP3208_H

#include <mbed.h>

class MCP3208 {
  protected:
    SPI _spi;
    DigitalOut _cs;
    float _vref;
  
  public:
    MCP3208(PinName mosi=p11, PinName miso=p12, PinName clk=p13, PinName cs=p14);
    int binary(int ch);
    float volt(int ch);
    float vref(float v){return _vref=v;}
};

#endif  //_MCP3208_H