|
SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
|
Abstract hardware abstraction layer. More...
#include <SensorCommBase.hpp>
Public Member Functions | |
| virtual void | pinMode (uint8_t pin, uint8_t mode)=0 |
| Set the mode of a digital pin. | |
| virtual void | digitalWrite (uint8_t pin, uint8_t level)=0 |
| Write a digital value to a pin. | |
| virtual uint8_t | digitalRead (uint8_t pin)=0 |
| Read the digital value from a pin. | |
| virtual uint32_t | millis ()=0 |
| Get the current system time in milliseconds. | |
| virtual void | delay (uint32_t ms)=0 |
| Blocking delay for a given number of milliseconds. | |
| virtual void | delayMicroseconds (uint32_t us)=0 |
| Blocking delay for a given number of microseconds. | |
Public Member Functions inherited from SensorHalCustom | |
| SensorHalCustom () | |
| void | setCustomWrite (CustomWrite callback) |
| Set a custom digitalWrite implementation. | |
| void | setCustomRead (CustomRead callback) |
| Set a custom digitalRead implementation. | |
| void | setCustomMode (CustomMode callback) |
| Set a custom pinMode implementation. | |
Additional Inherited Members | |
Public Types inherited from SensorHalCustom | |
| using | CustomWrite = void(*)(uint8_t pin, uint8_t level) |
| Set pin level (0/1) | |
| using | CustomRead = uint8_t(*)(uint8_t pin) |
| Read pin level. | |
| using | CustomMode = void(*)(uint8_t pin, uint8_t mode) |
| Set pin mode (INPUT/OUTPUT, etc.) | |
Protected Attributes inherited from SensorHalCustom | |
| CustomWrite | writeCallback |
| Custom digitalWrite, nullptr if not set. | |
| CustomRead | readCallback |
| Custom digitalRead, nullptr if not set. | |
| CustomMode | modeCallback |
| Custom pinMode, nullptr if not set. | |
Abstract hardware abstraction layer.
Provides the basic I/O and timing functions required by sensor drivers.
Definition at line 468 of file SensorCommBase.hpp.
|
pure virtual |
Blocking delay for a given number of milliseconds.
| ms | Delay duration in milliseconds. |
Implemented in SensorCommCustomHal.
|
pure virtual |
Blocking delay for a given number of microseconds.
| us | Delay duration in microseconds. |
Implemented in SensorCommCustomHal.
Referenced by SensorCommStatic::sensor_static_delay_us().
|
pure virtual |
Read the digital value from a pin.
| pin | Pin number. |
Implemented in SensorCommCustomHal.
|
pure virtual |
Write a digital value to a pin.
| pin | Pin number. |
| level | Logic level (0 = LOW, 1 = HIGH). |
Implemented in SensorCommCustomHal.
|
pure virtual |
Get the current system time in milliseconds.
Implemented in SensorCommCustomHal.
|
pure virtual |
Set the mode of a digital pin.
| pin | Pin number. |
| mode | Mode (e.g., INPUT, OUTPUT, INPUT_PULLUP). |
Implemented in SensorCommCustomHal.