Vehicle Control Unit
0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Core
Inc
Systems
ControllerSystem.h
Go to the documentation of this file.
1
#ifndef RENSSELAERMOTORSPORT_CONTROLLER_SYSTEM_H
2
#define RENSSELAERMOTORSPORT_CONTROLLER_SYSTEM_H
3
4
#include <stdio.h>
5
#include <stdlib.h>
6
#include <string.h>
7
8
#include "
System.h
"
9
#include "
MonitorSystem.h
"
10
11
#define MAX_MONITORS 10
12
13
typedef
enum
{
14
c_TORQUE
,
15
c_APPS
,
16
c_BRAKES
,
17
}
ControllerType
;
18
19
typedef
struct
{
20
System
system
;
21
ControllerType
type
;
22
MonitorSystem
* monitors[
MAX_MONITORS
];
// What monitors are associated with this controller?
23
int
num_monitors
;
24
int (*safety)(
void
* self);
// Check if the controller is operating safely
25
int (*addMonitor)(
void
* self,
MonitorSystem
* monitor);
// Add a monitor to the controller
26
int (*removeMonitor)(
void
* self,
MonitorSystem
* monitor);
// Remove a monitor from the controller
27
}
ControllerSystem
;
28
37
void
initControllerSystem
(
ControllerSystem
* controller,
const
char
* name,
int
hz,
38
ControllerType
type
);
39
47
int
defaultAddMonitor
(
void
* self,
MonitorSystem
* monitor);
48
56
int
defaultRemoveMonitor
(
void
* self,
MonitorSystem
* monitor);
57
58
#endif
// RENSSELAERMOTORSPORT_CONTROLLER_SYSTEM_H
59
MAX_MONITORS
#define MAX_MONITORS
Definition:
ControllerSystem.h:11
defaultRemoveMonitor
int defaultRemoveMonitor(void *self, MonitorSystem *monitor)
Removes a monitor from the controller.
Definition:
ControllerSystem.c:22
defaultAddMonitor
int defaultAddMonitor(void *self, MonitorSystem *monitor)
Adds a monitor to the controller.
Definition:
ControllerSystem.c:12
ControllerType
ControllerType
Definition:
ControllerSystem.h:13
c_TORQUE
@ c_TORQUE
Definition:
ControllerSystem.h:14
c_BRAKES
@ c_BRAKES
Definition:
ControllerSystem.h:16
c_APPS
@ c_APPS
Definition:
ControllerSystem.h:15
initControllerSystem
void initControllerSystem(ControllerSystem *controller, const char *name, int hz, ControllerType type)
Initializes the Controller System with initial settings.
Definition:
ControllerSystem.c:4
MonitorSystem.h
System.h
type
type
Definition:
Updateable.h:17
ControllerSystem
Definition:
ControllerSystem.h:19
ControllerSystem::type
ControllerType type
Definition:
ControllerSystem.h:21
ControllerSystem::system
System system
Definition:
ControllerSystem.h:20
ControllerSystem::num_monitors
int num_monitors
Definition:
ControllerSystem.h:23
MonitorSystem
Definition:
MonitorSystem.h:24
System
Definition:
System.h:17
Generated by
1.9.5