mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.2.0 AD5144A
This commit is contained in:
parent
ec8922a413
commit
25d2324e7d
@ -6,7 +6,7 @@ jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: arduino/arduino-lint-action@v1
|
||||
with:
|
||||
library-manager: update
|
||||
|
@ -8,7 +8,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: ruby/setup-ruby@v1
|
||||
with:
|
||||
ruby-version: 2.6
|
||||
|
@ -10,7 +10,7 @@ jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: json-syntax-check
|
||||
uses: limitusus/json-syntax-check@v1
|
||||
with:
|
||||
|
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: AD5144A.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.9
|
||||
// VERSION: 0.2.0
|
||||
// PURPOSE: I2C digital potentiometer AD5144A
|
||||
// DATE: 2021-04-30
|
||||
// URL: https://github.com/RobTillaart/AD5144A
|
||||
@ -396,6 +396,18 @@ uint8_t AD51XX::sync(const uint8_t mask)
|
||||
//
|
||||
// MISC
|
||||
//
|
||||
uint8_t AD51XX::pmCount()
|
||||
{
|
||||
return _potCount;
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::maxValue()
|
||||
{
|
||||
return _maxValue;
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::shutDown()
|
||||
{
|
||||
// COMMAND 15 - table 29
|
||||
@ -404,6 +416,30 @@ uint8_t AD51XX::shutDown()
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::readBackINPUT(const uint8_t rdac)
|
||||
{
|
||||
return readBack(rdac, 0x00);
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::readBackEEPROM(const uint8_t rdac)
|
||||
{
|
||||
return readBack(rdac, 0x01);
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::readBackCONTROL(const uint8_t rdac)
|
||||
{
|
||||
return readBack(rdac, 0x02);
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::readBackRDAC(const uint8_t rdac)
|
||||
{
|
||||
return readBack(rdac, 0x03);
|
||||
}
|
||||
|
||||
|
||||
uint8_t AD51XX::writeControlRegister(uint8_t mask)
|
||||
{
|
||||
// COMMAND 16 - page 29
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: AD5144A.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.9
|
||||
// VERSION: 0.2.0
|
||||
// PURPOSE: I2C digital PotentioMeter AD5144A
|
||||
// DATE: 2021-04-30
|
||||
// URL: https://github.com/RobTillaart/AD5144A
|
||||
@ -14,7 +14,7 @@
|
||||
#include "Wire.h"
|
||||
|
||||
|
||||
#define AD51XXA_VERSION (F("0.1.9"))
|
||||
#define AD51XXA_VERSION (F("0.2.0"))
|
||||
|
||||
|
||||
#define AD51XXA_OK 0
|
||||
@ -45,7 +45,7 @@ public:
|
||||
uint8_t read(const uint8_t rdac);
|
||||
|
||||
// additional write functions
|
||||
uint8_t writeAll(const uint8_t value); // set all channels to same value
|
||||
uint8_t writeAll(const uint8_t value); // set all channels to same value
|
||||
uint8_t zeroAll();
|
||||
uint8_t midScaleAll(); // _maxValue + 1)/2
|
||||
uint8_t maxAll();
|
||||
@ -53,8 +53,6 @@ public:
|
||||
uint8_t midScale(const uint8_t rdac); // _maxValue + 1)/2
|
||||
uint8_t maxValue(const uint8_t rdac);
|
||||
|
||||
uint8_t mid(const uint8_t rdac) { return midScale(rdac); }; // will be obsolete 0.2.0
|
||||
|
||||
|
||||
// EEPROM functions
|
||||
// defines power up value; copies between RDAC and EEPROM
|
||||
@ -102,16 +100,16 @@ public:
|
||||
|
||||
|
||||
// MISC
|
||||
uint8_t pmCount() { return _potCount; };
|
||||
uint8_t maxValue() { return _maxValue; };
|
||||
uint8_t pmCount();
|
||||
uint8_t maxValue();
|
||||
uint8_t shutDown();
|
||||
|
||||
|
||||
// returns the value from internal registers.
|
||||
uint8_t readBackINPUT(const uint8_t rdac) { return readBack(rdac, 0x00); };
|
||||
uint8_t readBackEEPROM(const uint8_t rdac) { return readBack(rdac, 0x01); };
|
||||
uint8_t readBackCONTROL(const uint8_t rdac) { return readBack(rdac, 0x02); };
|
||||
uint8_t readBackRDAC(const uint8_t rdac) { return readBack(rdac, 0x03); };
|
||||
uint8_t readBackINPUT(const uint8_t rdac);
|
||||
uint8_t readBackEEPROM(const uint8_t rdac);
|
||||
uint8_t readBackCONTROL(const uint8_t rdac);
|
||||
uint8_t readBackRDAC(const uint8_t rdac);
|
||||
|
||||
|
||||
// USE WITH CARE - READ DATASHEET
|
||||
|
@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.2.0] - 2023-01-11
|
||||
- update GitHub actions
|
||||
- update license
|
||||
- removed mid() ==> use midScale() instead
|
||||
- moved code from .h to .cpp
|
||||
|
||||
----
|
||||
|
||||
## [0.1.9] - 2022-12-02
|
||||
- fix #21
|
||||
- update readme.md + comments
|
||||
@ -13,7 +21,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
- update keywords.txt
|
||||
- minor refactor
|
||||
|
||||
|
||||
## [0.1.8] - 2022-10-25
|
||||
- add rp2040 to build
|
||||
- redo comments
|
||||
|
@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 - 2022 Rob Tillaart
|
||||
Copyright (c) 2021-2023 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
|
||||
|
@ -11,7 +11,7 @@
|
||||
Arduino library for **I2C AD5144A** 4 channel digital potentiometer.
|
||||
|
||||
Library also provides classes for AD5123, AD5124, AD5143, AD5144, AD5144A, AD5122A, AD5142A, AD5121, AD5141.
|
||||
These are have different number of potmeters, rheostats and range but are functional compatible,
|
||||
These are have different number of potentiometers, rheostats and range but are functional compatible,
|
||||
|
||||
## Description
|
||||
|
||||
@ -229,13 +229,15 @@ The examples show the basic working of the functions.
|
||||
## Future
|
||||
|
||||
#### must
|
||||
|
||||
- update documentation
|
||||
|
||||
#### should
|
||||
- move code from .h to .cpp (0.2.0)
|
||||
|
||||
- more testing with hardware.
|
||||
|
||||
#### could
|
||||
|
||||
- some functions can be performance optimized
|
||||
- writing a value is not needed if last value is the same?
|
||||
- should be at least written once.
|
||||
|
@ -71,6 +71,7 @@ shutDown KEYWORD2
|
||||
|
||||
# Constants (LITERAL1)
|
||||
AD51XXA_VERSION LITERAL1
|
||||
|
||||
AD51XXA_OK LITERAL1
|
||||
AD51XXA_ERROR LITERAL1
|
||||
AD51XXA_INVALID_POT LITERAL1
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/AD5144A.git"
|
||||
},
|
||||
"version": "0.1.9",
|
||||
"version": "0.2.0",
|
||||
"license": "MIT",
|
||||
"frameworks": "arduino",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AD5144A
|
||||
version=0.1.9
|
||||
version=0.2.0
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino Library for AD5144A 4 Channel digital potentiometer.
|
||||
|
@ -1,7 +1,6 @@
|
||||
//
|
||||
// FILE: unit_test_001.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.1.0
|
||||
// DATE: 2021-04-30
|
||||
// PURPOSE: unit tests for I2C digital PotentioMeter AD5144A
|
||||
// https://github.com/RobTillaart/AD5144A
|
||||
|
Loading…
Reference in New Issue
Block a user