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
Diff: mcp3208.h
- Revision:
- 1:0876e83ba21b
- Parent:
- 0:2300f3b42cdb
- Child:
- 2:701c3096336e
diff -r 2300f3b42cdb -r 0876e83ba21b mcp3208.h --- a/mcp3208.h Wed Oct 24 03:41:03 2012 +0000 +++ b/mcp3208.h Wed Oct 24 05:52:21 2012 +0000 @@ -10,14 +10,13 @@ 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; - void start(void){_cs = 0;}; - void stop(void){_cs = 1;}; + float vref(float v){return _vref=v;} }; -#endif //_MCP3208?H +#endif //_MCP3208_H