Smart Knob Controller
hall.h
1/*
2 * ADC.h
3 *
4 * Created on: Jun 9, 2025
5 * Author: nickl
6 */
7
8#ifndef INC_HALL_H_
9#define INC_HALL_H_
10
11#include "stm32f4xx_hal.h"
12#include <stdint.h>
13
17class Hall{
18public:
23 Hall(ADC_HandleTypeDef* hadc);
24
30 int16_t getReading(uint16_t angle);
31
32private:
38 static const uint16_t offsetTable[16384];
39
40 ADC_HandleTypeDef* hadc;
41
43 uint16_t readADC();
44};
45
46#endif /* INC_ADC_H_ */
Hall(ADC_HandleTypeDef *hadc)
Constructs a Hall sensor interface.
Definition hall.cpp:10
int16_t getReading(uint16_t angle)
Returns offset-corrected ADC reading.
Definition hall.cpp:15