![]() |
SAE Teensy ECU
IIT SAE Microcontroller programming
|
SerialCommand functionality. More...
#include "SerialCommand.def"#include "core_pins.h"#include "usb_serial.h"#include <stdint.h>#include <stdlib.h>Go to the source code of this file.
Namespaces | |
| namespace | Cmd |
| A simple way to run commands over serial. | |
Typedefs | |
| typedef void(* | CommandCallback) (void) |
| A function that will be called whenever its corresponding command byte is received. | |
Functions | |
| void | Cmd::setCommand (uint8_t command, CommandCallback callback) |
| attach a single callback to a byte value that will be received over serial | |
| int | Cmd::receiveCommand (void) |
| receive any command from serial by matching incoming bytes to a callback | |
SerialCommand functionality.
This module is used to run commands on an ECU by sending specific byte codes over serial.
Commands can be defined by calling Cmd::setCommand(), where the uint8_t command argument is defined in SerialCommand.def
Cmd::receiveCommand() must be called to poll Serial and check for any available commands
Definition in file SerialCommand.h.
| #define __ECU_SERIALCOMMAND_H__l |
Definition at line 21 of file SerialCommand.h.
| typedef void(* CommandCallback) (void) |
A function that will be called whenever its corresponding command byte is received.
Definition at line 32 of file SerialCommand.h.