Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: as5048spi.h
- Revision:
- 4:06b89a41109e
- Parent:
- 3:a8ad32e439d4
- Child:
- 5:12aba2c743f7
diff -r a8ad32e439d4 -r 06b89a41109e as5048spi.h
--- a/as5048spi.h Tue Mar 17 14:46:45 2015 +0000
+++ b/as5048spi.h Tue Mar 17 14:56:30 2015 +0000
@@ -21,7 +21,7 @@
} As5048Diagnostics;
-
+//! Class for interfacing with the AMS AS5048A magnetic rotary sensor over the SPI-interface.
class As5048Spi
{
public:
@@ -46,7 +46,6 @@
/// Performs a single angle measurement on all sensors
/// @return Array of raw angle data. To get the 14-bit value representing
/// the angle, apply the mask() to the result.
- /// To get an angle in degrees divide 360 by the result of the call to mask().
const int* read_angle();
/// Performs sequential angle measurements on all sensors. The first time this
@@ -54,7 +53,6 @@
/// will be returned by the next call to this method.
/// @return Array of raw angle data. To get the 14-bit value representing
/// the angle, apply the mask() to the result.
- /// To get an angle in degrees divide 360 by the result of the call to mask().
const int* read_angle_sequential();
/// Returns lowest 14-bits
@@ -62,6 +60,7 @@
/// Applies the mask to the first n bytes in the read buffer (for daisychained sensors).
static void mask(int* sensor_results, int n);
+
/// Checks if the return value from the sensor has the right parity
/// @return true if ok
static bool parity_check(int sensor_result);