refactor: use standard integer types; remove <algorithm> dependency

- Replaced unsigned char,  int and long long with uint8_t int32_t and int64_t for platform independence
- Removed <algorithm> dependency, implemented custom alternatives
This commit is contained in:
Gatsby
2024-11-07 14:13:37 +08:00
parent d4159ec998
commit 2fc5941f0f
7 changed files with 144 additions and 144 deletions
+3 -3
View File
@@ -28,13 +28,13 @@ void logging(const std::string& msg);
* @param address 要写入的寄存器地址
* @param value 要写入的寄存器值
*/
void writeSpi(int address, int value);
void writeSpi(std::uint16_t address, std::uint8_t value);
/**
* @brief 需要实现的函数,实现SPI读取寄存器功能
* @param address 要读取的寄存器地址
* @return 返回的寄存器值
*/
int readSpi(int address);
std::uint8_t readSpi(std::uint16_t address);
/**
* @brief 需要实现的函数,实现等待功能
* @param ms 等待时间,单位毫秒
@@ -45,7 +45,7 @@ void pause(double ms);
* @param pin 寄存器地址
* @param value 寄存器值
*/
void setPin(int pin, int value);
void setPin(std::uint32_t pin, bool value);
/**
* @brief 初始化芯片状态,写入与具体配置无关的寄存器值
*/