The foxBMS secondary mcu API documentation
mcu.h
Go to the documentation of this file.
1 
56 #ifndef MCU_H_
57 #define MCU_H_
58 
59 /*================== Includes =============================================*/
60 #include "general.h"
61 
62 /*================== Macros and Definitions ===============================*/
63 typedef struct {
64  uint32_t off0;
65  uint32_t off32;
66  uint32_t off64;
67  uint32_t crc;
69 
70 /*================== Constant and Variable Definitions ====================*/
72 
73 /*================== Function Prototypes ==================================*/
74 
80 extern void MCU_Wait_us(uint32_t time);
81 
90 extern unsigned int MCU_DisableINT(void);
91 
99 extern void MCU_RestoreINT(unsigned int primask_reg);
100 
106 extern uint32_t MCU_SystemResetStatus(uint32_t* regValue);
107 
113 extern uint32_t MCU_GetTimeBase(void);
114 
118 extern void MCU_GetDeviceID(MCU_DeviceID_s * deviceID);
119 
124 
125 /*================== Function Implementations =============================*/
126 #endif /* MCU_H_ */
void MCU_GetDeviceID(MCU_DeviceID_s *deviceID)
Get unique device ID.
Definition: mcu.c:166
uint32_t crc
Definition: mcu.h:67
STD_RETURN_TYPE_e MCU_CheckCRCUniqueDeviceID(uint8_t *dataptr)
Check if passed crc == unique device ID crc.
uint32_t off32
Definition: mcu.h:65
STD_RETURN_TYPE_e
Definition: std_types.h:76
void MCU_Wait_us(uint32_t time)
simple wait-loop to wait short periods of time
Definition: mcu.c:70
uint32_t MCU_SystemResetStatus(uint32_t *regValue)
Gets system reset status.
Definition: mcu.c:124
uint32_t off64
Definition: mcu.h:66
uint32_t MCU_GetTimeBase(void)
gets systick value which is a 24-bit downcounter, auto refreshed with 71999
Definition: mcu.c:119
Settings for the system.
void MCU_RestoreINT(unsigned int primask_reg)
restores interrupts to given state (enable or disable)
Definition: mcu.c:110
Definition: mcu.h:63
unsigned int MCU_DisableINT(void)
disables interrupts and returns prior state (enabled or disabled)
Definition: mcu.c:102
uint32_t off0
Definition: mcu.h:64
MCU_DeviceID_s mcu_unique_deviceID
Definition: mcu.c:63