The hardware port is divided into general functions (IO-Link Port Definitions) and Master specific functions (IO-Link Master Port Definitions). All functions need to be available. For details what the port functions need to do, see the detailed description of the specific functions.
For a minimal working system, the functions of Physical Layer and Timer System need to be ported. The other functions can be left as they are in the port template.
The following functions belong to the physical layer and are used to access the IO-Link Phy chips:
If a Device frame is received, the following function has to be called:
The following functions belong to the timer system and need to be ported:
If a timer expires, the following function has to be called:
The following image shows how the Physical Layer and Timer System functions are called during the wake-up procedure.
The following image shows how the Physical Layer and Timer System functions are called during the cyclic operation. The position of IOLM_Port_PL_vTransferPrepare can differ, depending on the setting of IOLM_IRQ_PROCESSING. If this is enabled, the prepare is done with the timer interrupt during cycle start. If IRQ processing is disabled, it is done somewhere between Device receive and the start of the next cycle.
Here are some basic example code snippets to implement the Master board specific functions for a communication interface between the stack and the lower level IO-Link driver.
These functions handle the basic communication with the physical layer.
These callbacks are generated by the IO-Link driver to send the received events/data back to the stack.
These timer related functions need to be implemented.
If the IO-Link hardware implementation offers a physical frame handler, the stack calls this function and the driver implementation needs to send back the negotiated baud rate.
If the IO-Link hardware implementation offers a physical cycle timer, the stack calls this function to set it up.