STM32Cube Expansion Pack CAN Stack
Can Class Referenceabstract

This pure virtual class holds the interface to work with derived driver classes. More...

#include <Can.h>

Inheritance diagram for Can:
Collaboration diagram for Can:

Public Member Functions

 Can ()
 Standard Constructor.
 
virtual ~Can ()
 basic destructor
 
CanDrvStates GetDrvState (void)
 To get the the software module state.
 
void SetDrvStateReady (void)
 Switch driver state to ready.
 
void SetDrvStateUninit (void)
 Switch driver state to uninit.
 
virtual Std_ReturnType Init (const CanConfigType *ptr2Config=NULL_PTR, const ComIf *ptr2ComIfObject=NULL_PTR)=0
 The API for Init. More...
 
virtual void Deinit (void)
 The API function for Deinit. More...
 
virtual Std_ReturnType SetBaudrate (ECU_CanController Controller, CanControllerBaudRateConfigID BaudrateId)
 The API to set baudrate on a controller. More...
 
virtual Std_ReturnType SetControllerMode (ECU_CanController Controller, CanControllerStates Transition)=0
 The API to set a controller mode. More...
 
virtual void DisableControllerInterrupts (ECU_CanController Controller)
 The API to disable all interrupts of a controller. More...
 
virtual void EnableControllerInterrupts (ECU_CanController Controller)
 The API to enable all interrupts of a controller. More...
 
virtual Std_ReturnType CheckWakeup (ECU_CanController Controller)
 The API checks the controller for wakeup events. More...
 
virtual Std_ReturnType GetControllerErrorState (ECU_CanController Controller, uint8_t *ErrorStatePtr)
 The API returns the error state of the CAN controller. More...
 
virtual Std_ReturnType GetControllerMode (ECU_CanController Controller, CanControllerStates *ControllerModePtr)
 The API returns the error state of the CAN controller. More...
 
virtual Std_ReturnType Write (ECU_CanController Controller, const ComStack_CanMessageType *ptr2PduInfo)
 The API to write a message to tx FIFO. More...
 
virtual Std_ReturnType SetFilterByBitmask (ECU_CanController Controller, ComStack_CanIdType FilterId, ComStack_CanIdType FilterMask)
 configure a free hardware filter using bit masking More...
 
virtual Std_ReturnType SetFilterByCanId (ECU_CanController Controller, ComStack_CanIdType FilterId)
 configure a free hardware filter using single CAN Id filtering More...
 
virtual void TxTask (void)
 a task function to do something cycling
 

Private Attributes

CanDrvStates state = CanDrvStates::Uninit
 the sate of the software module
 

Additional Inherited Members

- Private Member Functions inherited from TME_VersionInfo
 TME_VersionInfo (uint16_t Module, uint16_t Version, uint16_t Patch)
 constructor to set version Ids
 
 TME_VersionInfo (uint16_t Vendor, uint16_t Module, uint16_t Version, uint16_t Patch)
 constructor to set version Ids including the vendor
 
 TME_VersionInfo (const TME_VersionInfo &other)
 copy constructor
 
Std_ReturnType GetVersionInfo (uint32_t BufferLength, const uint8_t *Ptr2Buffer)
 Copies the VersionIinfo to a 8byte buffer. More...
 

Detailed Description

This pure virtual class holds the interface to work with derived driver classes.

It will be managed like the AUTOSAR CAN-module

Definition at line 254 of file Can.h.

Member Function Documentation

◆ CheckWakeup()

virtual Std_ReturnType Can::CheckWakeup ( ECU_CanController  Controller)
inlinevirtual

The API checks the controller for wakeup events.

See also
CAN_CHECK_WAKEUP_ID

Definition at line 324 of file Can.h.

References E_NOT_OK.

◆ Deinit()

virtual void Can::Deinit ( void  )
inlinevirtual

The API function for Deinit.

See also
CAN_DEINIT_ID

Definition at line 281 of file Can.h.

◆ DisableControllerInterrupts()

virtual void Can::DisableControllerInterrupts ( ECU_CanController  Controller)
inlinevirtual

The API to disable all interrupts of a controller.

See also
CAN_DISABLE_CTRL_INT_ID

Definition at line 308 of file Can.h.

◆ EnableControllerInterrupts()

virtual void Can::EnableControllerInterrupts ( ECU_CanController  Controller)
inlinevirtual

The API to enable all interrupts of a controller.

See also
CAN_ENABLE_CTRL_INT_ID

Definition at line 316 of file Can.h.

◆ GetControllerErrorState()

virtual Std_ReturnType Can::GetControllerErrorState ( ECU_CanController  Controller,
uint8_t *  ErrorStatePtr 
)
inlinevirtual

The API returns the error state of the CAN controller.

Parameters
[in]Controllerselects the controller
[out]ErrorStatePtrgives a buffer where the error state should be stored
See also
CAN_GET_CTRL_ERROR_STATE_ID

Definition at line 334 of file Can.h.

References E_NOT_OK.

◆ GetControllerMode()

virtual Std_ReturnType Can::GetControllerMode ( ECU_CanController  Controller,
CanControllerStates ControllerModePtr 
)
inlinevirtual

The API returns the error state of the CAN controller.

Parameters
[in]Controllerselects the controller
[out]ControllerModePtrgives a buffer where the controller mode should be stored
See also
CAN_GET_CTRL_MODE_ID

Definition at line 345 of file Can.h.

References E_NOT_OK.

◆ Init()

virtual Std_ReturnType Can::Init ( const CanConfigType ptr2Config = NULL_PTR,
const ComIf ptr2ComIfObject = NULL_PTR 
)
pure virtual

The API for Init.

See also
CAN_INIT_ID

Implemented in CanDrv_bxCAN.

Referenced by CanIf::Init().

◆ SetBaudrate()

virtual Std_ReturnType Can::SetBaudrate ( ECU_CanController  Controller,
CanControllerBaudRateConfigID  BaudrateId 
)
inlinevirtual

The API to set baudrate on a controller.

Parameters
[in]Controllerselects the controller
[in]BaudrateIdselects the baudrate per name/id
See also
CAN_SET_BAUDRATE_ID

Definition at line 289 of file Can.h.

References E_NOT_OK.

◆ SetControllerMode()

virtual Std_ReturnType Can::SetControllerMode ( ECU_CanController  Controller,
CanControllerStates  Transition 
)
pure virtual

The API to set a controller mode.

Parameters
[in]Controllerselects the controller
[in]Transitionselects the transition per name/id
See also
CAN_SET_CONTROLLER_MODE_ID

Implemented in CanDrv_bxCAN.

Referenced by CanIf::Init().

◆ SetFilterByBitmask()

virtual Std_ReturnType Can::SetFilterByBitmask ( ECU_CanController  Controller,
ComStack_CanIdType  FilterId,
ComStack_CanIdType  FilterMask 
)
inlinevirtual

configure a free hardware filter using bit masking

set hardware filter

Attention
This isn't the same like inside STM register access. But the function manages the correct use for STM HAL
  • bit 31 is IDE
  • bit 30 is RTR
Parameters
[in]Controllerselect the controller where the filter should be applied
[in]FilterIdthe selected filter bits
[in]FilterMaskthe filter mask to select valid filter bits
Returns
E_OK if the filter is applied, E_NOT_OK no hardware filter free

Reimplemented in CanDrv_bxCAN.

Definition at line 375 of file Can.h.

References E_NOT_OK.

Referenced by CanIf::Init().

◆ SetFilterByCanId()

virtual Std_ReturnType Can::SetFilterByCanId ( ECU_CanController  Controller,
ComStack_CanIdType  FilterId 
)
inlinevirtual

configure a free hardware filter using single CAN Id filtering

set hardware filter

Parameters
[in]Controllerselect the controller where the filter should be applied
[in]FilterIdthe selected filter bits
Returns
E_OK if the filter is applied, E_NOT_OK no hardware filter free

Reimplemented in CanDrv_bxCAN.

Definition at line 387 of file Can.h.

References E_NOT_OK.

Referenced by CanIf::Init().

◆ Write()

virtual Std_ReturnType Can::Write ( ECU_CanController  Controller,
const ComStack_CanMessageType ptr2PduInfo 
)
inlinevirtual

The API to write a message to tx FIFO.

Parameters
[in]Controllerselect the controller for tx
[in]PduInfothe CAN message to send

Reimplemented in CanDrv_bxCAN.

Definition at line 355 of file Can.h.

References E_NOT_OK.

Referenced by CanIf::Transmit().


The documentation for this class was generated from the following files: