Motion_EC_Stm32_archived/Core/Inc/navikit.h

114 lines
1.7 KiB
C
Raw Normal View History

2020-04-17 15:55:14 +08:00
/*
* navikit.h
*
* Created on: Apr 17, 2020
* Author: oarap
*/
#ifndef INC_NAVIKIT_H_
#define INC_NAVIKIT_H_
#include "stdbool.h"
2020-07-15 18:26:22 +08:00
typedef enum
{
shutdown, //only mcu runing
runing, //all function runing
2020-08-21 17:44:46 +08:00
sleep, //SOCs and FANs are stop
2020-08-25 14:03:16 +08:00
dfu, //device firmware update for SOM
isp //in system program for BIOS
2020-07-15 18:26:22 +08:00
}sta_t;
2020-04-17 15:55:14 +08:00
typedef struct
{
2020-07-15 18:26:22 +08:00
struct{
sta_t sta; //current system state
2020-08-05 19:22:37 +08:00
sta_t next_sta; //current system state
2020-07-15 18:26:22 +08:00
bool power_btn; //开关是否被按下
bool custom_btn;
bool pwr_led;
bool run_led;
}sys;
struct{
bool fan_1;
bool fan_2;
bool fan_3;
}status;
struct{
bool mod_sleep;
bool power_en;
bool shutdown_req;
bool sys_reset;
bool force_recovery;
bool sleep_wake;
}som;//som power management
struct{
float out_24v_div16;
float out_5v_div8;
float out_12v_div8;
float bkp_bat_div8;
float main_pwr_div16;
bool pmb_temp_sen_en;
bool pmb_temp_sen_alt;
bool pmb_coulomb_alcc;
bool pmb_chrg_stat2;
bool pmg_chrg_stat1;
struct{
float voltage;
float current;
float cap;
float temp;
}coulomb;
}pmb;//power management board
struct{
bool u2_vbus_1;
bool u2_vbus_2;
bool u2_vbus_3;
bool u2_vbus_4;
bool u2_vbus_5;
bool u2_vbus_6;
bool u3_vbus_1;
bool u3_vbus_2;
bool u3_vbus_3;
bool u3_vbus_4;
bool u3_vbus_5;
bool u3_vbus_6;
}port;
struct{
bool u2_hub_pwr;
bool u3_hub_pwr;
bool u3_host_pwr;
bool u3_gec_pwr;
bool ge_sw_pwr;
}soc;
struct{
bool fan_valid_1;
bool fan_valid_2;
bool fan_valid_3;
}fan;
struct {
float sensor_1;
float sensor_2;
float sensor_3;
}temp;
2020-04-17 15:55:14 +08:00
}NaviKit_t;
extern NaviKit_t NaviKit;
2020-04-27 16:58:16 +08:00
void NaviKit_var_init();
2020-04-17 15:55:14 +08:00
#endif /* INC_NAVIKIT_H_ */