Realtek switch SoC docs

longan register: LED_GLB_CTRL

Details

Name
LED_GLB_CTRL
Offset
cc00
Feature
LED

Description

External LED controller global register (of the RTL8231)

default: 0x0105_3658

Fields

Name LSB Bits Description
CFG_MDX_DEALY 28 4

MDX controller delay

  • 0x0 - 0xf -> 0 - 15 clocks of delay
LED_STACK_FTG_IGNORE 27 1

Ignore First Trigger Pulse

  • 0b0: disable
  • 0b1: enable
LED_STACK 25 2

LED trigger select

Note, trigger signals configure GPIO23 as GPIO

  • 0x0: disable
  • 0x1: output on trigger signal
  • 0x2: input on trigger signal
  • 0x3: Reserved
LEDIC_PAGE_ACCESS 24 1

Always reset RTL8231 page to GPIO Control Register after access

Set address 0x1f to 0x1e after each access.

  • 0b0: disable
  • 0b1: enable
LEDIC_RESTART 23 1

Restart RTL8231 every time

Register 0x00, bit 1 (LED_Start) on RTL8231)

  • 0b0: normal operation
  • 0b1: restart
LED_ACTIVE 22 1

Serial LED is active high/low

Note: Only for serial LED mode, must be set to active high when scan LED mode.

  • 0b0: active low
  • 0b1: active high
LED_SIGNAL_INVERT 21 1

LED signal stream invert mode

Note: Only for serial LED mode, must be set to enable when scan LED mode.

  • 0b0: disable
  • 0b1: enable
BLINK_TIME_SEL 18 3

LED blinking rate

Also See LED_PORT_SW_CTRL for the same rates. Does not seem to match the blink rates from RTL8231 …

On time is identical to off time (50% duty cycle).

  • 0x0 Reserved (off?)
  • 0x1: 32 ms
  • 0x2: 64 ms
  • 0x3: 128 ms
  • 0x4: 256 ms
  • 0x5: 512 ms
  • 0x6: 1024 ms
  • 0x7 Reserved (on?)
LED_CLK_SEL 16 2

Set LED period time (LED_CLK and LED_MDC)

Note: Can be used in serial LED mode or scan LED mode.

  • 0x0: 800 ns
  • 0x1: 400 ns
  • 0x2: 200 ns
  • 0x3: 100 ns
LED_LOAD_EN 15 1

LED load indication

Note: LED_LOAD_EN is not available when LED configuration is TX = 0x4 or RX = 0x3

  • 0b0: disable
  • 0b1: enable
SYS_LED_MODE 13 2

System LED blink mode

Note: Only valid when SYS_LED_EN = 1

  • 0x0: off
  • 0x1: 64 ms
  • 0x2: 1024 ms
  • 0x3: on
SYS_LED_EN 12 1

System LED pin controller

Configure GPIO0 (pin A0) as GPIO or as system LED

  • 0b0: GPIO
  • 0b1: System LED
STP2_PWR_ON_LED 8 4

Power on blinking rate (step 2)

  • 0x0: off
  • 0x1: on (doesn’t sound right, default is 0x6)
  • 0x2 - 0xf: ? (todo)
STP1_PWR_ON_LED 4 4

Power on blinking rate (step 1)

  • 0x0: off
  • 0x1: on (doesn’t sound right, default is 0x5)
  • 0x2 - 0xf: ? (todo)
PWR_ON_BLINK_SEL 2 2

Power On blink time

  • 0x0: off
  • 0x1: 400 ms
  • 0x2: 800 ms
  • 0x3: 1600 ms
LED_MOD 0 2

LED data output mode

  • 0x0: off
  • 0x1: serial (shift register) output
  • 0x2: single color scan mode
  • 0x3: bi-color scan mode