mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.1 AD5680
This commit is contained in:
parent
2db5f197b6
commit
d77d17d67c
@ -1,7 +1,7 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680.cpp
|
// FILE: AD5680.cpp
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// VERSION: 0.2.0
|
// VERSION: 0.2.1
|
||||||
// DATE: 2023-09-19
|
// DATE: 2023-09-19
|
||||||
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680.h
|
// FILE: AD5680.h
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// VERSION: 0.2.0
|
// VERSION: 0.2.1
|
||||||
// DATE: 2023-09-19
|
// DATE: 2023-09-19
|
||||||
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
// PURPOSE: Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
||||||
|
|
||||||
@ -10,12 +10,14 @@
|
|||||||
#include "Arduino.h"
|
#include "Arduino.h"
|
||||||
#include "SPI.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)
|
#ifndef __SPI_CLASS__
|
||||||
#define __SPI_CLASS__ SPIClassRP2040
|
#if defined(ARDUINO_ARCH_RP2040)
|
||||||
#else
|
#define __SPI_CLASS__ SPIClassRP2040
|
||||||
#define __SPI_CLASS__ SPIClass
|
#else
|
||||||
|
#define __SPI_CLASS__ SPIClass
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -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/).
|
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
|
## [0.2.0] - 2023-11-26
|
||||||
- refactor constructor interface - breaking changes.
|
- refactor constructor interface - breaking changes.
|
||||||
- minimize conditional code. -- create SPI_CLASS macro to solve it.
|
- minimize conditional code. -- create SPI_CLASS macro to solve it.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
MIT License
|
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
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
@ -53,11 +53,12 @@ Note the order of the parameters of the software SPI constructor has changed in
|
|||||||
|
|
||||||
### Base class
|
### Base class
|
||||||
|
|
||||||
- **AD5680(uint8_t slaveSelect, SPIClassRP2040 \* mySPI = &SPI)** constructor HW SPI (RP2040 specific). Sets internal value to zero.
|
- **AD5680(uint8_t slaveSelect, SPIClassRP2040 \* mySPI = &SPI)** constructor hardware SPI (RP2040 specific).
|
||||||
- **AD5680(uint8_t slaveSelect, SPIClass \* mySPI = &SPI)** constructor HW SPI.
|
|
||||||
Sets internal value to zero.
|
Sets internal value to zero.
|
||||||
- **AD5680(uint8_t slaveSelect, uint8_t spiData, uint8_t spiClock)** constructor SW SPI.
|
- **AD5680(uint8_t slaveSelect, SPIClass \* mySPI = &SPI)** constructor hardware SPI.
|
||||||
sets SW 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.
|
Sets internal value to zero.
|
||||||
- **void begin()** initializes the SPI and sets internal state.
|
- **void begin()** initializes the SPI and sets internal state.
|
||||||
- **uint8_t getType()** returns 18 (for now).
|
- **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,
|
- **bool setValue(uint32_t value)** set value to the output immediately,
|
||||||
effectively a prepare + update in one call.
|
effectively a prepare + update in one call.
|
||||||
Returns false if value out of range.
|
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).
|
At power up the AD5680 will be reset to 0 (== 0 volt).
|
||||||
- **bool setPercentage(float percentage)** idem.
|
- **bool setPercentage(float percentage)** sets the output as a percentage 0..100.
|
||||||
- **float getPercentage()** idem.
|
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
|
#### SPI
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680_demo.ino
|
// FILE: AD5680_demo.ino
|
||||||
// AUTHOR: Rob Tillaart
|
// 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 "SPI.h"
|
||||||
#include "AD5680.h"
|
#include "AD5680.h"
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680_demo.ino
|
// FILE: AD5680_demo.ino
|
||||||
// AUTHOR: Rob Tillaart
|
// 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 "SPI.h"
|
||||||
#include "AD5680.h"
|
#include "AD5680.h"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680_sawtooth.ino
|
// FILE: AD5680_sawtooth.ino
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// PUPROSE: test basic behaviour and performance
|
// PURPOSE: test basic behaviour and performance
|
||||||
|
// URL: https://github.com/RobTillaart/AD5680
|
||||||
|
|
||||||
|
|
||||||
#include "AD5680.h"
|
#include "AD5680.h"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680_demo.ino
|
// FILE: AD5680_demo.ino
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// PUPROSE: test basic behaviour and performance
|
// PURPOSE: test basic behaviour and performance
|
||||||
|
// URL: https://github.com/RobTillaart/AD5680
|
||||||
|
|
||||||
|
|
||||||
#include "AD5680.h"
|
#include "AD5680.h"
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
//
|
//
|
||||||
// FILE: AD5680_triangle.ino
|
// FILE: AD5680_triangle.ino
|
||||||
// AUTHOR: Rob Tillaart
|
// AUTHOR: Rob Tillaart
|
||||||
// PUPROSE: test basic behaviour and performance
|
// PURPOSE: test basic behaviour and performance
|
||||||
|
// URL: https://github.com/RobTillaart/AD5680
|
||||||
|
|
||||||
|
|
||||||
#include "AD5680.h"
|
#include "AD5680.h"
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/RobTillaart/AD5680.git"
|
"url": "https://github.com/RobTillaart/AD5680.git"
|
||||||
},
|
},
|
||||||
"version": "0.2.0",
|
"version": "0.2.1",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"frameworks": "*",
|
"frameworks": "*",
|
||||||
"platforms": "*",
|
"platforms": "*",
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
name=AD5680
|
name=AD5680
|
||||||
version=0.2.0
|
version=0.2.1
|
||||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||||
sentence=Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
sentence=Arduino library for AD5680 Digital Analog Convertor (18 bit).
|
||||||
|
Loading…
x
Reference in New Issue
Block a user