STM32Cube Expansion Pack CAN Stack
|
Functions used in the API. More...
Macros | |
#define | CANIF_INIT_ID (0x01) |
service ID of CanIf::Init() | |
Functions | |
Std_ReturnType | CanIf::Init (void) |
init of the CanIf module More... | |
Std_ReturnType | CanIf::Start (void) |
all init of the CanIf module is done More... | |
Std_ReturnType | CanIf::Transmit (CanIf_TxPduIdType txPduId, const CanIf_PduInfoType *ptr2PduInfo) |
Requests transmission of a PDU using the Tx software Buffer. More... | |
Std_ReturnType | CanIf::Transmit (ComStack_PduType txPduId, const ComStack_PduInfoType *ptr2PduInfo) |
Requests transmission of a PDU using the Tx software Buffer. More... | |
Std_ReturnType | CanIf::Transmit (ComStack_CanMsgHeader msgHeader, const uint8_t *ptr2Data) |
Requests transmission of a PDU using the Tx software Buffer. More... | |
Std_ReturnType | CanIf::Receive (CanIf_RxPduIdType rxPduId, const CanIf_PduInfoType *ptr2PduInfo) |
poll the RxBuffer for a message More... | |
Std_ReturnType | CanIf::Receive (ComStack_PduType rxPduId, const ComStack_PduInfoType *ptr2PduInfo) |
poll the RxBuffer for a message More... | |
Std_ReturnType | CanIf::Receive (REF2VAR(ComStack_CanMsgHeader, AUTOMATIC) msgHeader, const uint8_t *ptr2Data) |
poll the RxBuffer for a message More... | |
Std_ReturnType | CanIf::ConnectUpperLayerIndication (ComStack_PduType rxPduId, const CanIfUpperLayer *p2UpperLayerObject) |
we need to know the connected upper layer object for rx indication More... | |
ComStack_PduType | CanIf::GetIfRxPduName (CanIf_UpperLayerType upperLayerName, ComStack_PduType rxPduId) |
to get the CanIf_RxPduIdType name | |
ComStack_PduType | CanIf::GetIfTxPduName (CanIf_UpperLayerType upperLayerName, ComStack_PduType txPduId) |
to get the CanIf_TxPduIdType name | |
Functions used in the API.
|
virtual |
we need to know the connected upper layer object for rx indication
maybe we solve this in a static way on code generation later
[in] | rxPduId | to name the rx pdu |
[in] | p2UpperLayerObject | to give the pointer to the object |
Implements ComIf.
Definition at line 320 of file CanIf.cpp.
References E_NOT_OK, E_OK, NULL_PTR, and CanIf::p2UpperLayerList.
Std_ReturnType CanIf::Init | ( | void | ) |
init of the CanIf module
This will start the hardware modules
try to setup HW filter
try to setup HW filter
Definition at line 83 of file CanIf.cpp.
References CANIF_DET_REPORTERROR, CANIF_EXTID, CANIF_INIT_ID, CS_Started, E_INIT_FAILED, E_NOT_OK, E_OK, E_SETUP_FAILED, HwInit, Can::Init(), NULL_PTR, CanIf::ptr2CanDriver, Can::SetControllerMode(), Can::SetFilterByBitmask(), Can::SetFilterByCanId(), CanIf::state, and CanIf::txHeaderList.
Std_ReturnType CanIf::Receive | ( | CanIf_RxPduIdType | rxPduId, |
const CanIf_PduInfoType * | ptr2PduInfo | ||
) |
poll the RxBuffer for a message
This function looks if there is an message inside the buffer by checking the PDU name
This is the AUTOSAR like function CanIf_ReadRxPduData
[in] | rxPduId | search for the PDU by using the CanIf_RxPduIdType |
[out] | ptr2PduInfo | to return the data |
Definition at line 275 of file CanIf.cpp.
References E_NOT_OK.
Referenced by CanIf::Receive().
|
virtual |
poll the RxBuffer for a message
This function remaps the pure virtual function coming from the ComIf class
This is the AUTOSAR like function CanIf_ReadRxPduData
[in] | rxPduId | search for the PDU by using the CanIf_RxPduIdType |
[out] | ptr2PduInfo | to return the data |
Implements ComIf.
Definition at line 251 of file CanIf.cpp.
References CanIf::Receive().
Std_ReturnType CanIf::Receive | ( | REF2VAR(ComStack_CanMsgHeader, AUTOMATIC) | msgHeader, |
const uint8_t * | ptr2Data | ||
) |
poll the RxBuffer for a message
This function looks if there is an message inside the buffer with the requested CAN ID (including IDE & RTR)
[in,out] | msgHeader | we need the CanId to look for the message |
[out] | ptr2Data | pointer to return the data -> we need a C++ save way |
Definition at line 260 of file CanIf.cpp.
References E_NOT_OK.
Std_ReturnType CanIf::Start | ( | void | ) |
Std_ReturnType CanIf::Transmit | ( | CanIf_TxPduIdType | txPduId, |
const CanIf_PduInfoType * | ptr2PduInfo | ||
) |
Requests transmission of a PDU using the Tx software Buffer.
returns E_NOT_OK if SW buffer full
this function is the AUTOSAR like transmit function
[in] | txPduId | name the Pdu to transmit |
[in] | ptr2PduInfo | pointer to the data to transmit |
Definition at line 210 of file CanIf.cpp.
References ComStack_CanMsgHeader::CanId, ComStack_CanMessageType::CanMsgHeader, ComStack_CanMsgHeader::DLC, E_NOT_OK, CanIf::ptr2CanDriver, ComStack_CanMessageType::ptr2Data, Ready, CanIf::state, and Can::Write().
Referenced by CanIf::Transmit(), and CanFT2p0::TxIndication().
Std_ReturnType CanIf::Transmit | ( | ComStack_CanMsgHeader | msgHeader, |
const uint8_t * | ptr2Data | ||
) |
Requests transmission of a PDU using the Tx software Buffer.
this function is we send messages without a transport protocol, maybe for test messages
returns E_NOT_OK if SW buffer full
[in] | msgHeader | Header for the CAN message handling |
[in] | ptr2Data | pointer to the data to transmit |
Definition at line 196 of file CanIf.cpp.
References E_NOT_OK, CanIf::ptr2CanDriver, Ready, CanIf::state, and Can::Write().
|
virtual |
Requests transmission of a PDU using the Tx software Buffer.
returns E_NOT_OK if SW buffer full
This function remaps the pure virtual function coming from the ComIf class
[in] | txPduId | name the Pdu to transmit |
[in] | ptr2PduInfo | pointer to the data to transmit |
Implements ComIf.
Definition at line 188 of file CanIf.cpp.
References CanIf::Transmit().