Skip to content

Commit

Permalink
add support for ARDUINO_ARCH_MBED (#35)
Browse files Browse the repository at this point in the history
- add support for ARDUINO_ARCH_MBED
  • Loading branch information
RobTillaart authored May 25, 2024
1 parent 3d292a9 commit 5200eb8
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 12 deletions.
8 changes: 4 additions & 4 deletions AD985X.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//
// FILE: AD985X.cpp
// AUTHOR: Rob Tillaart
// VERSION: 0.7.0
// VERSION: 0.7.1
// DATE: 2019-02-08
// PURPOSE: Class for AD9850 and AD9851 function generator
// URL: https://github.com/RobTillaart/AD985X
Expand All @@ -11,9 +11,9 @@


// UNO HARDWARE SPI PINS
#define SPI_CLOCK 13 // not portable.
#define SPI_MISO 12
#define SPI_MOSI 11
// #define SPI_CLOCK 13 // not portable.
// #define SPI_MISO 12
// #define SPI_MOSI 11


#define AD985X_POWERDOWN 0x04
Expand Down
11 changes: 7 additions & 4 deletions AD985X.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
//
// FILE: AD985X.h
// AUTHOR: Rob Tillaart
// VERSION: 0.7.0
// VERSION: 0.7.1
// DATE: 2019-02-08
// PURPOSE: Class for AD9850 and AD9851 function generator
// URL: https://github.com/RobTillaart/AD985X
Expand All @@ -12,11 +12,14 @@
#include "SPI.h"


#define AD985X_LIB_VERSION (F("0.7.0"))
#define AD985X_LIB_VERSION (F("0.7.1"))


#ifndef __SPI_CLASS__
#if defined(ARDUINO_ARCH_RP2040)
// MBED must be tested before RP2040
#if defined(ARDUINO_ARCH_MBED)
#define __SPI_CLASS__ SPIClass
#elif defined(ARDUINO_ARCH_RP2040)
#define __SPI_CLASS__ SPIClassRP2040
#else
#define __SPI_CLASS__ SPIClass
Expand Down Expand Up @@ -107,7 +110,7 @@ class AD9850
uint8_t _config = 0;
int32_t _offset = 0;
bool _autoUpdate = true;
// _factoryMask see PR #32,
// _factoryMask see PR #32,
// 0xFD is safe value for both AD9850/51
uint8_t _factoryMask = 0xFD;
};
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).


## [0.7.1] - 2024-05-24
- add support for ARDUINO_ARCH_MBED

## [0.7.0] - 2024-02-20
- Fix #33 AD9851::setRefClockHigh(), thanks to wh201906
- extended PR #32 to be more robust.
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ way more functionality.
Note: mainly tested on Arduino UNO.



#### 0.5.0 Breaking change

Version 0.5.0 introduced a breaking change to improve handling the SPI dependency.
Expand Down Expand Up @@ -153,7 +152,6 @@ communication when the **SELECT** is HIGH.
```



The **DATA** line of the device is connected to the output of an **AND** port.
The inputs if the **AND** port are (a) the SPI bus **DATA** line and (b) the **SELECT** pin.
Strictly for the **DATA** this is not needed as data will only clock in if there is a **CLOCK**.
Expand Down
2 changes: 1 addition & 1 deletion library.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"type": "git",
"url": "https://github.com/RobTillaart/AD985X.git"
},
"version": "0.7.0",
"version": "0.7.1",
"license": "MIT",
"frameworks": "*",
"platforms": "*",
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=AD985X
version=0.7.0
version=0.7.1
author=Rob Tillaart <[email protected]>
maintainer=Rob Tillaart <[email protected]>
sentence=Arduino library for AD9850 and AD9851 function generators. Supports both hardware SPI as software SPI.
Expand Down

0 comments on commit 5200eb8

Please sign in to comment.