Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Classes | Enumerations | Functions
MonitorSystem.h File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "System.h"
Include dependency graph for MonitorSystem.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  MonitorSystem
 

Enumerations

enum  MonitorType { m_TORQUE , m_APPS , m_TRACTION , m_ACCUMULATOR }
 
enum  FaultType { NONE , SYSTEM_ADJUST , SYSTEM_DISABLE , VEHICLE_SHUTDOWN }
 

Functions

void initMonitorSystem (MonitorSystem *monitor, const char *name, int hz, MonitorType type, FaultType fault)
 Initializes the Monitor System with initial settings. More...
 

Enumeration Type Documentation

◆ FaultType

enum FaultType
Enumerator
NONE 
SYSTEM_ADJUST 
SYSTEM_DISABLE 
VEHICLE_SHUTDOWN 

Definition at line 17 of file MonitorSystem.h.

17 {
18 NONE, // If a fault is detected, do nothing
19 SYSTEM_ADJUST, // If a fault is detected, adjust the system
20 SYSTEM_DISABLE, // If a fault is detected, disable the system, and adjust the vehicle
21 VEHICLE_SHUTDOWN // If a fault is detected, shut down the vehicle
22} FaultType;
FaultType
Definition: MonitorSystem.h:17
@ VEHICLE_SHUTDOWN
Definition: MonitorSystem.h:21
@ SYSTEM_ADJUST
Definition: MonitorSystem.h:19
@ SYSTEM_DISABLE
Definition: MonitorSystem.h:20
@ NONE
Definition: MonitorSystem.h:18

◆ MonitorType

Enumerator
m_TORQUE 
m_APPS 
m_TRACTION 
m_ACCUMULATOR 

Definition at line 10 of file MonitorSystem.h.

10 {
12 m_APPS,
MonitorType
Definition: MonitorSystem.h:10
@ m_APPS
Definition: MonitorSystem.h:12
@ m_ACCUMULATOR
Definition: MonitorSystem.h:14
@ m_TRACTION
Definition: MonitorSystem.h:13
@ m_TORQUE
Definition: MonitorSystem.h:11

Function Documentation

◆ initMonitorSystem()

void initMonitorSystem ( MonitorSystem monitor,
const char *  name,
int  hz,
MonitorType  type,
FaultType  fault 
)

Initializes the Monitor System with initial settings.

Parameters
monitorA pointer to the MonitorSystem structure.
nameThe name of the monitor.
hzRate at which the monitor is called (in hz).
typeThe type of monitor (per MonitorType).
faultThe type of fault to execute when monitor trips (per FaultType).

Definition at line 3 of file MonitorSystem.c.

4 {
5 initSystem(&monitor->system, name, hz, MONITOR);
6 monitor->type = type;
7 monitor->fault = fault;
8}
void initSystem(System *system, const char *name, int hz, SystemType type)
Initializes a System object.
Definition: System.c:3
@ MONITOR
Definition: System.h:13
type
Definition: Updateable.h:17
MonitorType type
Definition: MonitorSystem.h:26
FaultType fault
Definition: MonitorSystem.h:27
Here is the call graph for this function:
Here is the caller graph for this function: