fusb303

package
v0.0.0-...-57044a2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package fusb303 supports communication with the On Semiconductor FUSB303 USB Type-C port controller.

Index

Constants

This section is empty.

Variables

View Source
var (
	I2CBus     = 0
	I2CAddress = 0x31
)
View Source
var CurrentMode = map[byte]string{
	0x00: "0.0 A",
	0x01: "0.5 A",
	0x02: "1.5 A",
	0x03: "3.0 A",
}

Current mode values and meaning (FUSB303/D, Table 6).

Functions

func Disable

func Disable() (err error)

Force disable, writing I2C data address 0x05 (CONTROL_1, FUSB303/D - Table 17).

func Enable

func Enable() (err error)

Force enable, writing I2C data address 0x05 (CONTROL_1, FUSB303/D - Table 17).

func GetCurrentMode

func GetCurrentMode() (mode byte, err error)

Get detected current advertisement, reading I2C data address 0x11 (STATUS, (FUSB303/D, Table 22) and extracting value BC_LVL[1:0].

func GetDeviceID

func GetDeviceID() (id []byte, err error)

Get device identifier, reading I2C data address 0x01 (DEVICE ID, (FUSB303/D, Table 13).

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL