mirror of
https://github.com/RobTillaart/Arduino.git
synced 2024-10-03 18:09:02 -04:00
0.7.0 AD985X
This commit is contained in:
parent
c8ec50f78e
commit
0a4df20c7e
@ -1,7 +1,7 @@
|
||||
//
|
||||
// FILE: AD985X.cpp
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.6.0
|
||||
// VERSION: 0.7.0
|
||||
// DATE: 2019-02-08
|
||||
// PURPOSE: Class for AD9850 and AD9851 function generator
|
||||
// URL: https://github.com/RobTillaart/AD985X
|
||||
@ -35,6 +35,7 @@ AD9850::AD9850(uint8_t slaveSelect, uint8_t resetPin, uint8_t FQUDPin, __SPI_CLA
|
||||
_mySPI = mySPI;
|
||||
_dataOut = 0;
|
||||
_clock = spiClock;
|
||||
_factoryMask = 0xFC;
|
||||
}
|
||||
|
||||
// SOFTWARE SPI
|
||||
@ -47,6 +48,7 @@ AD9850::AD9850(uint8_t slaveSelect, uint8_t resetPin, uint8_t FQUDPin, uint8_t s
|
||||
_mySPI = NULL;
|
||||
_dataOut = spiData;
|
||||
_clock = spiClock;
|
||||
_factoryMask = 0xFC;
|
||||
}
|
||||
|
||||
|
||||
@ -161,7 +163,7 @@ void AD9850::writeData()
|
||||
data >>= 8;
|
||||
_mySPI->transfer(data & 0xFF);
|
||||
_mySPI->transfer(data >> 8);
|
||||
_mySPI->transfer(_config & 0xFC); // mask factory test bit
|
||||
_mySPI->transfer(_config & _factoryMask); // mask factory test bits
|
||||
_mySPI->endTransaction();
|
||||
}
|
||||
else
|
||||
@ -172,7 +174,7 @@ void AD9850::writeData()
|
||||
data >>= 8;
|
||||
swSPI_transfer(data & 0xFF);
|
||||
swSPI_transfer(data >> 8);
|
||||
swSPI_transfer(_config & 0xFC); // mask factory test bit
|
||||
swSPI_transfer(_config & _factoryMask); // mask factory test bits
|
||||
}
|
||||
digitalWrite(_select, LOW);
|
||||
|
||||
@ -265,11 +267,13 @@ void AD9850::update()
|
||||
|
||||
AD9851::AD9851(uint8_t slaveSelect, uint8_t resetPin, uint8_t FQUDPin, __SPI_CLASS__ * mySPI, uint8_t spiClock) : AD9850(slaveSelect, resetPin, FQUDPin, mySPI, spiClock)
|
||||
{
|
||||
_factoryMask = 0xFD;
|
||||
}
|
||||
|
||||
|
||||
AD9851::AD9851(uint8_t slaveSelect, uint8_t resetPin, uint8_t FQUDPin, uint8_t spiData, uint8_t spiClock) : AD9850(slaveSelect, resetPin, FQUDPin, spiData, spiClock)
|
||||
{
|
||||
_factoryMask = 0xFD;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
//
|
||||
// FILE: AD985X.h
|
||||
// AUTHOR: Rob Tillaart
|
||||
// VERSION: 0.6.0
|
||||
// VERSION: 0.7.0
|
||||
// DATE: 2019-02-08
|
||||
// PURPOSE: Class for AD9850 and AD9851 function generator
|
||||
// URL: https://github.com/RobTillaart/AD985X
|
||||
@ -12,7 +12,7 @@
|
||||
#include "SPI.h"
|
||||
|
||||
|
||||
#define AD985X_LIB_VERSION (F("0.6.0"))
|
||||
#define AD985X_LIB_VERSION (F("0.7.0"))
|
||||
|
||||
|
||||
#ifndef __SPI_CLASS__
|
||||
@ -107,6 +107,9 @@ protected:
|
||||
uint8_t _config = 0;
|
||||
int32_t _offset = 0;
|
||||
bool _autoUpdate = true;
|
||||
// _factoryMask see PR #32,
|
||||
// 0xFD is safe value for both AD9850/51
|
||||
uint8_t _factoryMask = 0xFD;
|
||||
};
|
||||
|
||||
|
||||
|
@ -6,7 +6,13 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
|
||||
## [0.6.0] - 2024-002-04
|
||||
## [0.7.0] - 2024-02-20
|
||||
- Fix #33 AD9851::setRefClockHigh(), thanks to wh201906
|
||||
- extended PR #32 to be more robust.
|
||||
|
||||
----
|
||||
|
||||
## [0.6.0] - 2024-02-04
|
||||
- Fixed SW SPI interface, thanks to wh201906
|
||||
|
||||
----
|
||||
|
@ -15,7 +15,7 @@
|
||||
"type": "git",
|
||||
"url": "https://github.com/RobTillaart/AD985X.git"
|
||||
},
|
||||
"version": "0.6.0",
|
||||
"version": "0.7.0",
|
||||
"license": "MIT",
|
||||
"frameworks": "*",
|
||||
"platforms": "*",
|
||||
|
@ -1,5 +1,5 @@
|
||||
name=AD985X
|
||||
version=0.6.0
|
||||
version=0.7.0
|
||||
author=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
maintainer=Rob Tillaart <rob.tillaart@gmail.com>
|
||||
sentence=Arduino library for AD9850 and AD9851 function generators. Supports both hardware SPI as software SPI.
|
||||
|
Loading…
Reference in New Issue
Block a user