HPM SDK
HPMicro Software Development Kit
hpm_jl1111.h File Reference

JL1111 TSW PHY driver header file. More...

#include "hpm_tsw_phy.h"
#include "hpm_common.h"
#include "hpm_tsw_regs.h"

Go to the source code of this file.

Data Structures

struct  jl1111_config_t
 JL1111 PHY configuration structure. More...
 

Macros

#define JL1111_ADDR   (0U)
 Default PHY address for JL1111. More...
 
#define JL1111_ID1   (0x937CU)
 JL1111 PHY ID register 1 value (OUI MSB) More...
 
#define JL1111_ID2   (0x10U)
 JL1111 PHY ID register 2 value (OUI LSB) More...
 

Functions

void jl1111_reset (TSW_Type *ptr, uint8_t port)
 Reset JL1111 PHY chip. More...
 
void jl1111_basic_mode_default_config (TSW_Type *ptr, jl1111_config_t *config)
 Set default configuration for JL1111 PHY basic mode. More...
 
bool jl1111_basic_mode_init (TSW_Type *ptr, uint8_t port, jl1111_config_t *config)
 Initialize JL1111 PHY chip in basic mode. More...
 
void jl1111_get_phy_status (TSW_Type *ptr, uint8_t port, tsw_phy_status_t *status)
 Get JL1111 PHY status. More...
 

Detailed Description

JL1111 TSW PHY driver header file.

This file provides the API definitions for the JL1111 TSW PHY chip driver. The JL1111 is a single-port 10/100-Mbps Ethernet physical layer transceiver for Time-Sensitive Networking (TSW) applications.

Macro Definition Documentation

◆ JL1111_ADDR

#define JL1111_ADDR   (0U)

Default PHY address for JL1111.

◆ JL1111_ID1

#define JL1111_ID1   (0x937CU)

JL1111 PHY ID register 1 value (OUI MSB)

◆ JL1111_ID2

#define JL1111_ID2   (0x10U)

JL1111 PHY ID register 2 value (OUI LSB)

Function Documentation

◆ jl1111_basic_mode_default_config()

void jl1111_basic_mode_default_config ( TSW_Type ptr,
jl1111_config_t config 
)

Set default configuration for JL1111 PHY basic mode.

Parameters
[in]ptrPointer to the TSW peripheral base address
[out]configPointer to the configuration structure to be initialized

This function initializes the configuration structure with default values:

  • Loopback: disabled
  • Auto-negotiation: enabled (unless __DISABLE_AUTO_NEGO is defined)
  • Speed: 100 Mbps (when auto-negotiation is disabled)
  • Duplex: full duplex (when auto-negotiation is disabled)

◆ jl1111_basic_mode_init()

bool jl1111_basic_mode_init ( TSW_Type ptr,
uint8_t  port,
jl1111_config_t config 
)

Initialize JL1111 PHY chip in basic mode.

Parameters
[in]ptrPointer to the TSW peripheral base address
[in]portPort number
[in]configPointer to the PHY configuration structure
Return values
trueInitialization completed successfully
falseInitialization failed (PHY ID check failed)

This function performs the following operations:

  • Verifies the PHY ID to ensure it's a JL1111 chip
  • Configures the PHY according to the provided configuration
  • Sets up loopback mode, auto-negotiation, speed, and duplex settings

◆ jl1111_get_phy_status()

void jl1111_get_phy_status ( TSW_Type ptr,
uint8_t  port,
tsw_phy_status_t status 
)

Get JL1111 PHY status.

Parameters
[in]ptrPointer to the TSW peripheral base address
[in]portPort number
[out]statusPointer to the status structure to store PHY status

This function reads the PHY status register and extracts:

  • Link status (up/down)
  • Port speed (10 Mbps or 100 Mbps)
  • Duplex mode (half or full)

◆ jl1111_reset()

void jl1111_reset ( TSW_Type ptr,
uint8_t  port 
)

Reset JL1111 PHY chip.

Parameters
[in]ptrPointer to the TSW peripheral base address
[in]portPort number

This function performs a software reset on the JL1111 PHY chip.