CELIS/APPLICATION/Sleep/Sleep.h

88 lines
1.4 KiB
C
Raw Normal View History

2024-08-09 06:24:48 +00:00
/*
* @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,/* <20><>Ծ״̬ */
standby_condition,/* <20>ȴ<EFBFBD>״̬ */
Go_to_FalseSleep,
Go_to_sleep,/* <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> */
};
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;
uint8_t BufFlag;
uint8_t Allow_Send_DTC;
bool SaveTimerFlag;
};
extern struct Sleep_parame Sleep_Parame;
void PwrManageWorkPlus(void);
void RTC_Init(void);
bool ActiveState_Scan(void);
#define MAX_Scount 29 //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>
// struct MCU_Sleep
// {
// enum MCU_Sleep_State MCU_PowerState;/* MCU<43>״̬ */
// };
#endif