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
Diff: libraries/ad7791/AD7791.cpp
- Revision:
- 17:b8356808e8ad
- Parent:
- 16:b8a49ec95bad
- Child:
- 20:9790e53d6e26
diff -r b8a49ec95bad -r b8356808e8ad libraries/ad7791/AD7791.cpp
--- a/libraries/ad7791/AD7791.cpp Fri Apr 29 17:16:55 2016 +0300
+++ b/libraries/ad7791/AD7791.cpp Fri Apr 29 17:34:07 2016 +0300
@@ -61,7 +61,7 @@
PinName MOSI,
PinName MISO,
PinName SCK) :
- miso(MISO), ad7791(MOSI, MISO, SCK), cs(CS), _vref(reference_voltage)
+ miso(MISO), ad7791(MOSI, MISO, SCK), cs(CS), _vref(reference_voltage)
{
cs = true; // cs is active low
ad7791.format(8, _SPI_MODE);
@@ -111,8 +111,8 @@
} else {
_continous_conversion = false;
}
-/* uint8_t range = (reg_val & 0x30);
- _PGA_gain = 1 << (range >> 4);*/
+ /* uint8_t range = (reg_val & 0x30);
+ _PGA_gain = 1 << (range >> 4);*/
}
@@ -251,8 +251,8 @@
uint16_t AD7791::read_u16(void)
{
- uint32_t data = read_u32();
- return static_cast<uint16_t>((data & 0xffff00) >> 8);
+ uint32_t data = read_u32();
+ return static_cast<uint16_t>((data & 0xffff00) >> 8);
}
/**
CN0357 - Toxic gas measurement
CN0216 - Weight Scale