SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
SerialCommand.h
Go to the documentation of this file.
1
20#ifndef __ECU_SERIALCOMMAND_H__
21#define __ECU_SERIALCOMMAND_H__l
22
23#include "SerialCommand.def"
24#include "core_pins.h"
25#include "usb_serial.h"
26#include <stdint.h>
27#include <stdlib.h>
28
32typedef void (*CommandCallback)(void);
33
37namespace Cmd {
38
45void setCommand(uint8_t command, CommandCallback callback);
46
53
54} // namespace Cmd
55
56#endif // __ECU_SERIALCOMMAND_H__
SerialCommand config.
void(* CommandCallback)(void)
A function that will be called whenever its corresponding command byte is received.
A simple way to run commands over serial.
int receiveCommand(void)
receive any command from serial by matching incoming bytes to a callback
void setCommand(uint8_t command, CommandCallback callback)
attach a single callback to a byte value that will be received over serial