Prosthetic Device Communication Protocol
|
For interface between hardware and software HAL-HLL interface was designed. Below described functions are responsible for data transmission between layers.
Function prefixe determines in which layer function was implemented.
- hal_set_module_mask_filters - set the mask and filter configuration of the CAN controller. Input parameters are:
id - Node Identifier Field, as defined by PDCP. mode - type of node (whether we are DEVICE or ABITRATOR)
- hal_msg_poll - shall retry fetching any incoming CAN messages left in the CAN controller by simulating an interrupt from the CAN controller.
- hll_msg_alloc - shall reserve unused memory in the high level layer for an incoming CAN message. This memory shall contain a can_msg structure, to which a pointer shall be returned to the caller. The caller must initialze the structure and send it back by calling hll_msg_commit.
- hll_msg_commit - shall invoke the high level layer's processing of the CAN message referenced by msg.
- hll_msg_get - shall look for an outgoing CAN message, and if found, return the contained can_msg structure. Otherwise, it shall return NULL. The caller must signify when it is finished with the pointed-to memory by calling hll_msg_free.
- hll_msg_free - shall mark the memory in use by the CAN message containing msg as unused.
Procedure of data transmission was presented in the picture below.