SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
Heartbeat.h
Go to the documentation of this file.
1
14#ifndef __ECU_HEARTBEAT_H__
15#define __ECU_HEARTBEAT_H__
16
17#include <stdint.h>
18#include <stdlib.h>
19
30namespace Heartbeat {
31
35typedef void (*beatFunc)(void);
36
41
46
53
60
61} // namespace Heartbeat
62
63#endif // __ECU_HEARTBEAT_H__
A module used to both ensure a connection to both ECUs using CAN and to periodically run callbacks.
Definition Heartbeat.h:30
void addCallback(beatFunc func)
Add a callback to be run at each haertbeat.
void beginReceiving()
Set callback to receive beats over CAN.
int checkBeat()
Poll if a beat has been received.
void(* beatFunc)(void)
Function called each time the heart beats.
Definition Heartbeat.h:35
void beginBeating()
begin sending a beat signal at a set interval