SAE Teensy ECU
IIT SAE Microcontroller programming
Loading...
Searching...
No Matches
SerialCommand.h File Reference

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
 

Detailed Description

SerialCommand functionality.

Author
IR
Version
0.1
Date
2021-03-16

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

See also
SerialCommand.def to define new command numbers

Definition in file SerialCommand.h.

Macro Definition Documentation

◆ __ECU_SERIALCOMMAND_H__l

#define __ECU_SERIALCOMMAND_H__l

Definition at line 21 of file SerialCommand.h.

Typedef Documentation

◆ CommandCallback

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.