Added STM32 platform for debugging and development
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <HardwareSerial.h> // Reference the ESP32 built-in serial port library
|
||||
#include <DebugLog.h>
|
||||
#include <Arduino.h>
|
||||
#include <HardwareSerial.h> // Reference the ESP32 built-in serial port library
|
||||
#include <CRC16.h>
|
||||
#include <memory>
|
||||
|
||||
@@ -23,8 +24,11 @@ namespace drivers
|
||||
static const uint8_t PORT = 1;
|
||||
|
||||
public:
|
||||
#ifdef ESP32
|
||||
RS485(const uint32_t baud, const SerialConfig conf);
|
||||
|
||||
#else
|
||||
RS485(const uint32_t baud);
|
||||
#endif
|
||||
const bool write(const std::vector<uint8_t> data);
|
||||
const bool readAll(std::vector<uint8_t> &data);
|
||||
const bool readN(const uint16_t nBytes, std::vector<uint8_t> &data);
|
||||
@@ -61,7 +65,11 @@ namespace drivers
|
||||
typedef uint16_t crc_t;
|
||||
|
||||
public:
|
||||
#ifdef ESP32
|
||||
MODBUS(const uint32_t baud, const SerialConfig conf);
|
||||
#else
|
||||
MODBUS(const uint32_t baud);
|
||||
#endif
|
||||
|
||||
// Func 0x01
|
||||
const bool readCoils(const uint8_t device, const uint16_t reg, const uint16_t num, std::vector<bool> &coils);
|
||||
|
||||
Reference in New Issue
Block a user