Port API.
Functions | |
IOL_FUNC_DECL void | IOLM_API_PL_vTransferInd (INT8U u8Port_p, INT8U u8DataLength_p, IOL_ETransferStatus eStatus_p) |
Data receive processing finished. More... | |
IOL_FUNC_DECL void | IOLM_API_vTimerExpired (INT8U u8Port_p) |
Port timer expired. More... | |
IOL_FUNC_DECL void | IOLM_API_PL_u8WakeAck (INT8U u8Port_p) |
Acknowledge wake-up. More... | |
IOL_FUNC_DECL void | IOLM_API_PL_vSwitchPortPower (INT8U u8Port_p, TBOOL boOn_p, INT16U u16WaitTimeMs_p) |
Switch port power L+ off or on. More... | |
IOL_FUNC_DECL void | IOLM_API_DS_vStoreComplete (INT8U u8Port_p, INT16U u16Length_p) |
None volatile store completed. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSetMode (INT8U u8Port_p, IOL_ETargetMode eTargetMode_p) |
Set physical layer mode. More... | |
IOL_FUNC_DECL IOLM_EWakeupMode | IOLM_Port_PL_eWakeUp (INT8U u8Port_p) |
Send wake-up pulse. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vTransferPrepare (INT8U u8Port_p, const INT8U *pu8Data_p, INT8U u8DataLength_p, INT8U *pu8ResponseData_p, INT8U u8ResponseLength_p) |
Prepare data exchange. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vTransferTrig (INT8U u8Port_p) |
Start frame transmission. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSetDO (INT8U u8Port_p, TBOOL boOutValue_p) |
Set output pin value. More... | |
IOL_FUNC_DECL TBOOL | IOLM_Port_PL_boGetDI (INT8U u8Port_p) |
Get input pin value. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSetIQ (INT8U u8Port_p, TBOOL boOutValue_p) |
Set IQ output pin value. More... | |
IOL_FUNC_DECL TBOOL | IOLM_Port_PL_boGetIQ (INT8U u8Port_p) |
Get IQ input pin value. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSetIQMode (INT8U u8Port_p, IOL_EIQMode eIQMode_p) |
Set IQ mode. More... | |
IOL_FUNC_DECL IOL_EBaudrate | IOLM_Port_PL_eSetFHCfg (INT8U u8Port_p, INT8U u8PdOut_p, INT8U u8PdIn_p, INT8U u8ODLen_p, INT8U u8IOLCycle_p) |
Frame handler setup. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSetPhyCycleTimer (INT8U u8Port_p, INT32U u32TimeUs_p) |
Cycle timer setup. More... | |
IOL_FUNC_DECL void | IOLM_Port_vStartTimer (INT8U u8Port_p, INT32U u32TimeUs_p) |
Start port hardware timer. More... | |
IOL_FUNC_DECL INT32S | IOLM_Port_s32SysTickVal (void) |
Get SysTick value. More... | |
IOL_FUNC_DECL void | IOLM_Port_vCriticalStart (void) |
Enter critical section. More... | |
IOL_FUNC_DECL void | IOLM_Port_vCriticalEnd (void) |
Enter critical section. More... | |
IOL_FUNC_DECL INT8U * | IOLM_Port_pu8MemAlloc (INT32U u32Length_p) |
Allocate memory callback. More... | |
IOL_FUNC_DECL void | IOLM_Port_vMemFree (INT8U *pu8Mem_p) |
Free memory callback. More... | |
IOL_FUNC_DECL void | IOLM_Port_DS_vStoreData (INT8U u8Port_p, INT8U *pu8Data_p, INT16U u16Length_p) |
Store DS content. More... | |
IOL_FUNC_DECL INT16U | IOLM_Port_DS_u16LoadData (INT8U u8Port_p, INT8U *pu8Data_p, INT16U u16Length_p) |
Load DS content. More... | |
IOL_FUNC_DECL void | IOLM_Port_PL_vSwitchPortPower (INT8U u8Port_p, TBOOL boOn_p) |
Switch port power on or off. More... | |
None volatile store completed.
This function has to be called if the operation requested by IOLM_Port_DS_vStoreData is completed. It triggers further store requests if available.
[in] | u8Port_p | The port number of the affected port. |
[in] | u16Length_p | Number of bytes written. |
IOL_FUNC_DECL void IOLM_API_PL_u8WakeAck | ( | INT8U | u8Port_p | ) |
Acknowledge wake-up.
This function indicates a finished wake-up pulse if wake-up mode is IOLM_eWakeupMode_Ack is used. It starts a timer and initiates the following procedure.
[in] | u8Port_p | The port number of the affected port. |
IOL_FUNC_DECL void IOLM_API_PL_vSwitchPortPower | ( | INT8U | u8Port_p, |
TBOOL | boOn_p, | ||
INT16U | u16WaitTimeMs_p | ||
) |
Switch port power L+ off or on.
This function switches port power L+. The minimum power down time for u16WaitTimeMs_p is 500ms. If boOn_p is false and u16WaitTimeMs_p >= 500 L+ is switched off and after the defined time u16WaitTimeMs_p switched on again. If boOn_p is false and u16WaitTimeMs_p < 500 L+ is switched off permanently.
If boOn_p is true L+ is switched on permanently regardless of u16WaitTimeMs_p.
[in] | u8Port_p | The port number of the affected port. |
[in] | boOn_p | TRUE for on, FALSE for off |
[in] | u16WaitTimeMs_p | Time in ms the port should stay off |
IOL_FUNC_DECL void IOLM_API_PL_vTransferInd | ( | INT8U | u8Port_p, |
INT8U | u8DataLength_p, | ||
IOL_ETransferStatus | eStatus_p | ||
) |
Data receive processing finished.
The PL Transfer Indication indicates a completed receive processing. The function expects the number of Device response bytes as requested by IOLM_Port_PL_vTransferPrepare. If the status is not IOL_eTransferStatus_OK or the length is invalid, the receive is failed and the retry procedure is triggered.
u8DataLength_p = 0xFF is interpreted as the expected length.
If IOLM_IRQ_PROCESSING is 0, the data is passed to Mainloop where it will be processed. If the value is 1, all time critical data is interpreted in this function.
[in] | u8Port_p | The port number of the affected port. |
[in] | u8DataLength_p | Number of received bytes. |
[in] | eStatus_p | Status information about the received Data. |
IOL_FUNC_DECL void IOLM_API_vTimerExpired | ( | INT8U | u8Port_p | ) |
Port timer expired.
The timer expired callback is used to signal that the timer started by IOLM_Port_vStartTimer is timed out. This triggers internal state machines and start transmission of the next frame.
If IOLM_IRQ_PROCESSING is 0, the Tx frame is prepared in Mainloop. If set to 1, the Tx frame is prepared in this function which leads to a longer runtime.
[in] | u8Port_p | The port number of the affected port. |
IOL_FUNC_DECL INT16U IOLM_Port_DS_u16LoadData | ( | INT8U | u8Port_p, |
INT8U * | pu8Data_p, | ||
INT16U | u16Length_p | ||
) |
Load DS content.
This function loads the Data Storage content of a specific port from a non volatile memory. This is a blocking function and only called during initialization. The return value is the content length. This should only be >0 if the data is valid.
[in] | u8Port_p | The port number of the affected port. |
[in] | pu8Data_p | Data area to load. |
[in] | u16Length_p | Length of data pointer. |
IOL_FUNC_DECL void IOLM_Port_DS_vStoreData | ( | INT8U | u8Port_p, |
INT8U * | pu8Data_p, | ||
INT16U | u16Length_p | ||
) |
Store DS content.
This function save the Data Storage content of a specific port in a non volatile memory. This function should not block for longer time (cyclic communication must be handled). After completion IOLM_API_DS_vStoreComplete has to be called.
[in] | u8Port_p | The port number of the affected port. |
[in] | pu8Data_p | Data to be stored. |
[in] | u16Length_p | Length of data. |
Get input pin value.
The PL get DI function is used if the port is in DI mode. It reads the input value from the corresponding port.
[in] | u8Port_p | The port number of the affected port. |
Get IQ input pin value.
The PL get IQ function reads the input value from IQ Pin (e.g. M12 Pin 2) of the corresponding port.
[in] | u8Port_p | The port number of the affected port. |
IOL_FUNC_DECL IOL_EBaudrate IOLM_Port_PL_eSetFHCfg | ( | INT8U | u8Port_p, |
INT8U | u8PdOut_p, | ||
INT8U | u8PdIn_p, | ||
INT8U | u8ODLen_p, | ||
INT8U | u8IOLCycle_p | ||
) |
Frame handler setup.
This function indicates a frame handler configuration change. The information can be used to configure a external Phy with this setup.
[in] | u8Port_p | The port number of the affected port. |
[in] | u8PdOut_p | Number of output bytes. |
[in] | u8PdIn_p | Number of input bytes. |
[in] | u8ODLen_p | OD length. |
[in] | u8IOLCycle_p | Cycle time in IO-Link notation. |
IOL_FUNC_DECL IOLM_EWakeupMode IOLM_Port_PL_eWakeUp | ( | INT8U | u8Port_p | ) |
Send wake-up pulse.
The PL-WakeUp service initiates a specific sequence which prepares the physical layer to send and receive communication requests (see 5.3.3.3). The function returns the wake-up mode of the Phy.
If IOLM_eWakeupMode_Done is returned, the wake-up pulse will be generated without further activity of the stack.
IOLM_eWakeupMode_Phy indicates a phy with frame handler. The stack needs only to trigger retries if communication can't be established or is lost.
IOLM_eWakeupMode_Stack is used, if the stack should generate the wake-up pulse using the timer and SIO interface.
IOLM_eWakeupMode_Ack is used when wake-up is done by application and later acknowledged by IOLM_API_PL_u8WakeAck.
[in] | u8Port_p | The port number of the affected port. |
Set output pin value.
The PL set DO function is used if the port is in DO Mode. It sets the output pin to the corresponding value.
[in] | u8Port_p | The port number of the affected port. |
[in] | boOutValue_p | Value of the output pin. |
Set IQ output pin value.
The PL set IQ function sets the IQ output pin (e.g. M12 Pin 2) to the corresponding value.
[in] | u8Port_p | The port number of the affected port. |
[in] | boOutValue_p | Value of the output pin. |
IOL_FUNC_DECL void IOLM_Port_PL_vSetIQMode | ( | INT8U | u8Port_p, |
IOL_EIQMode | eIQMode_p | ||
) |
Set IQ mode.
The PL set IQ mode function sets the mode for IQ pin (e.g. M12 Pin 2).
[in] | u8Port_p | The port number of the affected port. |
[in] | eIQMode_p | Value of IQ mode. |
IOL_FUNC_DECL void IOLM_Port_PL_vSetMode | ( | INT8U | u8Port_p, |
IOL_ETargetMode | eTargetMode_p | ||
) |
Set physical layer mode.
The PL-SetMode service is used to setup the electrical characteristics and configurations of the physical layer.
[in] | u8Port_p | The port number of the affected port. |
[in] | eTargetMode_p | Indicates the requested operational mode of the port. |
Cycle timer setup.
This function indicates a cycle timer configuration change. The information can be used to configure an external Phy cycle timer.
[in] | u8Port_p | The port number of the affected port. |
[in] | u32TimeUs_p | Cycle time in microseconds. |
Switch port power on or off.
This function is called to switch on/off L+.
[in] | u8Port_p | Port number. |
[in] | boOn_p | TRUE = switch on, FALSE = switch off. |
IOL_FUNC_DECL void IOLM_Port_PL_vTransferPrepare | ( | INT8U | u8Port_p, |
const INT8U * | pu8Data_p, | ||
INT8U | u8DataLength_p, | ||
INT8U * | pu8ResponseData_p, | ||
INT8U | u8ResponseLength_p | ||
) |
Prepare data exchange.
The PL-transfer service is used to exchange the SDCI data between data link layer and physical layer. The prepare function setups Tx/Rx (maybe with DMA). The transfer start follows later.
[in] | u8Port_p | The port number of the affected port. |
[in] | pu8Data_p | Contains the data value which is transferred over the SDCI interface. |
[in] | u8DataLength_p | The size of the data in byte. |
[in] | pu8ResponseData_p | Memory for the response data. |
[in] | u8ResponseLength_p | The size of the expected response data in byte. |
IOL_FUNC_DECL void IOLM_Port_PL_vTransferTrig | ( | INT8U | u8Port_p | ) |
Start frame transmission.
The PL-transfer service triggers the transmission of the prepared frame. If all expected bytes are received or an error happens, the function IOLM_API_PL_vTransferInd has to be called.
[in] | u8Port_p | The port number of the affected port. |
Allocate memory callback.
This callback is called by the stack to allocate memory resources.
[in] | u32Length_p | Length of ArgBlock. |
IOL_FUNC_DECL INT32S IOLM_Port_s32SysTickVal | ( | void | ) |
Get SysTick value.
This function is used to read the SysTick counter value. The tick rate of this counter should be IOLM_SYSTICK_INTERVAL_MS milliseconds.
IOL_FUNC_DECL void IOLM_Port_vCriticalEnd | ( | void | ) |
Enter critical section.
This function is called before call of critical sections and need to disable interrupts
IOL_FUNC_DECL void IOLM_Port_vCriticalStart | ( | void | ) |
Enter critical section.
This function is called before call of critical sections and need to disable interrupts
IOL_FUNC_DECL void IOLM_Port_vMemFree | ( | INT8U * | pu8Mem_p | ) |
Free memory callback.
This callback is called by the stack to free the resources for an ArgBlock. Since this is hardware specific, it has to be implemented in the application code.
[in] | pu8Mem_p | Data pointer to the memory location. |
Start port hardware timer.
The start timer function is used to start a hardware timer for the specified port. After expiration the IOLM_API_vTimerExpired callback has to be called. If there is no phy cycle timer present this handles all hardware timers.
[in] | u8Port_p | The port number of the affected port. |
[in] | u32TimeUs_p | Timeout in microseconds. |