12bit 8ch ADC with SPI interface for STM32 Nucleo to support 16-bit words. SPI speed bumped up to 8MHz

Fork of MCP3208_Y by Michael Chuah

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mcp3208.h Source File

mcp3208.h

00001 //
00002 //
00003 //
00004 #ifndef _MCP3208_H
00005 #define _MCP3208_H
00006 
00007 #include <mbed.h>
00008 
00009 class MCP3208 {
00010   protected:
00011     SPI _spi;
00012     DigitalOut _cs;
00013     float _vref;
00014   
00015   public:
00016     MCP3208(PinName mosi, PinName miso, PinName clk, PinName cs);
00017     int binary(int ch);
00018     float volt(int ch);
00019     float vref(float v){return _vref=v;}
00020 };
00021 
00022 #endif  //_MCP3208_H