CELIS/APPLICATION/Sleep/Sleep.h
lidun b61c21c648
修改任务优先级
Signed-off-by: lidun <1084178170@qq.com>
2024-03-02 09:58:11 +08:00

86 lines
1.3 KiB
C

/*
* @Description:
* @Version:
* @Author: Arnold
* @Date: 2023-11-24 17:20:20
* @LastEditTime: 2023-11-24 18:45:10
*/
#ifndef __User_H_
#include <stdint.h>
#include <stdbool.h>
#include <stdio.h>
#include "led.h"
#include "chipid.h"
#include "delay.h"
#include "sys.h"
#include "timer.h"
#include "usart.h"
#include "can.h"
#include "adc.h"
#include "ADS1015.h"
#include "dc300.h"
#include "24cxx.h"
#include "sd.h"
#include "common.h"
#include "stm32f10x_exti.h"
#include "stm32f10x_pwr.h"
#include "stm32f10x_rtc.h"
#include "app_pwr_manage.h"
#include "spi.h"
enum FalseSleep_WakeUp
{
INIT_STATE,
No_Gun_INIT,
Insert_Gun,
Insert_Gun_INIT,
NO_Gun,
};
enum MCU_Sleep_State
{
ActiveState,/* 活跃状态 */
standby_condition,/* 等待状态 */
Go_to_FalseSleep,
Go_to_sleep,/* 进入休眠 */
};
struct Sleep_parame
{
uint32_t Sleep_Time;
uint32_t SC_State;
uint32_t Before_Sleep_Value;
uint8_t CAN_WakeUp_Flag;
uint8_t False_sleep_State;
uint8_t Bus_Packet_Free;
uint8_t insertion_State;
uint8_t BusoffCnt;
bool SaveTimerFlag;
};
extern struct Sleep_parame Sleep_Parame;
void PwrManageWorkPlus(void);
void RTC_Init(void);
bool ActiveState_Scan(void);
#define MAX_Scount 39 //最大进入休眠时间
// struct MCU_Sleep
// {
// enum MCU_Sleep_State MCU_PowerState;/* MCU活动状态 */
// };
#endif