chenming 1e21cdb572 1.优化上下电时序
2.修改开关FCD_EN时的死机问题
3.修改快速开关FCD_EN信号时出现花屏的问题
4.修改cola_set_event事件参数,都是一个32bit的整数,每个事件占用1个bit
5.将B+高低压ADC判断改为电压mv判断
6.修改lvds lock信号消抖时间
7.修改不接lvds线时,快速开关FCD_EN不进入BIST模式的问题
8.添加A样相关资料
2025-05-30 14:10:31 +08:00

117 lines
3.6 KiB
C

/******************************************************************************
Copyright @2024 - 2044 Shenzhen dcenzix Technology Ltd.
******************************************************************************
@file cola_os.h
@brief
@author xiexiongwu
@version V1.0
@date 2024年5月25日
******************************************************************************/
#ifndef __COLA_OS_H__
#define __COLA_OS_H__
/*----------------------------------------------*
* 包含头文件 *
*----------------------------------------------*/
#include <stdint.h>
#include <stdbool.h>
/*----------------------------------------------*
* 枚举定义 *
*----------------------------------------------*/
/** \enum EN_COLA_EVENT_TYPE
* \brief 事件类型
*/
typedef enum COLA_EVENT_TYPE
{
EN_COLA_EVENT_ALARM = 1 << 0,
EN_COLA_EVENT_DATA = 1 << 1,
EN_COLA_EVENT_UART = 1 << 3,
EN_COLA_EVENT_USR1 = 1 << 8,
EN_COLA_EVENT_USR2 = 1 << 9,
EN_COLA_EVENT_MSG = 1 << 15,
} EN_COLA_EVENT_TYPE;
/** \enum COLA_TIMER_TYPE
* \brief 定时类型
*/
typedef enum COLA_TIMER_TYPE
{
EN_COLA_TIMER_ALWAYS = 0x00, ///< 周期任务
EN_COLA_TIMER_ONE_SHOT = 0x01, ///< 单次任务
} EN_COLA_TIMER_TYPE;
/** \enum EN_COLA_TASK_TYPE
* \brief 任务类型
*/
typedef enum COLA_TASK_TYPE
{
EN_COLA_TASK_TASK = 0x00, ///< 事件任务
EN_COLA_TASK_TIMER = 0x01, ///< 定时任务
} EN_COLA_TASK_TYPE;
/*----------------------------------------------*
* 宏定义 *
*----------------------------------------------*/
typedef void (*cbFunc)(void *arg, uint32_t event);
/*----------------------------------------------*
* 结构体定义 *
*----------------------------------------------*/
typedef struct task_s
{
uint32_t taskNum; ///< 任务编号
uint32_t period; ///< 定时周期
EN_COLA_TIMER_TYPE timerType; ///< 定时器类型
uint32_t timerTick; ///< 定时计数
bool start; ///< 开始启动
bool run; ///< 任务运行标志
EN_COLA_TASK_TYPE taskType; ///< 任务标志是主任务还是定时任务
uint32_t event; ///< 驱动事件
cbFunc func; ///< 回调函数
void *usr; ///< 用户接口
struct task_s *next;
} __attribute__((aligned(4))) task_t;
/*----------------------------------------------*
* 全局变量 *
*----------------------------------------------*/
extern volatile uint32_t jiffies;
/*----------------------------------------------*
* 函数原型说明 *
*----------------------------------------------*/
#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif /* __cplusplus */
extern bool cola_clear_event(task_t *task, uint32_t event);
extern void cola_delay_ms(uint32_t ms);
extern bool cola_set_event(task_t *task, uint32_t event);
extern bool cola_task_create(task_t *task, cbFunc func, void *arg);
extern bool cola_task_delete(task_t *task);
static bool cola_task_is_exists(task_t *task);
extern void cola_task_loop(void);
extern bool cola_timer_create(task_t *timer, cbFunc func, void *arg);
extern bool cola_timer_delete(task_t *timer);
extern bool cola_timer_start(task_t *timer, EN_COLA_TIMER_TYPE time_type, uint32_t time_ms);
extern bool cola_timer_stop(task_t *timer);
extern void cola_timer_ticker(void);
extern unsigned int cola_get_ticker(void);
#ifdef __cplusplus
#if __cplusplus
}
#endif
#endif /* __cplusplus */
#endif /* __COLA_OS_H__ */