完成LED、RS485、IIC初始化部分代码。

This commit is contained in:
2024-12-03 20:04:03 +08:00
parent 2d7e6fb6e4
commit 828721759d
8 changed files with 227 additions and 4 deletions

31
inc/RS485.h Normal file
View File

@@ -0,0 +1,31 @@
//
// Created by dell on 24-12-3.
//
#ifndef RS485_H
#define RS485_H
#include "gd32e23x_it.h"
#include "gd32e23x.h"
#include "systick.h"
#include <stdbool.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#define RS485_RCU RCU_USART0
#define RS485_GPIO_RCU RCU_GPIOA
#define RS485_GPIO_PORT GPIOA
#define RS485_TX_PIN GPIO_PIN_2
#define RS485_RX_PIN GPIO_PIN_3
#define RS485_PHY USART0
#define RS485_BAUDRATE 115200U
#define RS485_EN_PIN GPIO_PIN_1
#define RX_BUFFER_SIZE 64
void RS485_config(void);
void process_command(char *cmd);
#endif //RS485_H