|
void | setup (void) |
| Setup the Canbus line.
|
|
void | run (void) |
| Run the teensy Canbus line.
|
|
virtual int | getClassID () const |
|
template<typename... T> |
| Module_t (T *...mods) |
|
|
static void | enableInterrupts (bool enable) |
| Enable mailbox interrupts, allowing values to automaticaly update. Enabled by default.
|
|
static void | getData (const uint32_t address, uint8_t buf[8]) |
| Get raw data from a canbus address.
|
|
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 the buffer. Invalid addresses will return a buffer that is ignored.
|
|
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 given function. Keep callbacks quick and simple.
|
|
static void | pushData (const uint32_t address) |
| queue and address's buffer to be pushed. Invalid addresses will not do anything.
|
|
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.
|
|
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 | enableCanbusSniffer (bool enable) |
| continuously prints out strings of any message that is received through canbus. As such, this function only works when the ECU is in ascii debug mode.
|
|
|
virtual void | print () |
|
const bitmapVal_t | id |
|
Definition at line 35 of file Canbus.h.
◆ enableInterrupts()
static void CAN::Canbus_t::enableInterrupts |
( |
bool |
enable | ) |
|
|
static |
Enable mailbox interrupts, allowing values to automaticaly update. Enabled by default.
- Parameters
-
◆ getBuffer()
static constexpr Buffer * CAN::Canbus_t::getBuffer |
( |
const uint32_t |
address | ) |
|
|
staticconstexpr |
Get the buffer of an any address. If it is outgoing, use pushData to push the data after modifying the buffer. Invalid addresses will return a buffer that is ignored.
- Note
- buffers that are for incoming addresses should not be modified, but can be monitored
-
use setSemaphore before using the given pointer while interrupts are active as undefined behavior may occur, alternatively, use a Buffer struct
- Parameters
-
- Returns
- volatile uint8_t[8] buffer array of the message, length 8
◆ getData()
static void CAN::Canbus_t::getData |
( |
const uint32_t |
address, |
|
|
uint8_t |
buf[8] |
|
) |
| |
|
static |
Get raw data from a canbus address.
- Note
- Only valid incoming addresses will put data onto the given buffer
- Parameters
-
address | The incoming address |
buf | the buffer to copy data to |
◆ pushData()
static void CAN::Canbus_t::pushData |
( |
const uint32_t |
address | ) |
|
|
static |
queue and address's buffer to be pushed. Invalid addresses will not do anything.
- Parameters
-
address | The outgoing address |
◆ sendData() [1/3]
static void CAN::Canbus_t::sendData |
( |
Buffer & |
buf | ) |
|
|
static |
Send data given a buffer object.
- Parameters
-
buf | The buffer object to use |
◆ sendData() [2/3]
static void CAN::Canbus_t::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 |
|
) |
| |
|
static |
Send raw data over a given canbus address using given values.
- Note
- Function does not verify that address is outgoing, undefined behavior may occur if data is sent thorugh an incoming address
- Parameters
-
address | The outgoing address |
buf_0 | byte 0 of the outgoing buffer |
buf_1 | byte 1 of the outgoing buffer |
buf_2 | byte 2 of the outgoing buffer |
buf_3 | byte 3 of the outgoing buffer |
buf_4 | byte 4 of the outgoing buffer |
buf_5 | byte 5 of the outgoing buffer |
buf_6 | byte 6 of the outgoing buffer |
buf_7 | byte 7 of the outgoing buffer |
◆ sendData() [3/3]
static void CAN::Canbus_t::sendData |
( |
const uint32_t |
address, |
|
|
uint8_t |
buf[8] |
|
) |
| |
|
static |
Send raw data over a given canbus address using a given array.
- Note
- Function does not verify that address is outgoing, undefined behavior will occur if data is sent thorugh an incoming address
- Parameters
-
address | The outgoing address |
buf | The buffer array to be sent |
◆ setCallback()
static void CAN::Canbus_t::setCallback |
( |
const uint32_t |
address, |
|
|
canCallback |
callback |
|
) |
| |
|
static |
Set a callback to an incoming address. If an incoming address buffer is updated it will call the given function. Keep callbacks quick and simple.
- Note
- Only one callback per address
If the semaphore is set to the given address the callback will not be called. Semaphores do not have to be used within the function to read from the given buffer.
- Parameters
-
address | The incoming address |
callback | The callback function, refer to canCallback |
◆ setup()
void CAN::Canbus_t::setup |
( |
void |
| ) |
|
|
virtual |
◆ ID
LOG_TAG CAN::Canbus_t::ID = "Canbus" |
|
inlinestatic |
The documentation for this class was generated from the following file: