Alexandre Pirotte
/
AS5048
cc
Fork of AS5048 by
Diff: as5048spi.cpp
- Revision:
- 2:2958500883e0
- Parent:
- 1:f2ed22514649
- Child:
- 5:6b4cee1dd258
diff -r f2ed22514649 -r 2958500883e0 as5048spi.cpp --- a/as5048spi.cpp Thu Sep 18 19:28:25 2014 +0000 +++ b/as5048spi.cpp Thu Dec 04 10:00:42 2014 +0000 @@ -59,6 +59,15 @@ return sensor_result & 0x3FFF; // return lowest 14-bits } + +void As5048Spi::mask(int* sensor_results, int n) +{ + for(int i = 0; i < n; ++i) { + sensor_results[i] &= 0x3FFF; + } +} + + bool As5048Spi::parity_check(int sensor_result) { // Use the LSb of result to keep track of parity (0 = even, 1 = odd)