chore: snapshot before shared RS485 bus integration
This commit is contained in:
0
components/evse_link/include/evse_link.h
Executable file → Normal file
0
components/evse_link/include/evse_link.h
Executable file → Normal file
@@ -5,21 +5,36 @@
|
||||
#include <stdbool.h>
|
||||
#include "driver/uart.h"
|
||||
|
||||
// UART instance and configuration
|
||||
#define UART_PORT UART_NUM_2
|
||||
// UART baud/buffer configuration
|
||||
#define UART_BAUDRATE 9600
|
||||
#define UART_RX_BUF_SIZE 256
|
||||
|
||||
// GPIO pin assignments for RS-485 UART
|
||||
// Ajuste conforme seu hardware
|
||||
#define MB_UART_TXD 17
|
||||
#define MB_UART_RXD 16
|
||||
#define MB_UART_RTS 2 // pino DE/RE do transceiver RS-485
|
||||
// Select EVSE-Link physical layer at compile time.
|
||||
// 0 = production RS485: UART2 GPIO17/16 + RTS/DE GPIO2
|
||||
// 1 = emergency/internal UART TTL: UART1 GPIO21/22, no RS485/RTS
|
||||
#ifndef EVSE_LINK_USE_UART_TTL
|
||||
#define EVSE_LINK_USE_UART_TTL 0
|
||||
#endif
|
||||
|
||||
#define TX_PIN MB_UART_TXD
|
||||
#define RX_PIN MB_UART_RXD
|
||||
#define RTS_PIN MB_UART_RTS
|
||||
#if EVSE_LINK_USE_UART_TTL
|
||||
|
||||
#define UART_PORT UART_NUM_1
|
||||
#define TX_PIN 21
|
||||
#define RX_PIN 22
|
||||
#define RTS_PIN UART_PIN_NO_CHANGE
|
||||
#define EVSE_LINK_UART_MODE UART_MODE_UART
|
||||
#define EVSE_LINK_PHY_NAME "UART_TTL"
|
||||
|
||||
#else
|
||||
|
||||
#define UART_PORT UART_NUM_2
|
||||
#define TX_PIN 17
|
||||
#define RX_PIN 16
|
||||
#define RTS_PIN 2
|
||||
#define EVSE_LINK_UART_MODE UART_MODE_RS485_HALF_DUPLEX
|
||||
#define EVSE_LINK_PHY_NAME "RS485"
|
||||
|
||||
#endif
|
||||
// Frame delimiters
|
||||
#define MAGIC_START 0x7E
|
||||
#define MAGIC_END 0x7F
|
||||
|
||||
Reference in New Issue
Block a user