Files
ETH_TCP_Demo/app/event_trigger.h
2026-03-04 08:50:04 +08:00

59 lines
1.3 KiB
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.

/*
* event_trigger.h
*
* Created on: 2026-03-04
* Author: RT-Thread
*
* 功能: 事件触发机制模块头文件
* 依赖: RT-Thread Nano, osal, event_queue
* 跨平台适配: 基于RT-Thread Nano使用标准API
*/
#ifndef EVENT_TRIGGER_H
#define EVENT_TRIGGER_H
#include <rtthread.h>
#include "osal.h"
#include "event_queue.h"
/**
* @brief 触发事件
* @param type 事件类型
* @param priority 事件优先级
* @param data 事件数据
* @param data_size 事件数据大小
* @return 0 成功非0 失败
*/
int event_trigger(event_type_t type, event_priority_t priority, void *data, size_t data_size);
/**
* @brief 创建定时器事件
* @param type 事件类型
* @param interval 定时器间隔单位ms
* @return 定时器句柄失败返回NULL
*/
osal_timer_t event_timer_create(event_type_t type, int interval);
/**
* @brief 启动定时器事件
* @param timer 定时器句柄
* @return 0 成功非0 失败
*/
int event_timer_start(osal_timer_t timer);
/**
* @brief 停止定时器事件
* @param timer 定时器句柄
* @return 0 成功非0 失败
*/
int event_timer_stop(osal_timer_t timer);
/**
* @brief 删除定时器事件
* @param timer 定时器句柄
* @return 0 成功非0 失败
*/
int event_timer_delete(osal_timer_t timer);
#endif /* EVENT_TRIGGER_H */