FreeNOS
Public Types | Public Member Functions | Private Attributes
BroadcomPower Class Reference

Broadcom Power Management. More...

#include <BroadcomPower.h>

Public Types

enum  Device { SD = (1 << 0), UART0 = (1 << 1), UART1 = (1 << 2), USB = (1 << 3) }
 Powered devices. More...
 
enum  Result { Success, IOError }
 Result codes. More...
 

Public Member Functions

 BroadcomPower ()
 Constructor. More...
 
Result initialize ()
 Initialize the power manager. More...
 
Result enable (Device device)
 Set power on. More...
 

Private Attributes

BroadcomMailbox m_mailbox
 Mailbox for communicating with the GPU. More...
 
u32 m_mask
 Current bitmask of enabled devices. More...
 

Detailed Description

Broadcom Power Management.

Definition at line 39 of file BroadcomPower.h.

Member Enumeration Documentation

◆ Device

Powered devices.

Enumerator
SD 
UART0 
UART1 
USB 

Definition at line 46 of file BroadcomPower.h.

◆ Result

Result codes.

Enumerator
Success 
IOError 

Definition at line 57 of file BroadcomPower.h.

Constructor & Destructor Documentation

◆ BroadcomPower()

BroadcomPower::BroadcomPower ( )

Constructor.

Definition at line 21 of file BroadcomPower.cpp.

Member Function Documentation

◆ enable()

BroadcomPower::Result BroadcomPower::enable ( Device  device)

Set power on.

Parameters
deviceDevice to power on.
Returns
Result code.

Definition at line 39 of file BroadcomPower.cpp.

References m_mailbox, m_mask, BroadcomMailbox::PowerManagement, BroadcomMailbox::read(), Success, and BroadcomMailbox::write().

◆ initialize()

BroadcomPower::Result BroadcomPower::initialize ( )

Initialize the power manager.

Returns
Result code.

Definition at line 26 of file BroadcomPower.cpp.

References ERROR, BroadcomMailbox::initialize(), IOError, m_mailbox, m_mask, BroadcomMailbox::PowerManagement, Success, BroadcomMailbox::Success, and BroadcomMailbox::write().

Field Documentation

◆ m_mailbox

BroadcomMailbox BroadcomPower::m_mailbox
private

Mailbox for communicating with the GPU.

Definition at line 89 of file BroadcomPower.h.

Referenced by enable(), and initialize().

◆ m_mask

u32 BroadcomPower::m_mask
private

Current bitmask of enabled devices.

Definition at line 92 of file BroadcomPower.h.

Referenced by enable(), and initialize().


The documentation for this class was generated from the following files: