From a00dce420ec700da755260758a2c35524c4cfadf Mon Sep 17 00:00:00 2001 From: RobTillaart Date: Tue, 19 Dec 2017 11:39:08 +0100 Subject: [PATCH] 0.1.1 experimental DAC8554 --- libraries/DAC8552/DAC8552.cpp | 15 +++++++++------ libraries/DAC8552/DAC8552.h | 6 +++--- libraries/DAC8552/library.json | 23 +++++++++++++++++++++++ libraries/DAC8552/library.properties | 9 +++++++++ 4 files changed, 44 insertions(+), 9 deletions(-) create mode 100644 libraries/DAC8552/library.json create mode 100644 libraries/DAC8552/library.properties diff --git a/libraries/DAC8552/DAC8552.cpp b/libraries/DAC8552/DAC8552.cpp index 50974b02..73ff78cc 100644 --- a/libraries/DAC8552/DAC8552.cpp +++ b/libraries/DAC8552/DAC8552.cpp @@ -2,10 +2,11 @@ // FILE: DAC8552.cpp // AUTHOR: Rob Tillaart // PURPOSE: DAC8552 library for Arduino -// VERSION: 0.1.0 -// URL: +// VERSION: 0.1.1 +// URL: https://github.com/RobTillaart/Arduino/tree/master/libraries/DAC8552 // HISTORY: // 0.1.0: 2017-12-14 initial version +// 0.1.1: 2017-12-19 fix begin() bug // // Released to the public domain // @@ -35,15 +36,17 @@ DAC8552::DAC8552(uint8_t spiData, uint8_t spiClock, uint8_t slaveSelect) // and sets internal state void DAC8552::begin() { - pinMode(_spiData, OUTPUT); - pinMode(_spiClock, OUTPUT); - pinMode(_slaveSelect, OUTPUT); - if(_hwSPI) { SPI.begin(); delay(1); } + else + { + pinMode(_spiData, OUTPUT); + pinMode(_spiClock, OUTPUT); + pinMode(_slaveSelect, OUTPUT); + } for (uint8_t i = 0; i < 2; i++) { diff --git a/libraries/DAC8552/DAC8552.h b/libraries/DAC8552/DAC8552.h index b3397480..5df20793 100644 --- a/libraries/DAC8552/DAC8552.h +++ b/libraries/DAC8552/DAC8552.h @@ -2,9 +2,9 @@ // FILE: DAC8552.h // AUTHOR: Rob Tillaart // PURPOSE: DAC8552 library for Arduino -// VERSION: 0.1.0 +// VERSION: 0.1.1 // HISTORY: See DAC8552.cpp -// URL: +// URL: https://github.com/RobTillaart/Arduino/tree/master/libraries/DAC8552 // // Released to the public domain // @@ -16,7 +16,7 @@ #define DAC8552_POWERDOWN_100K 2 #define DAC8552_POWERDOWN_HIGH_IMP 3 -#define DAC8552_LIB_VERSION (F("0.1.0 experimental")) +#define DAC8552_LIB_VERSION (F("0.1.1 experimental")) class DAC8552 { diff --git a/libraries/DAC8552/library.json b/libraries/DAC8552/library.json new file mode 100644 index 00000000..445beb5d --- /dev/null +++ b/libraries/DAC8552/library.json @@ -0,0 +1,23 @@ +{ + "name": "DAC8552", + "keywords": "DAC8552 Digital Analog Convertor", + "description": "DAC8552 library for Arduino", + "authors": + [ + { + "name": "Rob Tillaart", + "email": "Rob.Tillaart@gmail.com", + "maintainer": true + } + ], + "repository": + { + "type": "git", + "url": "https://github.com/RobTillaart/Arduino.git" + }, + "frameworks": "arduino", + "platforms": "*", + "export": { + "include": "libraries/DAC8552" + } +} diff --git a/libraries/DAC8552/library.properties b/libraries/DAC8552/library.properties new file mode 100644 index 00000000..db6cff22 --- /dev/null +++ b/libraries/DAC8552/library.properties @@ -0,0 +1,9 @@ +name=DAC8552 +version=0.1.1 +author=Rob Tillaart +maintainer=Rob Tillaart +sentence=DAC8552 library for Arduino +paragraph= +category=Sensors +url=https://github.com/RobTillaart/Arduino/tree/master/libraries/ +architectures=* \ No newline at end of file