2.7V 4-Channel 12-Bit A/D Converters with SPI™ Serial Interface
MCP3204 Class Reference
Interface to the 4-Channel 12-Bit A/D Converters with SPI interface. More...
#include <MCP3204.h>
Public Member Functions | |
MCP3204 (SPI &spi, PinName nCs) | |
Create an instance of the MCP3204 connected via specfied SPI instance. | |
MCP3204 (PinName mosi, PinName miso, PinName sck, PinName nCs) | |
Create an instance of the MCP4261 connected with SPI pins. | |
int | sgl (char channel) |
Read from single channel. | |
int | diff (char channel) |
Read from differential channel. |
Detailed Description
Interface to the 4-Channel 12-Bit A/D Converters with SPI interface.
Using the driver:
- remenber to setup SPI in main routine or use pins instance.
Defaults in this driver on start up:
- Datasheet start up
Definition at line 51 of file MCP3204.h.
Constructor & Destructor Documentation
MCP3204 | ( | SPI & | spi, |
PinName | nCs | ||
) |
Create an instance of the MCP3204 connected via specfied SPI instance.
- Parameters:
-
spi The mbed SPI instance (make in main routine) nCs The SPI chip select pin.
Definition at line 30 of file MCP3204.cpp.
MCP3204 | ( | PinName | mosi, |
PinName | miso, | ||
PinName | sck, | ||
PinName | nCs | ||
) |
Create an instance of the MCP4261 connected with SPI pins.
- Parameters:
-
mosi The SPI Master Output, Slave Input pin. miso The SPI Master Input, Slave Output pin. sck The SPI Serial Clock pin. nCs The SPI chip select pin.
Definition at line 36 of file MCP3204.cpp.
Member Function Documentation
int diff | ( | char | channel ) |
Read from differential channel.
use defines to simplify use of function ( CH0, CH1, CH2, CH3)
- Parameters:
-
channel The channel to receive the 12 bits value from.
Definition at line 47 of file MCP3204.cpp.
int sgl | ( | char | channel ) |
Read from single channel.
use defines to simplify use of function ( CH0, CH1, CH2, CH3)
- Parameters:
-
channel The channel to receive the 12 bits value from.
Definition at line 42 of file MCP3204.cpp.
Generated on Sat Jul 16 2022 12:35:19 by 1.7.2