Files | |
| file | lldtsync.h |
| TI Timesync Low Level Driver abstract APIs. | |
| file | lldtype.h |
| Data types and macros for TI Enet LLD abstract APIs. | |
| file | lldenet.h |
| TI Ethernet Low Level Driver abstract APIs. | |
Data Structures | |
| struct | LLDTSyncCfg_t |
| Configuration structure for LLDTSync. More... | |
| struct | LLDEnetCfg_t |
| Configuration structure for LLDEnet. More... | |
| struct | LLDEnetFrame_t |
| Structure representing an Ethernet frame. More... | |
Functions | |
| void | LLDTSyncCfgInit (LLDTSyncCfg_t *cfg) |
| Initializes the LLDTSyncCfg_t configuration structure. More... | |
| LLDTSync_t * | LLDTSyncOpen (LLDTSyncCfg_t *cfg) |
| Opens a new LLDTSync instance to access the PTP clock. More... | |
| void | LLDTSyncClose (LLDTSync_t *hTSync) |
| Closes the LLDTSync instance. More... | |
| int | LLDTSyncGetRxTime (LLDTSync_t *hTSync, uint8_t rxPort, int msgType, uint16_t seqId, uint8_t domain, uint64_t *ts) |
| Retrieves the PTP RX timestamp for a specific message. More... | |
| int | LLDTSyncGetTxTime (LLDTSync_t *hTSync, uint8_t txPort, int msgType, uint16_t seqId, uint8_t domain, uint64_t *ts) |
| Retrieves the PTP TX timestamp for a specific message. More... | |
| int | LLDTSyncAdjFreq (LLDTSync_t *hTSync, int ppb) |
| Adjusts the frequency of the PTP clock. More... | |
| int | LLDTSyncSetTime (LLDTSync_t *hTSync, uint64_t ts) |
| Sets the time for the PTP clock. More... | |
| int | LLDTSyncGetTime (LLDTSync_t *hTSync, uint64_t *ts) |
| Retrieves the current time from the PTP clock. More... | |
| int | LLDTSyncEnableTsEvent (LLDTSync_t *hTSync, uint32_t ports[], uint32_t numPorts) |
| Enables PTP timestamp events for specified ports. More... | |
| void | LLDEnetCfgInit (LLDEnetCfg_t *cfg) |
| Initializes the LLDEnetCfg_t structure. More... | |
| LLDEnet_t * | LLDEnetOpen (LLDEnetCfg_t *cfg) |
| Opens an instance of LLDEnet. More... | |
| void | LLDEnetClose (LLDEnet_t *hLLDEnet) |
| Closes an instance of LLDEnet. More... | |
| int | LLDEnetFilter (LLDEnet_t *hLLDEnet, uint8_t *dstMacAddr, uint32_t vlanId) |
| Filter RX packets by using the destination MAC address and VLAN ID. More... | |
| int | LLDEnetAllocMac (LLDEnet_t *hLLDEnet, uint8_t *srcMacAddr) |
| Allocates a source MAC address. More... | |
| void | LLDEnetFreeMac (LLDEnet_t *hLLDEnet, uint8_t *srcMacAddr) |
| Frees a previously allocated MAC address. More... | |
| int | LLDEnetSend (LLDEnet_t *hLLDEnet, LLDEnetFrame_t *frame) |
| Sends an Ethernet frame using LLDEnet. More... | |
| int | LLDEnetSendMulti (LLDEnet_t *hLLDEnet, LLDEnetFrame_t *frames, uint32_t nFrames) |
| Sends multiple Ethernet frames using LLDEnet. More... | |
| int | LLDEnetRecv (LLDEnet_t *hLLDEnet, LLDEnetFrame_t *frame) |
| Receives an Ethernet frame using LLDEnet. More... | |
| bool | LLDEnetIsPortUp (LLDEnet_t *hLLDEnet, uint8_t portNum) |
| Checks if the specified port is up. More... | |
| int | LLDEnetGetLinkInfo (LLDEnet_t *hLLDEnet, uint8_t portNum, uint32_t *speed, uint32_t *duplex) |
| Retrieves the link speed and duplex information for the specified port. More... | |
| int | LLDEnetSetTxNotifyCb (LLDEnet_t *hLLDEnet, void(*txNotifyCb)(void *arg), void *arg) |
| Sets the transmit notification callback function for LLDEnet. More... | |
| int | LLDEnetSetRxNotifyCb (LLDEnet_t *hLLDEnet, void(*rxNotifyCb)(void *arg), void *arg) |
| Sets the receive notification callback function for LLDEnet. More... | |
| int | LLDEnetTasSetConfig (LLDEnet_t *hLLDEnet, uint8_t macPort, void *arg) |
| Set parameters for schedule traffic. More... | |
| int | LLDEnetIETSetConfig (LLDEnet_t *hLLDEnet, uint8_t macPort, void *reqPrm, void *resPrm) |
Set frame preemption parameters for the port indicated by macPort. More... | |
Typedefs | |
| typedef struct LLDTSync | LLDTSync_t |
| Structure representing the LLDTSync instance. More... | |
| typedef struct LLDEnet | LLDEnet_t |
| Structure representing the LLDEnet instance. More... | |
Macros | |
| #define | LLDENET_E_OK (0) |
| #define | LLDENET_E_PARAM (-1) |
| #define | LLDENET_E_NOBUF (-2) |
| #define | LLDENET_E_BUFSIZE (-3) |
| #define | LLDENET_E_NOAVAIL (-4) |
| #define | LLDENET_E_DMA (-5) |
| #define | LLDENET_E_IOCTL (-6) |
| #define | LLDENET_MAX_PORTS 10 |
| #define LLDENET_E_OK (0) |
no error
| #define LLDENET_E_PARAM (-1) |
param invalid
| #define LLDENET_E_NOBUF (-2) |
no buffer
| #define LLDENET_E_BUFSIZE (-3) |
small or invalid bufsize
| #define LLDENET_E_NOAVAIL (-4) |
request for a not available resource
| #define LLDENET_E_DMA (-5) |
dma error
| #define LLDENET_E_IOCTL (-6) |
enet ioctl error
| #define LLDENET_MAX_PORTS 10 |
Maximum number of ports supported by the Enet LLD abstract layer
| typedef struct LLDTSync LLDTSync_t |
Structure representing the LLDTSync instance.
| typedef struct LLDEnet LLDEnet_t |
Structure representing the LLDEnet instance.
| void LLDTSyncCfgInit | ( | LLDTSyncCfg_t * | cfg | ) |
Initializes the LLDTSyncCfg_t configuration structure.
| cfg | Pointer to the LLDTSyncCfg_t configuration structure. |
| LLDTSync_t* LLDTSyncOpen | ( | LLDTSyncCfg_t * | cfg | ) |
Opens a new LLDTSync instance to access the PTP clock.
| cfg | Pointer to the LLDTSyncCfg_t configuration structure. |
| void LLDTSyncClose | ( | LLDTSync_t * | hTSync | ) |
Closes the LLDTSync instance.
| hTSync | Pointer to the LLDTSync instance. |
| int LLDTSyncGetRxTime | ( | LLDTSync_t * | hTSync, |
| uint8_t | rxPort, | ||
| int | msgType, | ||
| uint16_t | seqId, | ||
| uint8_t | domain, | ||
| uint64_t * | ts | ||
| ) |
Retrieves the PTP RX timestamp for a specific message.
| hTSync | Pointer to the LLDTSync instance. |
| rxPort | Receive port. |
| msgType | Message type. |
| seqId | Sequence ID. |
| domain | Domain number. |
| ts | Pointer to store the PTP RX timestamp. |
| int LLDTSyncGetTxTime | ( | LLDTSync_t * | hTSync, |
| uint8_t | txPort, | ||
| int | msgType, | ||
| uint16_t | seqId, | ||
| uint8_t | domain, | ||
| uint64_t * | ts | ||
| ) |
Retrieves the PTP TX timestamp for a specific message.
| hTSync | Pointer to the LLDTSync instance. |
| txPort | Transmit port. |
| msgType | Message type. |
| seqId | Sequence ID. |
| domain | Domain number. |
| ts | Pointer to store the PTP TX timestamp. |
| int LLDTSyncAdjFreq | ( | LLDTSync_t * | hTSync, |
| int | ppb | ||
| ) |
Adjusts the frequency of the PTP clock.
| hTSync | Pointer to the LLDTSync instance. |
| ppb | Parts per billion adjustment value. |
| int LLDTSyncSetTime | ( | LLDTSync_t * | hTSync, |
| uint64_t | ts | ||
| ) |
Sets the time for the PTP clock.
| hTSync | Pointer to the LLDTSync instance. |
| ts | Time to set. |
| int LLDTSyncGetTime | ( | LLDTSync_t * | hTSync, |
| uint64_t * | ts | ||
| ) |
Retrieves the current time from the PTP clock.
| hTSync | Pointer to the LLDTSync instance. |
| ts | Pointer to store the current time. |
| int LLDTSyncEnableTsEvent | ( | LLDTSync_t * | hTSync, |
| uint32_t | ports[], | ||
| uint32_t | numPorts | ||
| ) |
Enables PTP timestamp events for specified ports.
| hTSync | Pointer to the LLDTSync instance. |
| ports | Array of ports to enable timestamp events for. |
| numPorts | Number of ports in the array. |
| void LLDEnetCfgInit | ( | LLDEnetCfg_t * | cfg | ) |
Initializes the LLDEnetCfg_t structure.
| cfg | Pointer to the LLDEnetCfg_t structure to be initialized. |
| LLDEnet_t* LLDEnetOpen | ( | LLDEnetCfg_t * | cfg | ) |
Opens an instance of LLDEnet.
| cfg | Pointer to the LLDEnetCfg_t structure containing the configuration parameters. |
| void LLDEnetClose | ( | LLDEnet_t * | hLLDEnet | ) |
Closes an instance of LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| int LLDEnetFilter | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t * | dstMacAddr, | ||
| uint32_t | vlanId | ||
| ) |
Filter RX packets by using the destination MAC address and VLAN ID.
| hLLDEnet | Pointer to the LLDEnet instance. |
| dstMacAddr | Destination MAC address to filter. |
| vlanId | VLAN ID to filter. |
| int LLDEnetAllocMac | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t * | srcMacAddr | ||
| ) |
Allocates a source MAC address.
| hLLDEnet | Pointer to the LLDEnet instance. |
| srcMacAddr | Pointer to store the allocated MAC address. |
| void LLDEnetFreeMac | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t * | srcMacAddr | ||
| ) |
Frees a previously allocated MAC address.
| hLLDEnet | Pointer to the LLDEnet instance. |
| srcMacAddr | MAC address to be freed. |
| int LLDEnetSend | ( | LLDEnet_t * | hLLDEnet, |
| LLDEnetFrame_t * | frame | ||
| ) |
Sends an Ethernet frame using LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| frame | Pointer to the LLDEnetFrame_t structure representing the frame to be sent. |
| int LLDEnetSendMulti | ( | LLDEnet_t * | hLLDEnet, |
| LLDEnetFrame_t * | frames, | ||
| uint32_t | nFrames | ||
| ) |
Sends multiple Ethernet frames using LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| frames | Array of LLDEnetFrame_t structures representing the frames to be sent. |
| nFrames | Number of frames in the array. |
| int LLDEnetRecv | ( | LLDEnet_t * | hLLDEnet, |
| LLDEnetFrame_t * | frame | ||
| ) |
Receives an Ethernet frame using LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| frame | Pointer to the LLDEnetFrame_t structure to store the received frame. |
| bool LLDEnetIsPortUp | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t | portNum | ||
| ) |
Checks if the specified port is up.
| hLLDEnet | Pointer to the LLDEnet instance. |
| portNum | Port number to check. |
| int LLDEnetGetLinkInfo | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t | portNum, | ||
| uint32_t * | speed, | ||
| uint32_t * | duplex | ||
| ) |
Retrieves the link speed and duplex information for the specified port.
| hLLDEnet | Pointer to the LLDEnet instance. |
| portNum | Port number to retrieve the link information. |
| speed | Pointer to store the link speed. |
| duplex | Pointer to store the link duplex mode. |
| int LLDEnetSetTxNotifyCb | ( | LLDEnet_t * | hLLDEnet, |
| void(*)(void *arg) | txNotifyCb, | ||
| void * | arg | ||
| ) |
Sets the transmit notification callback function for LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| txNotifyCb | Pointer to the transmit notification callback function. |
| arg | Argument to be passed to the callback function. |
| int LLDEnetSetRxNotifyCb | ( | LLDEnet_t * | hLLDEnet, |
| void(*)(void *arg) | rxNotifyCb, | ||
| void * | arg | ||
| ) |
Sets the receive notification callback function for LLDEnet.
| hLLDEnet | Pointer to the LLDEnet instance. |
| rxNotifyCb | Pointer to the receive notification callback function. |
| arg | Argument to be passed to the callback function. |
| int LLDEnetTasSetConfig | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t | macPort, | ||
| void * | arg | ||
| ) |
Set parameters for schedule traffic.
| hLLDEnet | Pointer to the LLDEnet instance. |
| macPort | port number of the MAC port to be configured with TAS parameters. |
| arg | input argument to be configured. The caller shall pass an object of cbl_tas_sched_params_t via this argument. |
| int LLDEnetIETSetConfig | ( | LLDEnet_t * | hLLDEnet, |
| uint8_t | macPort, | ||
| void * | reqPrm, | ||
| void * | resPrm | ||
| ) |
Set frame preemption parameters for the port indicated by macPort.
| hLLDEnet | Pointer to the LLDEnet instance. |
| macPort | port number of the MAC port to be configured with TAS parameters. |
| reqPrm | input argument to be configured. The caller shall pass an object of cbl_preempt_params_t via this argument. |
| resPrm | response parameters will be stored in this object. The caller shall pass address of an object cbl_cb_event_t to this API. |