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

#include <MagneticSensorSPI.h>

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

Public Member Functions

 MagneticSensorSPI (int cs, int bit_resolution, int angle_register=0, long clock_speed=NOT_SET)
 
 MagneticSensorSPI (MagneticSensorSPIConfig_s config, int cs, long clock_speed=NOT_SET)
 
void init (SPIClass *_spi=&SPI)
 
float getSensorAngle () override
 
- 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 ()
 

Public Attributes

int spi_mode
 
long clock_speed
 
- 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 25 of file MagneticSensorSPI.h.

Constructor & Destructor Documentation

◆ MagneticSensorSPI() [1/2]

MagneticSensorSPI::MagneticSensorSPI ( int  cs,
int  bit_resolution,
int  angle_register = 0,
long  clock_speed = NOT_SET 
)

MagneticSensorSPI class constructor

Parameters
csSPI chip select pin
bit_resolutionsensor resolution bit number
angle_register(optional) angle read register - default 0x3FFF
clock_speed(optional) SPI clock speed

Definition at line 53 of file MagneticSensorSPI.cpp.

◆ MagneticSensorSPI() [2/2]

MagneticSensorSPI::MagneticSensorSPI ( MagneticSensorSPIConfig_s  config,
int  cs,
long  clock_speed = NOT_SET 
)
MagneticSensorSPI class constructor

/** MagneticSensorSPI class constructor

Parameters
configSPI config
csSPI chip select pin
clock_speed(optional) SPI clock speed

Definition at line 69 of file MagneticSensorSPI.cpp.

Member Function Documentation

◆ getSensorAngle()

float MagneticSensorSPI::getSensorAngle ( )
overridevirtual

get current angle (rad)

Implements Sensor.

Definition at line 103 of file MagneticSensorSPI.cpp.

◆ init()

void MagneticSensorSPI::init ( SPIClass *  _spi = &SPI)

sensor initialise pins

Definition at line 86 of file MagneticSensorSPI.cpp.

Here is the call graph for this function:

Member Data Documentation

◆ clock_speed

long MagneticSensorSPI::clock_speed

Definition at line 57 of file MagneticSensorSPI.h.

◆ spi_mode

int MagneticSensorSPI::spi_mode

Definition at line 54 of file MagneticSensorSPI.h.


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