Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Inc
Systems
MonitorSystem.h
Go to the documentation of this file.
1
#ifndef RENSSELAERMOTORSPORT_MONITOR_SYSTEM_H
2
#define RENSSELAERMOTORSPORT_MONITOR_SYSTEM_H
3
4
#include <stdio.h>
5
#include <stdlib.h>
6
#include <string.h>
7
8
#include "
System.h
"
9
10
typedef
enum
{
11
m_TORQUE
,
12
m_APPS
,
13
m_BRAKES
,
14
m_TRACTION
,
15
m_ACCUMULATOR
,
16
m_RTD
17
}
MonitorType
;
18
19
typedef
enum
{
20
NONE
,
// If a fault is detected, do nothing
21
SYSTEM_ADJUST
,
// If a fault is detected, adjust the system
22
SYSTEM_DISABLE
,
// If a fault is detected, disable the system, and adjust the vehicle
23
VEHICLE_SHUTDOWN
// If a fault is detected, shut down the vehicle
24
}
FaultType
;
25
26
typedef
struct
{
27
System
system
;
28
MonitorType
type
;
29
FaultType
fault
;
30
int (*runMonitor)(
void
* self);
31
}
MonitorSystem
;
32
42
void
initMonitorSystem
(
MonitorSystem
* monitor,
const
char
* name,
int
hz,
43
MonitorType
type,
FaultType
fault,
int
(*runMonitor)(
void
* self));
44
45
#endif
// RENSSELAERMOTORSPORT_MONITOR_SYSTEM_H
initMonitorSystem
void initMonitorSystem(MonitorSystem *monitor, const char *name, int hz, MonitorType type, FaultType fault, int(*runMonitor)(void *self))
Initializes the Monitor System with initial settings.
Definition:
MonitorSystem.c:3
MonitorType
MonitorType
Definition:
MonitorSystem.h:10
m_RTD
@ m_RTD
Definition:
MonitorSystem.h:16
m_APPS
@ m_APPS
Definition:
MonitorSystem.h:12
m_ACCUMULATOR
@ m_ACCUMULATOR
Definition:
MonitorSystem.h:15
m_BRAKES
@ m_BRAKES
Definition:
MonitorSystem.h:13
m_TRACTION
@ m_TRACTION
Definition:
MonitorSystem.h:14
m_TORQUE
@ m_TORQUE
Definition:
MonitorSystem.h:11
FaultType
FaultType
Definition:
MonitorSystem.h:19
VEHICLE_SHUTDOWN
@ VEHICLE_SHUTDOWN
Definition:
MonitorSystem.h:23
SYSTEM_ADJUST
@ SYSTEM_ADJUST
Definition:
MonitorSystem.h:21
SYSTEM_DISABLE
@ SYSTEM_DISABLE
Definition:
MonitorSystem.h:22
NONE
@ NONE
Definition:
MonitorSystem.h:20
System.h
MonitorSystem
Definition:
MonitorSystem.h:26
MonitorSystem::type
MonitorType type
Definition:
MonitorSystem.h:28
MonitorSystem::fault
FaultType fault
Definition:
MonitorSystem.h:29
MonitorSystem::system
System system
Definition:
MonitorSystem.h:27
System
Definition:
System.h:17
Generated by
1.9.5