Vehicle Control Unit 0.01
This is the c library for controlling the car.
Loading...
Searching...
No Matches
Imd.h
Go to the documentation of this file.
1#ifndef RENSSELAERMOTORSPORT_IMD_H
2#define RENSSELAERMOTORSPORT_IMD_H
3
4#include <stdbool.h>
5#include "../ExternalSystem.h"
6
7typedef enum {
12
13typedef struct {
15 bool runningFlag; //Status: Warnings and Alarms //IMD_Info_General: Byte 4, 5
16 float IsoResistanceNeg; //IMD_Info_IsolationDetail: Byte 0, 1
17 float IsoResistancePos; //IMD_Info_IsolationDetail: Byte 0, 1
18 float IsoResistanceCorrected; //(neg. Tolerance shifted) IMD_Info_General: Byte 0, 1
20} IMDValues;
21
28void initIMD(IMDValues* IMD, int hz);
29
35void updateIMD(void* IMDValues);
36
45int getIMDStatus(void* IMDValues, IMDStatus status);
46
54
62
70
71
72
73#endif // RENSSELAERMOTORSPORT_IMD_H
@ IMD
float getIsoResistanceNeg(void *IMDValues)
Retrieves the negative isolation resistance value from the given IMD values.
Definition: Imd.c:30
float getIsoResistanceCorrected(void *IMDValues)
Retrieves the positive isolation resistance value from the IMD values.
Definition: Imd.c:40
void initIMD(IMDValues *IMD, int hz)
Initializes the IMD with the specified frequency.
Definition: Imd.c:4
int getIMDStatus(void *IMDValues, IMDStatus status)
Gets the status of the IMD.
Definition: Imd.c:25
IMDStatus
Definition: Imd.h:7
@ IMD_ERROR
Definition: Imd.h:9
@ IMD_START
Definition: Imd.h:10
@ IMD_OK
Definition: Imd.h:8
float getIsoResistancePos(void *IMDValues)
Retrieves the positive isolation resistance value from the IMD values.
Definition: Imd.c:35
void updateIMD(void *IMDValues)
Updates the IMD values.
Definition: Imd.c:14
Definition: Imd.h:13
IMDStatus IMDStatus
Definition: Imd.h:19
ExternalSystem base
Definition: Imd.h:14
float IsoResistanceCorrected
Definition: Imd.h:18
bool runningFlag
Definition: Imd.h:15
float IsoResistancePos
Definition: Imd.h:17
float IsoResistanceNeg
Definition: Imd.h:16