SPI 12bit D/A 2ch MCP4922 library
Revision 1:6c010acaae66, committed 2019-08-06
- Comitter:
- ritarosakai
- Date:
- Tue Aug 06 12:50:39 2019 +0000
- Parent:
- 0:2e338068a5a7
- Commit message:
- Changed no to use MISO pin
Changed in this revision
MCP4922.cpp | Show annotated file Show diff for this revision Revisions of this file |
MCP4922.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MCP4922.cpp Mon Aug 05 03:53:01 2019 +0000 +++ b/MCP4922.cpp Tue Aug 06 12:50:39 2019 +0000 @@ -1,8 +1,8 @@ #include "MCP4922.h" #include "mbed.h" -MCP4922::MCP4922(PinName MOSI,PinName MISO,PinName SCK,PinName CS,PinName LDAC): - dac_SPI(MOSI,MISO,SCK),dac_cs(CS),dac_l(LDAC) +MCP4922::MCP4922(PinName MOSI,PinName SCK,PinName CS,PinName LDAC): + dac_SPI(MOSI,NC,SCK),dac_cs(CS),dac_l(LDAC) { dac_SPI.format(16,0); dac_SPI.frequency(20000000);
--- a/MCP4922.h Mon Aug 05 03:53:01 2019 +0000 +++ b/MCP4922.h Tue Aug 06 12:50:39 2019 +0000 @@ -3,7 +3,7 @@ class MCP4922 { public: - MCP4922(PinName MOSI,PinName MISO,PinName SCK,PinName CS,PinName LDAC); + MCP4922(PinName MOSI,PinName SCK,PinName CS,PinName LDAC); void write(int ch,float value); private: SPI dac_SPI;