mppt/Drivers/TimeSliceOffset/timeSliceOffset.h

44 lines
1.3 KiB
C
Raw Permalink Normal View History

2024-07-11 06:58:55 +00:00
/*
* timeSliceOffset.h
*
* Created on: 2024<EFBFBD><EFBFBD>6<EFBFBD><EFBFBD>22<EFBFBD><EFBFBD>
* Author: psx
*/
#ifndef DRIVERS_TIMESLICEOFFSET_TIMESLICEOFFSET_H_
#define DRIVERS_TIMESLICEOFFSET_TIMESLICEOFFSET_H_
#include "debug.h"
#include "uart_dev.h"
/**ʱ<><CAB1>Ƭ<EFBFBD><C6AC>*/
typedef struct _STR_TimeSliceOffset{
volatile unsigned char runFlag; /**< <20><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>־(1:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/0:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) */
volatile unsigned short count; /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
unsigned short reloadVal; /**< <20><><EFBFBD><EFBFBD>ֵ */
void (*taskFunc)(void); /**< <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD>ָ<EFBFBD><D6B8> */
struct _STR_TimeSliceOffset* pNext; /**< ָ<><D6B8><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
}STR_TimeSliceOffset;
/********************************************<2A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>********************************************/
/* ע<><D7A2> */
int TimeSliceOffset_Register(STR_TimeSliceOffset* pTSlice, \
void (*taskFunc)(void), \
unsigned short reloadVal, \
unsigned short offset);
/* ȡ<><C8A1>ע<EFBFBD><D7A2> */
int TimeSliceOffset_Unregister(STR_TimeSliceOffset* pTSlice);
/* <20><><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>Ƭ<EFBFBD><C6AC>λ<EFBFBD><CEBB>ѯ(<28><><EFBFBD><EFBFBD>main<69><6E>whileѭ<65><D1AD>) */
void TimeSliceOffset_Start(void);
/* ʱ<><CAB1>Ƭ<EFBFBD><C6AC><EFBFBD><EFBFBD>(<28>ŵ<EFBFBD>systick<63><6B><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD>жϴ<D0B6><CFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) */
void TimeSliceOffset_Produce(void);
#endif /* DRIVERS_TIMESLICEOFFSET_TIMESLICEOFFSET_H_ */