AM64x INDUSTRIAL COMMUNICATIONS SDK  2026.00.00
iolfw.h File Reference

Introduction

IO-Link Master Firmware Hardware Abstraction Layer (FWHAL) API.

This header provides the public API for the IO-Link Master FWHAL module, which abstracts the PRU-ICSS firmware for IO-Link communication.

Copyright (C) 2026 Texas Instruments Incorporated

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the name of Texas Instruments Incorporated nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Go to the source code of this file.

Data Structures

struct  IOLFW_PortInst_t
 IO-Link port instance data. More...
 
struct  IOLFW_Inst_t
 IOLFW instance handle. More...
 
struct  IOLFW_GpioConfig_t
 GPIO pin configuration. More...
 
struct  IOLFW_GpioPruConfig_t
 GPIO configuration with PRU pin mapping. More...
 
struct  IOLFW_GpioEnConfig_t
 GPIO enable configuration with PRU direct access. More...
 
struct  IOLFW_PortConfig_t
 IO-Link port hardware configuration. More...
 
struct  IOLFW_Config_t
 IOLFW initialization configuration. More...
 
struct  IOLFW_PlCallbacks_t
 Physical Layer (PL) callbacks. More...
 
struct  IOLFW_SpCallbacks_t
 Stack Porting Layer (SP) callbacks. More...
 

Macros

#define IOLFW_TA_BIT_DEFAULT   (11)
 
#define IOLFW_MAX_PD_SIZE   (32)
 
#define IOLFW_MAX_OD_SIZE   (32)
 
#define IOLFW_TR_DEF   (3)
 
#define IOLFW_MAX_RESPONSE_TIME   (85U)
 
#define IOLFW_STRUCT_PACKED   __attribute__((__packed__))
 
#define IOLFW_ERR_SUCCESS   (0)
 
#define IOLFW_ERR_BASE_CODE   (-150)
 
#define IOLFW_ERR_PRECONFIG   (IOLFW_ERR_BASE_CODE - 1)
 
#define IOLFW_ERR_EMPTY_ARG   (IOLFW_ERR_BASE_CODE - 2)
 
#define IOLFW_ERR_INST_INVALID   (IOLFW_ERR_BASE_CODE - 4)
 
#define IOLFW_ERR_INST_ALL_USED   (IOLFW_ERR_BASE_CODE - 5)
 
#define IOLFW_ERR_CB_PORT_CFG   (IOLFW_ERR_BASE_CODE - 6)
 
#define IOLFW_ERR_CB_SET_MODE   (IOLFW_ERR_BASE_CODE - 7)
 
#define IOLFW_ERR_CB_RX_ERR_EVT   (IOLFW_ERR_BASE_CODE - 9)
 
#define IOLFW_ERR_CB_TR_IND   (IOLFW_ERR_BASE_CODE - 10)
 
#define IOLFW_ERR_CB_START_COMP   (IOLFW_ERR_BASE_CODE - 11)
 
#define IOLFW_ERR_PRU_CLOCK   (IOLFW_ERR_BASE_CODE - 12)
 
#define IOLFW_ERR_IEP_CLOCK   (IOLFW_ERR_BASE_CODE - 13)
 
#define IOLFW_ERR_VAL_OUT_OF_RANGE   (IOLFW_ERR_BASE_CODE - 14)
 
#define IOLFW_ERR_NULL_PTR   (IOLFW_ERR_BASE_CODE - 15)
 
#define IOLFW_ERR_PORT_OUT_OF_RANGE   (IOLFW_ERR_BASE_CODE - 16)
 
#define IOLFW_ERR_INVALID_CYCLE_TIME   (IOLFW_ERR_BASE_CODE - 17)
 
#define IOLFW_MAX_INST   (1)
 
#define IOLFW_MAX_PORTS   (8)
 

Typedefs

typedef struct IOLFW_PruMem IOLFW_PruMem_t
 
typedef struct IOLFW_PruMemTimer IOLFW_PruMemTimer_t
 
typedef void(* IOLFW_cbSetMode_t) (IOLFW_Inst_t *pFwInstance, uint8_t portNum, IOLFW_ePortMode_t mode)
 Port mode change callback. More...
 
typedef const IOLFW_PortConfig_t *(* IOLFW_cbGetPortCfg_t) (IOLFW_Inst_t *pFwInstance, uint8_t portNum)
 Get port configuration callback. More...
 
typedef void(* IOLFW_cbRxErrEvent_t) (IOLFW_Inst_t *pFwInstance, uint8_t port, IOLFW_eRxErrorEvents_t rxErr)
 RX error event callback. More...
 
typedef void(* IOLFW_cbTransferInd_t) (IOLFW_Inst_t *pFwInstance, uint8_t port, uint8_t dataLen, IOLFW_eTransferStatus_t eTrStatus)
 Transfer indication callback. More...
 
typedef void(* IOLFW_cbStartupCmpl_t) (IOLFW_Inst_t *pFwInstance, uint8_t port, IOLFW_eStartupStatus_t eStrStatus)
 Startup/wake-up completion callback. More...
 
typedef IOLFW_Inst_t *(* IOLFW_cbGetInstCont_t) (uint8_t inst_p)
 Get instance container callback. More...
 

Enumerations

enum  IOLFW_ePortMode_t {
  IOLFW_ePortMode_SioInactive = 0, IOLFW_ePortMode_Sdci, IOLFW_ePortMode_SioDI, IOLFW_ePortMode_SioDO,
  IOLFW_ePortMode_Force32Bit = 0x7fffffff
}
 IO-Link port operating mode. More...
 
enum  IOLFW_eInstanceState_t { IOLFW_eInstanceState_NotInitialized = 0, IOLFW_eInstanceState_Init, IOLFW_eInstanceState_Running }
 IOLFW instance state. More...
 
enum  IOLFW_eBaudrate_t { IOLFW_eBaudrate_Auto = 0, IOLFW_eBaudrate_Com1, IOLFW_eBaudrate_Com2, IOLFW_eBaudrate_Com3 }
 IO-Link transmission rate (baud rate) More...
 
enum  IOLFW_eRxErrorEvents_t { IOLFW_eRxErrorEvents_Rxol = 0 }
 RX error event types. More...
 
enum  IOLFW_eTransferStatus_t { IOLFW_eTransferStatus_Ok = 0, IOLFW_eTransferStatus_ParityError, IOLFW_eTransferStatus_FramingError, IOLFW_eTransferStatus_Overrun }
 Data transfer status codes. More...
 
enum  IOLFW_eStartupStatus_t { IOLFW_eStartupStatus_Ok = 0, IOLFW_eStartupStatus_NoResponse }
 Port startup/wake-up status codes. More...
 

Functions

Callback Registration Functions
void IOLFW_registerSetModeCallback (IOLFW_cbSetMode_t pCallback)
 Register port mode change callback. More...
 
void IOLFW_registerGetPortCfgCallback (IOLFW_cbGetPortCfg_t pCallback)
 Register port configuration callback. More...
 
void IOLFW_registerRxErrEventCallback (IOLFW_cbRxErrEvent_t pCallback)
 Register RX error event callback. More...
 
void IOLFW_registerTransferIndCallback (IOLFW_cbTransferInd_t pCallback)
 Register transfer indication callback. More...
 
void IOLFW_registerStartupCmplCallback (IOLFW_cbStartupCmpl_t pCallback)
 Register startup completion callback. More...
 
Initialization Functions
int32_t IOLFW_init (IOLFW_Inst_t **pFwInstance, IOLFW_Config_t *pConfig)
 Initialize IOLFW instance. More...
 
int32_t IOLFW_deInit (IOLFW_Inst_t *pFwInstance)
 De-initialize IOLFW instance. More...
 
Port Operations
int32_t IOLFW_setPortMode (IOLFW_Inst_t *pFwInstance, uint8_t port, IOLFW_ePortMode_t eTargetMode)
 Set port operating mode. More...
 
IOLFW_eBaudrate_t IOLFW_getBaudRate (IOLFW_Inst_t *pFwInstance, uint8_t port)
 Get current baud rate of port. More...
 
int32_t IOLFW_wakeUp (IOLFW_Inst_t *pFwInstance, uint8_t port)
 Initiate IO-Link wake-up sequence. More...
 
int32_t IOLFW_transferPrepare (IOLFW_Inst_t *pFwInstance, uint8_t port, uint8_t *pData, uint8_t dataLength, uint8_t *pResponseData, uint8_t responseLength)
 Prepare data transfer. More...
 
Cycle Timer Functions
int32_t IOLFW_setMaxRespTime (IOLFW_Inst_t *pFwInstance, uint8_t port, uint8_t taRespTime)
 Set maximum response time. More...
 
int32_t IOLFW_resetCycleTime (IOLFW_Inst_t *pFwInstance, uint8_t port)
 Reset cycle timer counter. More...
 
int32_t IOLFW_setCycleTime (IOLFW_Inst_t *pFwInstance, uint8_t port, uint32_t timeUs)
 Set cycle time. More...
 
int32_t IOLFW_enableCycleTimer (IOLFW_Inst_t *pFwInstance, uint8_t port, bool enable)
 Enable or disable cycle timer. More...
 
int32_t IOLFW_configCycleTime (IOLFW_Inst_t *pFwInstance, uint8_t port, uint32_t timeUs)
 Configure and enable cycle time. More...