16#ifndef __ECU_CANBUS_H__
17#define __ECU_CANBUS_H__
25#include "FlexCAN_T4.h"
37 inline static LOG_TAG ID =
"Canbus";
39 using Module::Module_t::Module_t;
67 static void getData(
const uint32_t address, uint8_t buf[8]);
115 static void sendData(
const uint32_t address, uint8_t buf[8]);
132 static void sendData(
const uint32_t address,
const uint8_t buf_0 = 0,
const uint8_t buf_1 = 0,
const uint8_t buf_2 = 0,
const uint8_t buf_3 = 0,
const uint8_t buf_4 = 0,
const uint8_t buf_5 = 0,
const uint8_t buf_6 = 0,
const uint8_t buf_7 = 0);
Define incoming CAN line addresses.
Configure canbus functionality.
const char * LOG_TAG
Type definition of logging tags This typedef is necessary to allow for easier manipulation of code by...
static void enableCanbusSniffer(bool enable)
continuously prints out strings of any message that is received through canbus. As such,...
static void sendData(const uint32_t address, const uint8_t buf_0=0, const uint8_t buf_1=0, const uint8_t buf_2=0, const uint8_t buf_3=0, const uint8_t buf_4=0, const uint8_t buf_5=0, const uint8_t buf_6=0, const uint8_t buf_7=0)
Send raw data over a given canbus address using given values.
static void sendData(Buffer &buf)
Send data given a buffer object.
static void sendData(const uint32_t address, uint8_t buf[8])
Send raw data over a given canbus address using a given array.
void setup(void)
Setup the Canbus line.
static void setCallback(const uint32_t address, canCallback callback)
Set a callback to an incoming address. If an incoming address buffer is updated it will call the give...
static void getData(const uint32_t address, uint8_t buf[8])
Get raw data from a canbus address.
void run(void)
Run the teensy Canbus line.
static constexpr Buffer * getBuffer(const uint32_t address)
Get the buffer of an any address. If it is outgoing, use pushData to push the data after modifying th...
static void pushData(const uint32_t address)
queue and address's buffer to be pushed. Invalid addresses will not do anything.
static void enableInterrupts(bool enable)
Enable mailbox interrupts, allowing values to automaticaly update. Enabled by default.
Module_t should be used for major components of a framework, it is used to isolate,...
Canbus functionality. Refer to Canbus.h for more info.
void(* canCallback)(uint32_t, volatile uint8_t *)
The function type to pass to addCallback.
An incoming canbus message, allows the message data to be interpreted through a simple wrapper class.