feat: 完成通信帧从机应用层模板

This commit is contained in:
bmy
2024-02-23 22:25:47 +08:00
parent 3a4c25dc4d
commit 399ebeea1a
10 changed files with 87 additions and 10 deletions

View File

@@ -3,15 +3,35 @@
#include <stdio.h>
#include <stdint.h>
#include "by_tiny_frame_parse.h"
#include "crc16.h"
#include "zf_common_headfile.h"
#include "by_tiny_frame_config.h"
#include "by_tiny_frame_parse.h"
#include "by_tiny_frame_master_read.h"
#include "by_tiny_frame_master_write.h"
#include "by_tiny_frame_slave_read_write.h"
void by_tiny_frame_init(void)
{
/*** 初始化相关外设 ***/
uart_init(BY_TF_UART_INDEX, BY_TF_UART_BAUDRATE, BY_TF_UART_TX_PIN, BY_TF_UART_RX_PIN);
uart_rx_interrupt(BY_TF_UART_INDEX, ENABLE);
by_tiny_frame_parse_init();
#if defined(BY_TF_DEVICE_SLAVE)
by_tiny_frame_parse_handle_register(by_tiny_frame_read_write_handle);
#endif
}
void by_tiny_frame_run(void)
{
by_tiny_frame_parse_run();
#if defined(BY_TF_DEVICE_MASTER)
by_tiny_frame_read_run();
by_tiny_frame_write_run();
#elif defined(BY_TF_DEVICE_SLAVE)
by_tiny_frame_read_write_run();
#endif
}