SimpleFOClibrary 2.4.0
Loading...
Searching...
No Matches
MagneticSensorI2C Class Reference

#include <MagneticSensorI2C.h>

Inheritance diagram for MagneticSensorI2C:
[legend]
Collaboration diagram for MagneticSensorI2C:
[legend]

Public Member Functions

 MagneticSensorI2C (uint8_t _chip_address, int _bit_resolution, uint8_t _angle_register_msb, int _msb_bits_used, bool lsb_right_aligned=true)
 
 MagneticSensorI2C (MagneticSensorI2CConfig_s config)
 
void init (TwoWire *_wire=&Wire)
 
float getSensorAngle () override
 
int checkBus (byte sda_pin, byte scl_pin)
 
- Public Member Functions inherited from Sensor
virtual float getMechanicalAngle ()
 
virtual float getAngle ()
 
virtual double getPreciseAngle ()
 
virtual float getVelocity ()
 
virtual int32_t getFullRotations ()
 
virtual void update ()
 
virtual int needsSearch ()
 

Static Public Member Functions

static MagneticSensorI2C AS5600 ()
 

Public Attributes

uint8_t currWireError = 0
 
- Public Attributes inherited from Sensor
float min_elapsed_time = 0.000100
 

Additional Inherited Members

- Protected Member Functions inherited from Sensor
virtual void init ()
 
- Protected Attributes inherited from Sensor
float velocity =0.0f
 
float angle_prev =0.0f
 
long angle_prev_ts =0
 
float vel_angle_prev =0.0f
 
long vel_angle_prev_ts =0
 
int32_t full_rotations =0
 
int32_t vel_full_rotations =0
 

Detailed Description

Definition at line 29 of file MagneticSensorI2C.h.

Constructor & Destructor Documentation

◆ MagneticSensorI2C() [1/2]

MagneticSensorI2C::MagneticSensorI2C ( uint8_t  _chip_address,
int  _bit_resolution,
uint8_t  _angle_register_msb,
int  _msb_bits_used,
bool  lsb_right_aligned = true 
)

MagneticSensorI2C class constructor

Parameters
chip_addressI2C chip address
bitsnumber of bits of the sensor resolution
angle_register_msbangle read register msb
_bits_used_msbnumber of used bits in msb

Definition at line 42 of file MagneticSensorI2C.cpp.

◆ MagneticSensorI2C() [2/2]

MagneticSensorI2C::MagneticSensorI2C ( MagneticSensorI2CConfig_s  config)

MagneticSensorI2C class constructor

Parameters
configI2C config

Definition at line 63 of file MagneticSensorI2C.cpp.

Member Function Documentation

◆ AS5600()

MagneticSensorI2C MagneticSensorI2C::AS5600 ( )
static

Definition at line 71 of file MagneticSensorI2C.cpp.

◆ checkBus()

int MagneticSensorI2C::checkBus ( byte  sda_pin,
byte  scl_pin 
)

experimental function to check and fix SDA locked LOW issues

Definition at line 123 of file MagneticSensorI2C.cpp.

Here is the call graph for this function:

◆ getSensorAngle()

float MagneticSensorI2C::getSensorAngle ( )
overridevirtual

get current angle (rad)

Implements Sensor.

Definition at line 87 of file MagneticSensorI2C.cpp.

◆ init()

void MagneticSensorI2C::init ( TwoWire *  _wire = &Wire)

sensor initialise pins

Definition at line 77 of file MagneticSensorI2C.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ currWireError

uint8_t MagneticSensorI2C::currWireError = 0

current error code from Wire endTransmission() call

Definition at line 59 of file MagneticSensorI2C.h.


The documentation for this class was generated from the following files: