A collection of Analog Devices drivers for the mbed platform
For additional information check out the mbed page of the Analog Devices wiki: https://wiki.analog.com/resources/tools-software/mbed-drivers-all
Revision 12:6998bcb62025, committed 2016-04-29
- Comitter:
- Adrian Suciu
- Date:
- Fri Apr 29 15:18:18 2016 +0300
- Parent:
- 11:2e67c719ce37
- Child:
- 14:ca5bf41ced84
- Commit message:
- Fix bug in SPI initialization - MISO DigitalIn overrides MISO SPI
Changed in this revision
| libraries/ad7790/AD7790.cpp | Show annotated file Show diff for this revision Revisions of this file |
| libraries/ad7790/AD7790.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/libraries/ad7790/AD7790.cpp Thu Apr 21 18:01:41 2016 +0300
+++ b/libraries/ad7790/AD7790.cpp Fri Apr 29 15:18:18 2016 +0300
@@ -61,7 +61,7 @@
PinName MOSI,
PinName MISO,
PinName SCK) :
- ad7790(MOSI, MISO, SCK), cs(CS), miso(MISO), _vref(reference_voltage), _PGA_gain(1)
+ miso(MISO), ad7790(MOSI, MISO, SCK), cs(CS), _vref(reference_voltage), _PGA_gain(1)
{
cs = true; // cs is active low
ad7790.format(8, _SPI_MODE);
--- a/libraries/ad7790/AD7790.h Thu Apr 21 18:01:41 2016 +0300
+++ b/libraries/ad7790/AD7790.h Fri Apr 29 15:18:18 2016 +0300
@@ -147,9 +147,10 @@
#endif
private:
+ DigitalIn miso;///< DigitalIn must be initialized before SPI to prevent pin MUX overwrite
SPI ad7790; ///< SPI instance of the AD7790
DigitalOut cs; ///< DigitalOut instance for the chipselect of the AD7790
- DigitalIn miso;
+
float _vref;
uint8_t _PGA_gain;
bool _continous_conversion;
CN0357 - Toxic gas measurement
CN0216 - Weight Scale