3,022 bytes added
, 04:43, 22 April 2023
== General ==
The Wii U added a new chip to assist with power management alongside the [[Hardware/RTC|RTC]], labeled "SMC". The SMC is responsible for managing disc drive power/eject, power LED patterns, wireless resets, regulator enable/PGOOD monitoring, and possibly other unknown functionality.
== Communication ==
SMC resides as device ID 0x50 on [[Hardware/Latte_I²C|I2C bus 3]]. It communicates at 5kHz in IOS and 10KHz in Cafe2Wii?
== Registers ==
SMC has two types of registers: Read/write and command-based. Read/write registers operate by having the register number written (1 byte), followed by either another written byte, or a 1 byte read. Command-based registers perform their action just by writing the register number (1 byte). When attempting to read a command-based register, it will read as 0xFF. Registers wrap around after 0x7F.
{| style="border: 1px solid #bbb; border-collapse: collapse; background-color: #eef; padding: 0.2em 0.2em 0.2em 0.2em;" border="1" cellpadding="2"
|- style="background-color: #ddd;"
! Index
! Type
! Description
|-
| 0x00 || Command || ODD On
|-
| 0x01 || Command || ODD Off
|-
| 0x02 || Command || ODD Eject Request
|-
| 0x0D || Read/Write? || 00 on power on?
|-
| 0x0E || Read/Write? || 00 on power on?
|-
| 0x0F || Read/Write? || 00 on power on?
|-
| 0x10 || Command || ON LED on
|-
| 0x11 || Command || ON LED on?
|-
| 0x12 || Command || ON LED off
|-
| 0x13 || Command || ON LED pulse
|-
| 0x14 || Command || CC LED off
|-
| 0x15 || Command || CC LED on
|-
| 0x16 || Command || CC LED pulse
|-
| 0x17 || ? || ?
|-
| 0x18 || ? || ?
|-
| 0x19 || ? || ?
|-
| 0x1A || ? || ?
|-
| 0x1B || ? || ?
|-
| 0x1C || ? || ?
|-
| 0x1D || ? || ?
|-
| 0x1E || Command || OFF LED on
|-
| 0x1F || Command || OFF LED pulse
|-
| 0x20 || Command || bt_rst
|-
| 0x21 || Command || wifi_rst
|-
| 0x22 || Command || drc_wifi_rst
|-
| 0x30 || Read/Write || TimerCounter
|-
| 0x31 || ? || ?
|-
| 0x32 || ? || ?
|-
| 0x40 || Read/Write || ProgramRevision (val: 0xC5)
|-
| 0x41 || Read/Write || SystemEventFlag
|-
| 0x42 || Read/Write || ? (val: 0x0B)
|-
| 0x43 || Read/Write || USB Power (bitmask; front USB: 0x1, rear USB: 0x2)
|-
| 0x44 || Read/Write || NotificationLED (val: 0x20)
|-
| 0x45 || Read/Write || PowerFailureState (val: 0x08)
|-
| 0x46 || Read/Write || WifiRstCtrl (val: 0x00)
|-
| 0x47 || Read/Write || ? (val: 0xFF)
|-
| 0x48 || Read/Write || ? (val: 0x0F)
|-
| 0x60 || Read/Write || LAPSSetting (val: 0x00)
|-
| 0x61~0x70 || Read/Write || SystemError (val: 0x00)
|-
| 0x62~0x70 || Read/Write || ? (val: 0x00)
|-
| 0x71 || Command? || Blinks the drive LED?
|-
|}
=== SystemEventFlag ===
{| style="border: 1px solid #bbb; border-collapse: collapse; background-color: #eef; padding: 0.2em 0.2em 0.2em 0.2em;" border="1" cellpadding="2"
|- style="background-color: #ddd;"
! Bitmask
! Name
|-
| 0x40 || SMC_POWER_BUTTON
|-
| 0x20 || SMC_EJECT_BUTTON
|-
| 0x10 || SMC_DISK_INSERT
|-
| 0x08 || SMC_TIMER
|-
| 0x04 || SMC_BT_IRQ
|-
| 0x02 || SMC_WAKE0
|-
| 0x01 || SMC_WAKE1
|-
|}