|
| enum | Baudrate {
BR_NOT_SET = 0
, BR_125K = 125000
, BR_250K = 250000
, BR_500K = 500000
,
BR_1M = 1000000
} |
| enum | Status { STATUS_OK
, STATUS_ERROR_ACTIVE
, STATUS_BUS_OFF
, STATUS_ERROR_PASSIVE
} |
| enum | FilterType { FILTER_ACCEPT_ALL
, FILTER_MATCH_ID
, FILTER_MASKED
} |
| enum | Type {
UART
, SPI
, I2C
, PWM
,
CAN
} |
| | Enumeration of hardware resource types. More...
|
|
| virtual bool | begin ()=0 |
| virtual bool | setBaudrate (Baudrate baudrate)=0 |
| virtual bool | setPins (int8_t txPin, int8_t rxPin)=0 |
|
virtual bool | end ()=0 |
|
virtual bool | sendMessage (const CANMessage &message)=0 |
| virtual bool | readMessage (CANMessage &message)=0 |
| virtual uint8_t | available ()=0 |
|
virtual bool | setupFilter (uint32_t id, uint32_t mask)=0 |
|
Baudrate | getBaudrate () const |
|
uint8_t | getTxPin () const |
|
uint8_t | getRxPin () const |
| virtual bool | reset () override |
| | Reset the hardware resource to a known default state.
|
| virtual Type | getType ()=0 |
| | Get the hardware resource type.
|
| bool | requestUsage () |
| | Request a usage slot for this resource.
|
| uint8_t | getUsages () |
| | Get the current number of usages of this resource.
|
| bool | isUsed () |
| | Check if the resource is currently used.
|
| virtual uint8_t | getRemainingUsages () |
| | Get remaining usage capacity for this resource.
|
|
|
Baudrate | _baudrate = BR_NOT_SET |
|
FilterType | _filterType = FILTER_ACCEPT_ALL |
|
int8_t | _txPin = -1 |
|
int8_t | _rxPin = -1 |
|
Status | _status = STATUS_OK |
|
bool | _isInitialized = false |
|
uint32_t | _filterId = 0 |
|
uint32_t | _filterMask = 0 |
| uint8_t | usages =0 |
| | Current usage counter.
|
|
| | HardwareResource ()=default |
| | Default constructor.
|
| virtual uint8_t | getMaxUsages () |
| | Get the maximum simultaneous usages allowed for this resource.
|
◆ available()
| virtual uint8_t CANCore::available |
( |
| ) |
|
|
pure virtual |
◆ begin()
| virtual bool CANCore::begin |
( |
| ) |
|
|
pure virtual |
◆ readMessage()
| virtual bool CANCore::readMessage |
( |
CANMessage & | message | ) |
|
|
pure virtual |
◆ reset()
| virtual bool CANCore::reset |
( |
| ) |
|
|
inlineoverridevirtual |
Reset the hardware resource to a known default state.
Default implementation clears the usage counter and logs the reset. Derived classes should call the base implementation and perform any additional hardware-specific reset steps.
- Returns
- true if the reset succeeded, false otherwise.
Reimplemented from HardwareResource.
Reimplemented in ESP32_CANCore.
◆ setBaudrate()
| virtual bool CANCore::setBaudrate |
( |
Baudrate | baudrate | ) |
|
|
pure virtual |
◆ setPins()
| virtual bool CANCore::setPins |
( |
int8_t | txPin, |
|
|
int8_t | rxPin ) |
|
pure virtual |
The documentation for this class was generated from the following file:
- C:/Users/leowa/Documents/PlatformIO/Projects/CANTramFrameworkUsage/lib/CANTramFramework/include/CANCore.h