FastArduino v1.10
C++ library to build fast but small Arduino/AVR projects
|
Defines API for magnetic sensors for direction, speed and acceleration properties. More...
Classes | |
struct | AllSensors |
Structure to store all MPU6050 sensors data (3 axis gyroscope and accelerometer, chip temperature). More... | |
class | FIFOEnable |
Configuration for MPU6050 FIFO Enable register (register map §4.6). More... | |
class | HMC5883L |
I2C device driver for the HMC5883L compass chip. More... | |
class | INTStatus |
The structure of the Interrupt Status register (register map §4.16). More... | |
class | MPU6050 |
I2C device driver for the MPU6050 gyroscope/accelerometer chip. More... | |
struct | Sensor3D |
Structure to store 3 axis data for one sensor (gyroscope or accelerometer). More... | |
class | Status |
The chip status, as defined in datasheet p16. More... | |
Typedefs | |
using | INTEnable = INTStatus |
The structure of the Interrupt Enable register (register map §4.15). More... | |
Enumerations | |
enum class | SamplesAveraged : uint8_t { ONE_SAMPLE = 0 << 5 , TWO_SAMPLES = 1 << 5 , FOUR_SAMPLES = 2 << 5 , EIGHT_SAMPLES = 3 << 5 } |
The number of samples to average every time a measurement is required from the HMC5883L chip (datasheet p12). More... | |
enum class | DataOutput : uint8_t { RATE_0_75HZ = 0 << 2 , RATE_1_5HZ = 1 << 2 , RATE_3HZ = 2 << 2 , RATE_7_5HZ = 3 << 2 , RATE_15HZ = 4 << 2 , RATE_30HZ = 5 << 2 , RATE_75HZ = 6 << 2 } |
The output rate when used in continuous mode (datasheet p12). More... | |
enum class | MeasurementMode : uint8_t { NORMAL = 0 , POSITIVE_BIAS = 1 , NEGATIVE_BIAS = 2 } |
The measurement mode as defined in datasheet p12, table6. More... | |
enum class | OperatingMode : uint8_t { CONTINUOUS = 0 , SINGLE = 1 , IDLE = 2 } |
The operating mode of the chip as defined in datasheet p10, p14 table 12. More... | |
enum class | Gain : uint8_t { GAIN_0_88GA = 0 << 5 , GAIN_1_3GA = 1 << 5 , GAIN_1_9GA = 2 << 5 , GAIN_2_5GA = 3 << 5 , GAIN_4_0GA = 4 << 5 , GAIN_4_7GA = 5 << 5 , GAIN_5_6GA = 6 << 5 , GAIN_8_1GA = 7 << 5 } |
The gain to set for the chip, as defined in datasheet p13, table9. More... | |
enum class | GyroRange : uint8_t { RANGE_250 = 0 << 3 , RANGE_500 = 1 << 3 , RANGE_1000 = 2 << 3 , RANGE_2000 = 3 << 3 } |
The full-scale range of the gyroscope in dps (datasheet §6.1). More... | |
enum class | AccelRange : uint8_t { RANGE_2G = 0 << 3 , RANGE_4G = 1 << 3 , RANGE_8G = 2 << 3 , RANGE_16G = 3 << 3 } |
The full-scale range of the accelerometer in g (datasheet §6.2). More... | |
enum class | ClockSelect : uint8_t { INTERNAL_8MHZ = 0 , PLL_X_AXIS_GYRO = 1 , PLL_Y_AXIS_GYRO = 2 , PLL_Z_AXIS_GYRO = 3 , PLL_EXTERNAL_32KHZ = 4 , PLL_EXTERNAL_19MHZ = 5 , STOPPED = 7 } |
The clock to select for the chip (datasheet §6.6). More... | |
enum class | DLPF : uint8_t { ACCEL_BW_260HZ = 0 , ACCEL_BW_184HZ = 1 , ACCEL_BW_94HZ = 2 , ACCEL_BW_44HZ = 3 , ACCEL_BW_21HZ = 4 , ACCEL_BW_10HZ = 5 , ACCEL_BW_5HZ = 6 , GYRO_BW_256HZ = 0 , GYRO_BW_188HZ = 1 , GYRO_BW_98HZ = 2 , GYRO_BW_42HZ = 3 , GYRO_BW_20HZ = 4 , GYRO_BW_10HZ = 5 , GYRO_BW_5HZ = 6 } |
The Digital Low Pass Filter bandwidth to select for the chip (register map §4.3). More... | |
enum class | AD0 : uint8_t { LOW = 0 , HIGH = 1 } |
Possible values of I2C address lower bit for the chip (the chip may have one of two possible addresses, based on the level of pin AD0, datasheet §6.4, §7.1). More... | |
Functions | |
float | magnetic_heading (int16_t x, int16_t y) |
Calculate the magnetic heading (heading measured clockwise from magnetic north) from X and Y magnetic fields. More... | |
static constexpr uint16_t | GYRO_RANGE_DPS (GyroRange range) |
Convert a GyroRange constant to the real gyroscope range in dps. More... | |
static constexpr uint16_t | ACCEL_RANGE_G (AccelRange range) |
Convert an AccelRange constant to the real accelerometer range in g. More... | |
Defines API for magnetic sensors for direction, speed and acceleration properties.
using devices::magneto::INTEnable = typedef INTStatus |
The structure of the Interrupt Enable register (register map §4.15).
|
strong |
The number of samples to average every time a measurement is required from the HMC5883L chip (datasheet p12).
Definition at line 49 of file hmc5883l.h.
|
strong |
The output rate when used in continuous mode (datasheet p12).
Definition at line 61 of file hmc5883l.h.
|
strong |
The measurement mode as defined in datasheet p12, table6.
Definition at line 75 of file hmc5883l.h.
|
strong |
The operating mode of the chip as defined in datasheet p10, p14 table 12.
Definition at line 85 of file hmc5883l.h.
|
strong |
The gain to set for the chip, as defined in datasheet p13, table9.
Definition at line 95 of file hmc5883l.h.
|
strong |
The full-scale range of the gyroscope in dps (datasheet §6.1).
|
strong |
The full-scale range of the accelerometer in g (datasheet §6.2).
|
strong |
The clock to select for the chip (datasheet §6.6).
|
strong |
The Digital Low Pass Filter bandwidth to select for the chip (register map §4.3).
This can be expressed either from the gyroscope viewpoint or from the accelerometer viewpoint, but any setting is common to both features, i.e. selecting a DLPF setting for the accelerometer will force the matching setting for the gyroscope.
|
strong |
Possible values of I2C address lower bit for the chip (the chip may have one of two possible addresses, based on the level of pin AD0, datasheet §6.4, §7.1).
Enumerator | |
---|---|
LOW | When |
HIGH | When |
|
inline |
Calculate the magnetic heading (heading measured clockwise from magnetic north) from X and Y magnetic fields.
Definition at line 39 of file hmc5883l.h.
|
staticconstexpr |
|
staticconstexpr |