class Fusb302Fifos

Defined at line 30 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.h

Manages the Tx (transmitter) and Rx (receiver) FIFOS on the chip.

This class moves PD message data between `usb_pd::Message` instances and the

BMC (Bi-phase Mark Encoding) PHY's internal buffers. This involves format

conversion, and communication over the I2C-based FIFO interface.

Public Methods

void Fusb302Fifos (fidl::ClientEnd<fuchsia_hardware_i2c::Device> & i2c_channel)

`i2c_channel` must remain alive throughout the new instance's lifetime.

Defined at line 30 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.cc

void Fusb302Fifos (const Fusb302Fifos & )

Defined at line 35 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.h

Fusb302Fifos & operator= (const Fusb302Fifos & )

Defined at line 36 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.h

void ~Fusb302Fifos ()

Trivially destructible.

Defined at line 39 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.h

zx::result<> TransmitMessage (const usb_pd::Message & message)

Submits a PD message to the PHY layer's transmit FIFO.

Returns an error if an I/O error occurs while communicating with the

FUSB302 over I2C.

Conceptually, this method handles the PHY layer concerns in the USB PD

spec. Callers are responsible for the PD protocol concerns. See usbpd3.1

6.12.2.2 "Protocol Layer Message Transmission" and usbpd3.1 6.12.2.3

"Protocol Layer Message Reception".

However, this method performs the minimum amount of flow control to ensure

that the PHY does not drop the message. This comes down to busy-looping

while the CC wire is in use (the FUSB302 drops messages when it detects

collisions), and busy-looping while another transmission is in progress

(the FUSB302 is flaky if we attempt to fill the FIFO with more than one

message).

Defined at line 178 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.cc

zx::result<std::optional<usb_pd::Message>> ReadReceivedMessage ()

Reads a message from the PHY layer's receive FIFO.

Returns an error if an I/O error occurs while communicating with the

FUSB302 over I2C. Returns a null option if the receive FIFO is empty.

Conceptually, this method handles the PHY layer concerns in the USB PD

spec. Callers are responsible for the PD protocol concerns.

Defined at line 36 of file ../../src/devices/power/drivers/fusb302/fusb302-fifos.cc