CANTram Framework 1.0.1
Dieses Framework ermöglicht die Nutzung der CANTram Hardware, einer Mikrocontroller basierten mdoularen Steuerung.
Loading...
Searching...
No Matches
CANCore Class Referenceabstract
Inheritance diagram for CANCore:
Collaboration diagram for CANCore:

Classes

struct  CANMessage

Public Types

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 }
Public Types inherited from HardwareResource
enum  Type {
  UART , SPI , I2C , PWM ,
  CAN
}
 Enumeration of hardware resource types. More...

Public Member Functions

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.
Public Member Functions inherited from HardwareResource
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.

Protected Attributes

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
Protected Attributes inherited from HardwareResource
uint8_t usages =0
 Current usage counter.

Additional Inherited Members

Protected Member Functions inherited from HardwareResource
 HardwareResource ()=default
 Default constructor.
virtual uint8_t getMaxUsages ()
 Get the maximum simultaneous usages allowed for this resource.

Member Function Documentation

◆ available()

virtual uint8_t CANCore::available ( )
pure virtual

Implemented in ESP32_CANCore.

◆ begin()

virtual bool CANCore::begin ( )
pure virtual

Implemented in ESP32_CANCore.

◆ readMessage()

virtual bool CANCore::readMessage ( CANMessage & message)
pure virtual

Implemented in ESP32_CANCore.

◆ 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.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBaudrate()

virtual bool CANCore::setBaudrate ( Baudrate baudrate)
pure virtual

Implemented in ESP32_CANCore.

◆ setPins()

virtual bool CANCore::setPins ( int8_t txPin,
int8_t rxPin )
pure virtual

Implemented in ESP32_CANCore.


The documentation for this class was generated from the following file:
  • C:/Users/leowa/Documents/PlatformIO/Projects/CANTramFrameworkUsage/lib/CANTramFramework/include/CANCore.h