 |
SimpleFOClibrary
2.1
|
Go to the documentation of this file. 1 #ifndef HALL_SENSOR_LIB_H
2 #define HALL_SENSOR_LIB_H
5 #include "../common/base_classes/Sensor.h"
6 #include "../common/foc_utils.h"
7 #include "../common/time_utils.h"
22 HallSensor(
int encA,
int encB,
int encC,
int pp);
35 void enableInterrupts(
void (*doA)() =
nullptr,
void(*doB)() =
nullptr,
void(*doC)() =
nullptr);
77 Direction decodeDirection(
int oldState,
int newState);
80 volatile long pulse_timestamp;
81 volatile int A_active;
82 volatile int B_active;
83 volatile int C_active;
86 void (*onSectorChange)(
int sector) =
nullptr;
88 volatile long pulse_diff;
float cpr
HallSensor cpr number.
int pinA
HallSensor hardware pin A.
int pinC
HallSensor hardware pin C.
void enableInterrupts(void(*doA)()=nullptr, void(*doB)()=nullptr, void(*doC)()=nullptr)
int pinB
HallSensor hardware pin B.
float getAngle() override
float getVelocity() override
volatile int8_t hall_state
volatile long electric_rotations
volatile int8_t electric_sector
volatile long total_interrupts
const int8_t ELECTRIC_SECTORS[8]
void attachSectorCallback(void(*onSectorChange)(int a)=nullptr)
HallSensor(int encA, int encB, int encC, int pp)
Pullup pullup
Configuration parameter internal or external pullups.