0.2.1 DAC8552

This commit is contained in:
rob tillaart 2021-06-02 08:54:12 +02:00
parent 499d0a734e
commit 302c04e8d1
4 changed files with 13 additions and 12 deletions

View File

@ -2,7 +2,7 @@
// FILE: DAC8552.cpp
// AUTHOR: Rob Tillaart
// PURPOSE: Arduino library for DAC8552 SPI Digital Analog Convertor
// VERSION: 0.2.0
// VERSION: 0.2.1
// URL: https://github.com/RobTillaart/DAC8552
//
// HISTORY:
@ -12,6 +12,7 @@
// 0.1.3 2020-06-07 fix library.json
// 0.2.0 2020-12-18 add arduino-ci + unit test
// add slave select pin for HW constructor
// 0.2.1 2021-06-02 compile ESP32 + fix for channel B
#include "DAC8552.h"
@ -56,11 +57,10 @@ void DAC8552::begin()
digitalWrite(_spiClock, LOW);
}
for (uint8_t i = 0; i < 2; i++)
{
_register[i] = 0;
_value[i] = 0;
}
_value[0] = 0;
_value[1] = 0;
_register[0] = 0x00;
_register[1] = 0x40;
}
@ -93,7 +93,7 @@ uint16_t DAC8552::getValue(uint8_t channel)
void DAC8552::bufferPowerDown(uint8_t channel, uint8_t powerDownMode)
{
_register[channel] &= 0xFC;
_register[channel] |= powerDownMode;
_register[channel] |= (powerDownMode & 0x03);
updateDevice(channel, false);
}
@ -101,7 +101,7 @@ void DAC8552::bufferPowerDown(uint8_t channel, uint8_t powerDownMode)
void DAC8552::setPowerDown(uint8_t channel, uint8_t powerDownMode)
{
_register[channel] &= 0xFC;
_register[channel] |= powerDownMode;
_register[channel] |= (powerDownMode & 0x03);
updateDevice(channel, true);
}

View File

@ -3,16 +3,17 @@
// FILE: DAC8552.h
// AUTHOR: Rob Tillaart
// PURPOSE: Arduino library for DAC8552 SPI Digital Analog Convertor
// VERSION: 0.2.0
// VERSION: 0.2.1
// HISTORY: See DAC8552.cpp
// URL: https://github.com/RobTillaart/DAC8552
//
#include "Arduino.h"
#include "SPI.h"
#define DAC8552_LIB_VERSION (F("0.2.0"))
#define DAC8552_LIB_VERSION (F("0.2.1"))
#define DAC8552_POWERDOWN_NORMAL 0

View File

@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/DAC8552"
},
"version": "0.2.0",
"version": "0.2.1",
"license": "MIT",
"frameworks": "arduino",
"platforms": "*"

View File

@ -1,5 +1,5 @@
name=DAC8552
version=0.2.0
version=0.2.1
author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino library for DAC8552 SPI Digital Analog Convertor