MCP4922 Lib
Fork of MCP4922 by
MCP4922 Class Reference
12bit Resolution. More...
#include <MCP4922.h>
Public Member Functions | |
MCP4922 (PinName mosi, PinName sck, PinName _cs, PinName _latch) | |
Constructor;. | |
MCP4922 (SPI &_spi, PinName _cs, PinName _latch) | |
Constructor;. | |
MCP4922 (PinName mosi, PinName sck, PinName _cs) | |
Constructor;. | |
MCP4922 (SPI &_spi, PinName _cs) | |
Constructor;. | |
MCP4922::ERR | init (int hz=20000000, int gainA=1, int gainB=1, bool bufA=false, bool bufB=false) |
ESENTIAL FUNC. | |
void | setVal (int valA, int valB) |
Set Value. | |
void | setVal (float valA, float valB) |
Set Value. | |
void | setVal (CH ch, int val) |
Set Value. | |
void | setVal (CH ch, float val) |
Set Value. | |
void | write () |
Write ALL with update-output(latch off). | |
void | write (CH ch, bool latch=true) |
Write. | |
void | update () |
Update. |
Detailed Description
12bit Resolution.
Dual-channel and Rail-to-Rail Output. SPI Interface with 20MHz. Latching Dual output with LDAC. Seting time of 4.5us. Selectable 1x or 2x Gain. Vdd supplied 2.7 to 5.5V, Vref < Vdd. LDAC setup time: 40ns, pulse: 100ns.
Definition at line 19 of file MCP4922.h.
Constructor & Destructor Documentation
MCP4922 | ( | PinName | mosi, |
PinName | sck, | ||
PinName | _cs, | ||
PinName | _latch | ||
) |
MCP4922 | ( | SPI & | _spi, |
PinName | _cs, | ||
PinName | _latch | ||
) |
MCP4922 | ( | PinName | mosi, |
PinName | sck, | ||
PinName | _cs | ||
) |
MCP4922 | ( | SPI & | _spi, |
PinName | _cs | ||
) |
Member Function Documentation
MCP4922::ERR init | ( | int | hz = 20000000 , |
int | gainA = 1 , |
||
int | gainB = 1 , |
||
bool | bufA = false , |
||
bool | bufB = false |
||
) |
ESENTIAL FUNC.
; Initialize Configlation.
- Parameters:
-
hz; freq. of SPI. gainA/B; output gain select 1x|2x. Vref*gain. bufA/B; Normally off(false); Buffered= true;
Definition at line 33 of file MCP4922.cpp.
void setVal | ( | int | valA, |
int | valB | ||
) |
void setVal | ( | CH | ch, |
int | val | ||
) |
void setVal | ( | CH | ch, |
float | val | ||
) |
void setVal | ( | float | valA, |
float | valB | ||
) |
void update | ( | ) |
Update.
Definition at line 149 of file MCP4922.cpp.
void write | ( | CH | ch, |
bool | latch = true |
||
) |
Write.
Definition at line 125 of file MCP4922.cpp.
void write | ( | ) |
Write ALL with update-output(latch off).
Definition at line 117 of file MCP4922.cpp.
Generated on Fri Jul 22 2022 18:32:14 by 1.7.2