0.2.1 AD5680

This commit is contained in:
Rob Tillaart 2024-01-02 13:23:24 +01:00
parent 2db5f197b6
commit d77d17d67c
12 changed files with 40 additions and 23 deletions

View File

@ -1,7 +1,7 @@
//
// FILE: AD5680.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// VERSION: 0.2.1
// DATE: 2023-09-19
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).

View File

@ -2,7 +2,7 @@
//
// FILE: AD5680.h
// AUTHOR: Rob Tillaart
// VERSION: 0.2.0
// VERSION: 0.2.1
// DATE: 2023-09-19
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).
@ -10,12 +10,14 @@
#include "Arduino.h"
#include "SPI.h"
#define AD5680_LIB_VERSION (F("0.2.0"))
#define AD5680_LIB_VERSION (F("0.2.1"))
#if defined(ARDUINO_ARCH_RP2040)
#define __SPI_CLASS__ SPIClassRP2040
#else
#define __SPI_CLASS__ SPIClass
#ifndef __SPI_CLASS__
#if defined(ARDUINO_ARCH_RP2040)
#define __SPI_CLASS__ SPIClassRP2040
#else
#define __SPI_CLASS__ SPIClass
#endif
#endif

View File

@ -6,6 +6,12 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.2.1] - 2024-01-02
- fix examples
- add __SPI_CLASS__ guard
- minor edits
## [0.2.0] - 2023-11-26
- refactor constructor interface - breaking changes.
- minimize conditional code. -- create SPI_CLASS macro to solve it.

View File

@ -1,6 +1,6 @@
MIT License
Copyright (c) 2023-2023 Rob Tillaart
Copyright (c) 2023-2024 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

@ -53,11 +53,12 @@ Note the order of the parameters of the software SPI constructor has changed in
### Base class
- **AD5680(uint8_t slaveSelect, SPIClassRP2040 \* mySPI = &SPI)** constructor HW SPI (RP2040 specific). Sets internal value to zero.
- **AD5680(uint8_t slaveSelect, SPIClass \* mySPI = &SPI)** constructor HW SPI.
- **AD5680(uint8_t slaveSelect, SPIClassRP2040 \* mySPI = &SPI)** constructor hardware SPI (RP2040 specific).
Sets internal value to zero.
- **AD5680(uint8_t slaveSelect, uint8_t spiData, uint8_t spiClock)** constructor SW SPI.
sets SW SPI.
- **AD5680(uint8_t slaveSelect, SPIClass \* mySPI = &SPI)** constructor hardware SPI.
Sets internal value to zero.
- **AD5680(uint8_t slaveSelect, uint8_t spiData, uint8_t spiClock)** constructor software SPI.
Sets the software SPI pins.
Sets internal value to zero.
- **void begin()** initializes the SPI and sets internal state.
- **uint8_t getType()** returns 18 (for now).
@ -68,10 +69,13 @@ Sets internal value to zero.
- **bool setValue(uint32_t value)** set value to the output immediately,
effectively a prepare + update in one call.
Returns false if value out of range.
- **uint32_t getValue()** returns set value.
- **uint32_t getValue()** returns set value 0..262143 (from cache).
At power up the AD5680 will be reset to 0 (== 0 volt).
- **bool setPercentage(float percentage)** idem.
- **float getPercentage()** idem.
- **bool setPercentage(float percentage)** sets the output as a percentage 0..100.
If percentage is out of range, it is not set and the function returns false.
- **float getPercentage()** returns percentage, wrapper around **getValue()**.
Might return a slightly different value than **setPercentage()** due to
rounding errors.
#### SPI

View File

@ -1,8 +1,8 @@
//
// FILE: AD5680_demo.ino
// AUTHOR: Rob Tillaart
// PUPROSE: test basic behaviour and performance
// PURPOSE: test basic behaviour and performance
// URL: https://github.com/RobTillaart/AD5680
#include "SPI.h"
#include "AD5680.h"

View File

@ -1,7 +1,9 @@
//
// FILE: AD5680_demo.ino
// AUTHOR: Rob Tillaart
// PUPROSE: test basic behaviour and performance
// PURPOSE: test basic behaviour and performance
// URL: https://github.com/RobTillaart/AD5680
#include "SPI.h"
#include "AD5680.h"

View File

@ -1,7 +1,8 @@
//
// FILE: AD5680_sawtooth.ino
// AUTHOR: Rob Tillaart
// PUPROSE: test basic behaviour and performance
// PURPOSE: test basic behaviour and performance
// URL: https://github.com/RobTillaart/AD5680
#include "AD5680.h"

View File

@ -1,7 +1,8 @@
//
// FILE: AD5680_demo.ino
// AUTHOR: Rob Tillaart
// PUPROSE: test basic behaviour and performance
// PURPOSE: test basic behaviour and performance
// URL: https://github.com/RobTillaart/AD5680
#include "AD5680.h"

View File

@ -1,7 +1,8 @@
//
// FILE: AD5680_triangle.ino
// AUTHOR: Rob Tillaart
// PUPROSE: test basic behaviour and performance
// PURPOSE: test basic behaviour and performance
// URL: https://github.com/RobTillaart/AD5680
#include "AD5680.h"

View File

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

View File

@ -1,5 +1,5 @@
name=AD5680
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 AD5680 Digital Analog Convertor (18 bit).