SimpleFOClibrary  2.1
MagneticSensorSPI Class Reference

#include <MagneticSensorSPI.h>

Inheritance diagram for MagneticSensorSPI:
Sensor

Public Member Functions

 MagneticSensorSPI (int cs, float bit_resolution, int angle_register=0)
 
 MagneticSensorSPI (MagneticSensorSPIConfig_s config, int cs)
 
void init (SPIClass *_spi=&SPI)
 
float getAngle () override
 
float getVelocity () override
 
- Public Member Functions inherited from Sensor
virtual int needsSearch ()
 

Public Attributes

int spi_mode
 
long clock_speed
 

Detailed Description

Definition at line 24 of file MagneticSensorSPI.h.

Constructor & Destructor Documentation

◆ MagneticSensorSPI() [1/2]

MagneticSensorSPI::MagneticSensorSPI ( int  cs,
float  bit_resolution,
int  angle_register = 0 
)

MagneticSensorSPI class constructor

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

Definition at line 33 of file MagneticSensorSPI.cpp.

◆ MagneticSensorSPI() [2/2]

MagneticSensorSPI::MagneticSensorSPI ( MagneticSensorSPIConfig_s  config,
int  cs 
)

MagneticSensorSPI class constructor

Parameters
configSPI config
csSPI chip select pin

Definition at line 49 of file MagneticSensorSPI.cpp.

Member Function Documentation

◆ getAngle()

float MagneticSensorSPI::getAngle ( )
overridevirtual

get current angle (rad)

Implements Sensor.

Definition at line 94 of file MagneticSensorSPI.cpp.

◆ getVelocity()

float MagneticSensorSPI::getVelocity ( )
overridevirtual

get current angular velocity (rad/s)

Reimplemented from Sensor.

Definition at line 114 of file MagneticSensorSPI.cpp.

◆ init()

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

sensor initialise pins

Definition at line 64 of file MagneticSensorSPI.cpp.

Member Data Documentation

◆ clock_speed

long MagneticSensorSPI::clock_speed

Definition at line 53 of file MagneticSensorSPI.h.

◆ spi_mode

int MagneticSensorSPI::spi_mode

Definition at line 50 of file MagneticSensorSPI.h.


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