Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
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
13typedef enum {
18
19typedef struct {
22 MonitorSystem* monitors[MAX_MONITORS]; // What monitors are associated with this controller?
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
28
37void initControllerSystem(ControllerSystem* controller, const char* name, int hz,
39
47int defaultAddMonitor(void* self, MonitorSystem* monitor);
48
56int defaultRemoveMonitor(void* self, MonitorSystem* monitor);
57
58#endif // RENSSELAERMOTORSPORT_CONTROLLER_SYSTEM_H
59
#define MAX_MONITORS
int defaultRemoveMonitor(void *self, MonitorSystem *monitor)
Removes a monitor from the controller.
int defaultAddMonitor(void *self, MonitorSystem *monitor)
Adds a monitor to the controller.
ControllerType
@ c_TORQUE
@ c_BRAKES
@ c_APPS
void initControllerSystem(ControllerSystem *controller, const char *name, int hz, ControllerType type)
Initializes the Controller System with initial settings.
type
Definition: Updateable.h:17
ControllerType type
Definition: System.h:17