![]() |
Block diagram of message sending in HAL in relation to HLL was presented in the figure below.
hll_msg_get() hll_msg_get"()" wdtDisable"()" wdtDisable"("void")" Procedure of message sending is triggered from HLL level, because lower layers does not send any messages itself.
If HLL has any message to send after internal computations described in section "HLL aspects", it calls function hal_msg_take"()" which call function triggerSoftwareInterrupt() with an argument TRIGGER_SENDING. This function triggers external interrupt treated as software interrupt by changing one of the microcontroller pins.
Afterwards, callback from hll_msg_get() function is made to return pointer to message structure, which should be sent. HLL checks priority of arbitration field of returned message and basing on transmitting CAN controller register priorities calls function sendCanMsg() with appropriate arguments. Within sendCanMsg() function structure is decoded and all message parameters like ID, message length and data are sent to CAN controller. After data transfer pointer to structure should be freed - this is executed by function hll_msg_free() with the pointer as the argument.
Should be filled by AN.