Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
ExternalSystem.h
Go to the documentation of this file.
1#ifndef RENSSELAERMOTORSPORT_EXTERNAL_SYSTEM_H
2#define RENSSELAERMOTORSPORT_EXTERNAL_SYSTEM_H
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7
8#include "System.h"
9#include "CommsSystem.h"
10#include "../Scheduler/Task.h"
11
12typedef enum {
15 IMD
17
18// Need to do this because of circular dependency
23 CommsSystem* comms; //What comms are we using to communicate with the external system? CAN, Ethernet, etc.
24 int (*updateExternal)(struct ExternalSystem* external); // Update the external system
25 int (*check_heartbeat)(void* self); // Check if the controller is still alive
26 void* child; // Pointer to the child struct
27};
28
40void initExternalSystem(ExternalSystem* external, const char* name, int hz,
42 int (*check_heartbeat)(void* self), void* child);
43
50int e_defaultUpdate(Updateable* updateable);
51#endif // RENSSELAERMOTORSPORT_EXTERNAL_SYSTEM_H
void initExternalSystem(ExternalSystem *external, const char *name, int hz, ExternalType type, int(*updateExternal)(ExternalSystem *external), int(*check_heartbeat)(void *self), void *child)
Definition: ExternalSystem.c:6
ExternalType
@ e_INVERTER
@ IMD
@ BMS
int e_defaultUpdate(Updateable *updateable)
ExternalType type
int(* updateExternal)(struct ExternalSystem *external)
CommsSystem * comms
int(* check_heartbeat)(void *self)
Definition: System.h:17