SensorLib 0.5.0
Multi-platform sensor driver library for Arduino, PlatformIO, and ESP-IDF
Loading...
Searching...
No Matches
SensorPlatform.hpp File Reference

@license MIT License More...

Include dependency graph for SensorPlatform.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  CommInterface { COMM_CUSTOM = 0 , COMM_SPI = 1 , COMM_I2C = 2 }
 

Functions

template<typename CommType , typename HalType , typename... Args>
bool beginCommonStatic (std::unique_ptr< SensorCommBase > &comm, std::unique_ptr< SensorCommStatic > &staticComm, std::unique_ptr< SensorHal > &hal, Args &&... args)
 
template<typename CommType , typename HalType , typename... Args>
bool beginCommon (std::unique_ptr< SensorCommBase > &comm, std::unique_ptr< SensorHal > &hal, Args &&... args)
 
template<typename CommType , typename HalType >
bool beginCommCustomCallback (CommInterface interface, typename CommType::CustomCallback callback, typename HalType::CustomHalCallback hal_callback, uint8_t addr, std::unique_ptr< SensorCommBase > &comm, std::unique_ptr< SensorHal > &hal)
 
void addrToBeBuf (uint32_t addr, uint8_t buf[4])
 
void addrToBeBuf (uint16_t addr, uint8_t buf[2])
 

Detailed Description

@license MIT License

Copyright (c) 2025 lewis he

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Author
Lewis He (lewis.nosp@m.he@o.nosp@m.utloo.nosp@m.k.co.nosp@m.m)
Date
2025-01-18

Definition in file SensorPlatform.hpp.

Enumeration Type Documentation

◆ CommInterface

Enumerator
COMM_CUSTOM 
COMM_SPI 
COMM_I2C 

Definition at line 47 of file SensorPlatform.hpp.

Function Documentation

◆ addrToBeBuf() [1/2]

void addrToBeBuf ( uint16_t  addr,
uint8_t  buf[2] 
)
inline

Definition at line 124 of file SensorPlatform.hpp.

References buf.

◆ addrToBeBuf() [2/2]

◆ beginCommCustomCallback()

template<typename CommType , typename HalType >
bool beginCommCustomCallback ( CommInterface  interface,
typename CommType::CustomCallback  callback,
typename HalType::CustomHalCallback  hal_callback,
uint8_t  addr,
std::unique_ptr< SensorCommBase > &  comm,
std::unique_ptr< SensorHal > &  hal 
)

Definition at line 98 of file SensorPlatform.hpp.

References hal_callback().

◆ beginCommon()

template<typename CommType , typename HalType , typename... Args>
bool beginCommon ( std::unique_ptr< SensorCommBase > &  comm,
std::unique_ptr< SensorHal > &  hal,
Args &&...  args 
)

Definition at line 80 of file SensorPlatform.hpp.

◆ beginCommonStatic()

template<typename CommType , typename HalType , typename... Args>
bool beginCommonStatic ( std::unique_ptr< SensorCommBase > &  comm,
std::unique_ptr< SensorCommStatic > &  staticComm,
std::unique_ptr< SensorHal > &  hal,
Args &&...  args 
)

Definition at line 54 of file SensorPlatform.hpp.