0.1.2 DAC8550

This commit is contained in:
rob tillaart 2021-12-15 12:15:43 +01:00
parent 3f5e88dc61
commit dc8d4e16fd
9 changed files with 45 additions and 26 deletions

View File

@ -2,6 +2,10 @@ compile:
# Choosing to run compilation tests on 2 different Arduino platforms
platforms:
- uno
- leonardo
- due
- zero
# - due
# - zero
# - leonardo
- m4
- esp32
# - esp8266
# - mega2560

View File

@ -2,14 +2,14 @@
// FILE: DAC8550.cpp
// AUTHOR: Rob Tillaart
// PURPOSE: Arduino library for DAC8550 SPI Digital Analog Convertor
// VERSION: 0.1.1
// VERSION: 0.1.2
// URL: https://github.com/RobTillaart/DAC8550
//
// HISTORY:
// 0.1.0 2021-02-04 initial version (based upon DAC8551)
// 0.1.1 2021-08-29 add support for HSPI/VSPI ESP32
// some performance improvements.
// 0.1.0 2021-02-04 initial version (based upon DAC8551)
// 0.1.1 2021-08-29 add support for HSPI/VSPI ESP32
// some performance improvements.
// 0.1.2 2021-12-15 update library.json, license, minor edits.
#include "DAC8550.h"
@ -111,6 +111,7 @@ void DAC8550::setPowerDown(uint8_t powerDownMode)
updateDevice();
}
uint8_t DAC8550::getPowerDownMode()
{
return _register & 0x03;
@ -164,4 +165,6 @@ void DAC8550::swSPI_transfer(uint8_t value)
}
}
// -- END OF FILE --

View File

@ -3,7 +3,7 @@
// FILE: DAC8550.h
// AUTHOR: Rob Tillaart
// PURPOSE: Arduino library for DAC8550 SPI Digital Analog Convertor
// VERSION: 0.1.1
// VERSION: 0.1.2
// HISTORY: See DAC8550.cpp
// URL: https://github.com/RobTillaart/DAC8550
//
@ -13,7 +13,7 @@
#include "SPI.h"
#define DAC8550_LIB_VERSION (F("0.1.1"))
#define DAC8550_LIB_VERSION (F("0.1.2"))
#define DAC8550_POWERDOWN_NORMAL 0

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2021-2021 Rob Tillaart
Copyright (c) 2021-2022 Rob Tillaart
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,14 +1,14 @@
[![Arduino CI](https://github.com/RobTillaart/DAC8551/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino CI](https://github.com/RobTillaart/DAC8550/workflows/Arduino%20CI/badge.svg)](https://github.com/marketplace/actions/arduino_ci)
[![Arduino-lint](https://github.com/RobTillaart/DAC8550/actions/workflows/arduino-lint.yml/badge.svg)](https://github.com/RobTillaart/DAC8550/actions/workflows/arduino-lint.yml)
[![JSON check](https://github.com/RobTillaart/DAC8550/actions/workflows/jsoncheck.yml/badge.svg)](https://github.com/RobTillaart/DAC8550/actions/workflows/jsoncheck.yml)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/DAC8551/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/DAC8551.svg?maxAge=3600)](https://github.com/RobTillaart/DAC8551/releases)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/RobTillaart/DAC8550/blob/master/LICENSE)
[![GitHub release](https://img.shields.io/github/release/RobTillaart/DAC8550.svg?maxAge=3600)](https://github.com/RobTillaart/DAC8550/releases)
# DAC8550 - experimental
Arduino library for DAC8550 SPI Digital Analog Convertor
Arduino library for DAC8550 SPI Digital Analog Convertor.
## Description
@ -25,8 +25,8 @@ It is derived from the DAC8551 library.
### Core
- **DAC8550(uint8_t slaveSelect)** Constructor for hardware SPI, the slaveSelect pin needs to be defined.
- **DAC8550(uint8_t spiData, uint8_t spiClock, uint8_t slaveSelect)** Constructor for the software SPI
- **void begin()** initializes all pins to default state
- **DAC8550(uint8_t spiData, uint8_t spiClock, uint8_t slaveSelect)** Constructor for the software SPI.
- **void begin()** initializes all pins to default state.
- **void setValue(uint16_t value)** set the value of the channel to 0 - 65535
- **uint16_t getValue()** returns the last value written.
@ -64,12 +64,12 @@ check datasheet for details.
- **uint8_t getPowerDownMode()** returns last written mode.
| Power down mode | Value |
|:------------------------|:-----:|
| DAC8550_POWERDOWN_NORMAL | 0 |
| DAC8550_POWERDOWN_1K | 1 |
| DAC8550_POWERDOWN_100K | 2 |
| DAC8550_POWERDOWN_HIGH_IMP | 3 |
| Power down mode | Value |
|:---------------------------|:-----:|
| DAC8550_POWERDOWN_NORMAL | 0 |
| DAC8550_POWERDOWN_1K | 1 |
| DAC8550_POWERDOWN_100K | 2 |
| DAC8550_POWERDOWN_HIGH_IMP | 3 |

View File

@ -25,6 +25,7 @@ setGPIOpins KEYWORD2
# Constants (LITERAL1)
DAC8550_LIB_VERSION LITERAL1
DAC8550_POWERDOWN_NORMAL LITERAL1
DAC8550_POWERDOWN_1K LITERAL1
DAC8550_POWERDOWN_100K LITERAL1

View File

@ -15,7 +15,8 @@
"type": "git",
"url": "https://github.com/RobTillaart/DAC8550"
},
"version":"0.1.1",
"version": "0.1.2",
"frameworks": "arduino",
"platforms": "*"
"platforms": "*",
"headers": "DAC8550.h"
}

View File

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

View File

@ -39,6 +39,7 @@
unittest_setup()
{
fprintf(stderr, "DAC8550_LIB_VERSION: %s\n", (char *) DAC8550_LIB_VERSION);
}
unittest_teardown()
@ -46,6 +47,15 @@ unittest_teardown()
}
unittest(test_constants)
{
assertEqual(0, DAC8550_POWERDOWN_NORMAL );
assertEqual(1, DAC8550_POWERDOWN_1K );
assertEqual(2, DAC8550_POWERDOWN_100K );
assertEqual(3, DAC8550_POWERDOWN_HIGH_IMP);
}
unittest(test_HW_constructor)
{
DAC8550 myDAC(10);