Files
Power-Pico/software/Power_Pico/User/Tasks/Inc/user_TasksInit.h

38 lines
922 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#ifndef __USER_TASKSINIT_H__
#define __USER_TASKSINIT_H__
#ifdef __cplusplus
extern "C" {
#endif
#include "FreeRTOS.h"
#include "cmsis_os.h"
// 用于数据传输的结构体,包含电压和电流
// 流向为 MessageSendTask -> LVGLtask
typedef struct {
float voltage; // 电压 (V)
float current; // 电流 (uA)
} PowerData_t;
// 定义一个标志位,表示 ADC 数据已经准备好在ADC DMA中断中被置位
// 在 MessageSendTask 中等待这个标志位,表示可以发送 ADC 数据了
#define FLAG_ADC_HALF_READY 0x0001U // 0000 0001
#define FLAG_ADC_FULL_READY 0x0002U // 0000 0010
extern osThreadId_t MessageSendTaskHandle;
extern osMessageQueueId_t Key_MessageQueue;
extern osMessageQueueId_t PD_cmd_MessageQueue;
extern osMessageQueueId_t PD_handle_event_MsgQueue;
extern osMessageQueueId_t PowerDataQueue;
void User_Tasks_Init(void);
#ifdef __cplusplus
}
#endif
#endif