VitroIO SDK
Software development kit for Vitro Shard.
Loading...
Searching...
No Matches
vitroio::sdk::impl::_CAN Class Reference

The _CAN class is a simple extension of mbed::CAN class. More...

#include <_CAN.h>

Inheritance diagram for vitroio::sdk::impl::_CAN:
Collaboration diagram for vitroio::sdk::impl::_CAN:

Public Member Functions

 _CAN (PinName rd, PinName td, int hz)
 
 ~_CAN ()
 
int read_from_irq (CANMessage &msg, int handle=0)
 

Detailed Description

The _CAN class is a simple extension of mbed::CAN class.

The class inherits from mbed::CAN class. The aim of this class is to provide read_from_irq() method which does not use mutex, because mutexes cannot be used from ISR context. When we want to read messages using IRQ, the only way to clear IRQ is reading of the data. There is an issue on mbed-os github: https://github.com/ARMmbed/mbed-os/issues/5374

Note
When the read_from_irq() method is in use, the read() method should not be used in code, because the read_from_irq() method does not guarantee thread safety.

Constructor & Destructor Documentation

◆ _CAN()

vitroio::sdk::impl::_CAN::_CAN ( PinName  rd,
PinName  td,
int  hz 
)

◆ ~_CAN()

vitroio::sdk::impl::_CAN::~_CAN ( )

Member Function Documentation

◆ read_from_irq()

int vitroio::sdk::impl::_CAN::read_from_irq ( CANMessage &  msg,
int  handle = 0 
)