98 lines
3.4 KiB
C
98 lines
3.4 KiB
C
// 文件编码: GB18030
|
||
/*
|
||
* vofa_client.h
|
||
*
|
||
* Created on: 2025年4月4日
|
||
* Author: LHYe200
|
||
*/
|
||
|
||
#ifndef CODE_VOFA_CLIENT_H_
|
||
#define CODE_VOFA_CLIENT_H_
|
||
|
||
#include "zf_common_headfile.h"
|
||
|
||
#define VOFA_CLIENT_COM_INTERFACE (0) // 0:串口 1:WIFI无线SPI 2:自定义
|
||
#define VOFA_RECEIVE_CH (64) // 接收通道数,最大256个通道
|
||
#define VOFA_SEND_CH (64) // 发送通道数
|
||
|
||
#if VOFA_CLIENT_COM_INTERFACE == 0
|
||
|
||
#define VOFA_CLIENT_UART_PORT UART_0 // 串口号
|
||
#define VOFA_CLIENT_UART_BAUDRATE 1152000 // 波特率
|
||
#define VOFA_CLIENT_UART_RX UART0_RX_P14_1 // 串口接收引脚
|
||
#define VOFA_CLIENT_UART_TX UART0_TX_P14_0 // 串口发送引脚
|
||
|
||
#elif VOFA_CLIENT_COM_INTERFACE == 1
|
||
|
||
#define VOFA_CLIENT_WIFI_SSID "tu-car" // 填写你的WiFi SSID
|
||
#define VOFA_CLIENT_WIFI_PASSWORD "tu12345678" // 填写你的WiFi密码,如果没有密码则替换为NULL
|
||
#define VOFA_CLIENT_WIFI_TARGET_IP "192.168.0.104" // 填写上位机的IP地址
|
||
#define VOFA_CLIENT_WIFI_TARGET_PORT "1347" // 填写上位机的端口号
|
||
#define VOFA_CLIENT_WIFI_LOCAL_PORT "6666" // 填写本机的端口号,可以随意填写,但是不要超过端口允许范围
|
||
#define VOFA_CLIENT_WIFI_FAILURE_RETRY (3) // 连接失败重试次数
|
||
#define VOFA_CLIENT_WIFI_ENABLE_PRINTF (0) // 是否使能WiFi打印信息
|
||
|
||
#elif VOFA_CLIENT_COM_INTERFACE == 2
|
||
// 填写自定义接口的相关信息
|
||
|
||
#endif
|
||
|
||
extern float vofa_data[VOFA_RECEIVE_CH]; // 记录接收数据
|
||
extern uint8 vofa_receive_new_data[VOFA_RECEIVE_CH]; // 接收新数据标志位,需手动置零
|
||
extern float vofa_last_data; // 最后一次接收数据
|
||
extern uint8 vofa_last_ch; // 最后一次接收通道
|
||
|
||
typedef enum{
|
||
Format_Invalid,
|
||
Format_Mono,
|
||
Format_MonoLSB,
|
||
Format_Indexed8,
|
||
Format_RGB32,
|
||
Format_ARGB32,
|
||
Format_ARGB32_Premultiplied,
|
||
Format_RGB16,
|
||
Format_ARGB8565_Premultiplied,
|
||
Format_RGB666,
|
||
Format_ARGB6666_Premultiplied,
|
||
Format_RGB555,
|
||
Format_ARGB8555_Premultiplied,
|
||
Format_RGB888,
|
||
Format_RGB444,
|
||
Format_ARGB4444_Premultiplied,
|
||
Format_RGBX8888,
|
||
Format_RGBA8888,
|
||
Format_RGBA8888_Premultiplied,
|
||
Format_BGR30,
|
||
Format_A2BGR30_Premultiplied,
|
||
Format_RGB30,
|
||
Format_A2RGB30_Premultiplied,
|
||
Format_Alpha8,
|
||
Format_Grayscale8,
|
||
|
||
// 以下格式发送时,IMG_WIDTH和IMG_HEIGHT不需要强制指定,设置为-1即可
|
||
Format_BMP,
|
||
Format_GIF,
|
||
Format_JPG,
|
||
Format_PNG,
|
||
Format_PBM,
|
||
Format_PGM,
|
||
Format_PPM,
|
||
Format_XBM,
|
||
Format_XPM,
|
||
Format_SVG,
|
||
} ImgFormat ;
|
||
|
||
extern uint8 rev_count;
|
||
|
||
void VOFA_Data_Init(void);
|
||
uint8 VOFA_Connection_Init(void);
|
||
uint8 VOFA_Client_Init(void); // VOFA客户端初始化函数
|
||
void VOFA_Set_JustFloat_Data(int CH, float data); // 设置某通道数据
|
||
void VOFA_Set_JustFloat_Datas_From_Start(int num,...); // 设置从第一个通道开始的多个通道数据
|
||
void VOFA_Send_Datas(int num); // 从第一个通道开始发送数据指定数量的数据
|
||
void VOFA_Send_JustFloat_Image(int IMG_ID, int IMG_WIDTH, int IMG_HEIGHT, int IMG_DATA_SIZE, ImgFormat IMG_FORMAT,uint8 *IMG_DATA); // 发送图像数据
|
||
void VOFA_Receiver_Callback(uint8 rev_data); // 接收回调函数,需要在主循环或者接受中断中调用
|
||
|
||
#endif /* CODE_VOFA_CLIENT_H_ */
|
||
|