LRAUV  revA
LPC3Reg Class Reference

Provides pointers for poking and peeking at LPC3XXX registers. More...

#include <LPC3Reg.h>

Collaboration diagram for LPC3Reg:

Public Member Functions

 LPC3Reg (unsigned long baseAddress, int bytesMapped)
 
virtual ~LPC3Reg ()
 

Static Public Member Functions

static bool IsDropweightOK (void)
 Returns true if the drop weight is present, false if not. More...
 
static bool IsBurnwireActive ()
 Returns true if the burn wire is burning, false if not. More...
 

Static Public Attributes

static volatile int & AdcClkCtrl1_ = *( SysCtrlPhys_.map_ + 0x60 / sizeof( int ) )
 
static volatile int & AdcClkCtrl_ = *( SysCtrlPhys_.map_ + 0xB4 / sizeof( int ) )
 
static volatile int & TimClkCtrl_ = *( SysCtrlPhys_.map_ + 0xBC / sizeof( int ) )
 
static volatile int & U3ClkPhys_ = *( SysCtrlPhys_.map_ + 0xD0 / sizeof( int ) )
 
static volatile int & U4ClkPhys_ = *( SysCtrlPhys_.map_ + 0xD4 / sizeof( int ) )
 
static volatile int & U6ClkPhys_ = *( SysCtrlPhys_.map_ + 0xDC / sizeof( int ) )
 
static volatile int & UartClkCtrl_ = *( SysCtrlPhys_.map_ + 0xE4 / sizeof( int ) )
 
static volatile int & Sic1Er_ = *( Sic1_.map_ + 0x0 / sizeof( int ) )
 
static volatile int & Sic1Rsr_ = *( Sic1_.map_ + 0x4 / sizeof( int ) )
 
static volatile int & Sic1Sr_ = *( Sic1_.map_ + 0x8 / sizeof( int ) )
 
static volatile int & Sic1Apr_ = *( Sic1_.map_ + 0xC / sizeof( int ) )
 
static volatile int & Sic1Atr_ = *( Sic1_.map_ + 0x10 / sizeof( int ) )
 
static volatile int & Sic1Itr_ = *( Sic1_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & Hsu1Ctrl_ = *( Hsu1RxPhys_.map_ + 0x0C / sizeof( int ) )
 
static volatile int & Hsu1RX_ = *( Hsu1RxPhys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & Hsu2Level_ = *( Hsu2RxPhys_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & Hsu2RX_ = *( Hsu2RxPhys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & Hsu7RX_ = *( Hsu7RxPhys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & P3InpStatePhys_ = *( PioPhys_.map_ + 0x0 / sizeof( int ) )
 
static volatile int & PioOutpSetPhys_ = *( PioPhys_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & PioOutpClrPhys_ = *( PioPhys_.map_ + 0x08 / sizeof( int ) )
 
static volatile int & PioMuxSetPhys_ = *( PioPhys_.map_ + 0x28 / sizeof( int ) )
 
static volatile int & PioMuxClrPhys_ = *( PioPhys_.map_ + 0x104 / sizeof( int ) )
 
static volatile int & P0InpStatePhys_ = *( PioPhys_.map_ + 0x40 / sizeof( int ) )
 
static volatile int & P0OutpSetPhys_ = *( PioPhys_.map_ + 0x44 / sizeof( int ) )
 
static volatile int & P0OutpClrPhys_ = *( PioPhys_.map_ + 0x48 / sizeof( int ) )
 
static volatile int & P3MuxSetPhys_ = *( PioPhys_.map_ + 0x110 / sizeof( int ) )
 
static volatile int & P3MuxClrPhys_ = *( PioPhys_.map_ + 0x114 / sizeof( int ) )
 
static volatile int & AdcSelect_ = *( Adc_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & AdcCtrl_ = *( Adc_.map_ + 0x08 / sizeof( int ) )
 
static volatile int & AdcValue_ = *( Adc_.map_ + 0x48 / sizeof( int ) )
 
static volatile int & UartCtrlPhys_ = *( UartGenCtrlPhys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & UartClkModePhys_ = *( UartGenCtrlPhys_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & U3LsrPhys_ = *( Uart3Phys_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & U3DllPhys_ = *( Uart3Phys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & U4DllPhys_ = *( Uart4Phys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & U4LsrPhys_ = *( Uart4Phys_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & U5LsrPhys_ = *( Uart5Phys_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & U6LsrPhys_ = *( Uart6Phys_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & U6DllPhys_ = *( Uart6Phys_.map_ + 0x00 / sizeof( int ) )
 
static volatile int & U6IERPhys_ = *( Uart6Phys_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & WDTimCtrl_ = *( WDTPhys_.map_ + 0x04 / sizeof( int ) )
 
static volatile int & WDTimCounter_ = *( WDTPhys_.map_ + 0x08 / sizeof( int ) )
 
static volatile int & WDTimMCtrl_ = *( WDTPhys_.map_ + 0x0C / sizeof( int ) )
 
static volatile int & WDTimMatch0_ = *( WDTPhys_.map_ + 0x10 / sizeof( int ) )
 
static volatile int & WDTimEMR_ = *( WDTPhys_.map_ + 0x14 / sizeof( int ) )
 
static volatile int & WDTimPulse_ = *( WDTPhys_.map_ + 0x18 / sizeof( int ) )
 
static volatile int & WDTimRes_ = *( WDTPhys_.map_ + 0x1C / sizeof( int ) )
 

Private Types

enum  GFChan {
  CHAN_0 = 0x4, CHAN_1 = 0x20000, CHAN_2 = 0x40000, CHAN_4 = 0x800,
  CHAN_5 = 0x1000
}
 Ground fault channel definitions. More...
 

Private Member Functions

 LPC3Reg (const LPC3Reg &old)
 

Static Private Member Functions

static void SoftwareReset (void)
 Force an immediate reset. More...
 
static void InitializeHBC (void)
 Get ready to heartbeat. More...
 
static void CheckBatt (void)
 Monitors the batteries. More...
 
static bool InitializeWDT (void)
 Fire up the watchdog timer. More...
 
static void StrobeWDT (void)
 Kick the dog. More...
 
static void StrobeHBC (void)
 Strobe the heartbeat counter. More...
 
static bool PowerOffLoads (void)
 Removes power from the load control backplane. More...
 
static bool PowerOnLoads (void)
 Applies power to the load control backplane. More...
 
static bool QueryShorepower (void)
 Returns true if shore power is on, false if not. More...
 
static bool QueryBattPower (void)
 Returns true if battery power is on, false if not. More...
 
static bool QueryBackplanePower (void)
 Returns true if LOAD_CONT_STATE is asserted (note signal is active low) More...
 
static bool WaterDetected (void)
 Returns true if water is detected in the pressure hull. More...
 
static bool CFMissing (void)
 Returns true if CF card is missing (NOT detected) More...
 
static void ActivateBurnwire (void)
 Activate the burnwire to drop the weight. More...
 
static void DeactivateBurnwire (void)
 Deactivate the burnwire to NOT drop the weight. More...
 
static void DeactivateRadio (void)
 Deactivate the radio(s) so they are not powered in emergency mode. More...
 
static void SWReset (void)
 
static void UninitializeWDT (void)
 Shut down the watchdog timer. More...
 
static void ActivateGF (GFChan channel)
 Ground fault circuit handling. More...
 
static void DeactivateGF (GFChan channel)
 

Private Attributes

int devFD_
 
int * map_
 
unsigned long baseAddress_
 
int bytesMapped_
 

Static Private Attributes

static bool BurnwireActive_
 
static LPC3Reg SysCtrlPhys_ = LPC3Reg( 0x40004000, 0xFF )
 
static LPC3Reg Sic1_ = LPC3Reg( 0x4000C000, 0x18 )
 
static LPC3Reg Hsu1RxPhys_ = LPC3Reg( 0x40014000, 0x10 )
 
static LPC3Reg Hsu2RxPhys_ = LPC3Reg( 0x40018000, 0x10 )
 
static LPC3Reg Hsu7RxPhys_ = LPC3Reg( 0x4001C000, 0x10 )
 
static LPC3Reg PioPhys_ = LPC3Reg( 0x40028000, 0x200 )
 
static LPC3Reg Adc_ = LPC3Reg( 0x40048000, 0x50 )
 
static LPC3Reg UartGenCtrlPhys_ = LPC3Reg( 0x40054000, 0x10 )
 
static LPC3Reg Uart3Phys_ = LPC3Reg( 0x40080000, 0xFF )
 
static LPC3Reg Uart4Phys_ = LPC3Reg( 0x40088000, 0xFF )
 
static LPC3Reg Uart5Phys_ = LPC3Reg( 0x40090000, 0xFF )
 
static LPC3Reg Uart6Phys_ = LPC3Reg( 0x40098000, 0xFF )
 
static LPC3Reg WDTPhys_ = LPC3Reg( 0x4003C000, 0xFF )
 
static bool HeartbeatHi_
 Keeps track of flipping the state of the heartbeat signal. More...
 
static bool BackplanePowerOn_
 True == backplane power applied. More...
 

Friends

class CBIT
 
class SBIT
 
class IBIT
 
class Supervisor
 
class CommandLine
 
class LoadControl
 
class VerticalControl
 

Detailed Description

Provides pointers for poking and peeking at LPC3XXX registers.

Constructor & Destructor Documentation

LPC3Reg::LPC3Reg ( unsigned long  baseAddress,
int  bytesMapped 
)
LPC3Reg::~LPC3Reg ( )
virtual
LPC3Reg::LPC3Reg ( const LPC3Reg old)
private

Member Function Documentation

void LPC3Reg::ActivateBurnwire ( void  )
staticprivate
void LPC3Reg::ActivateGF ( GFChan  channel)
staticprivate

Ground fault circuit handling.

References PioOutpSetPhys_.

Referenced by CBIT::scanGFChan().

bool LPC3Reg::CFMissing ( void  )
staticprivate

Returns true if CF card is missing (NOT detected)

References CF_CARD_PRESENT, and P3InpStatePhys_.

Referenced by CBIT::monitorCFCard().

static void LPC3Reg::CheckBatt ( void  )
staticprivate

Monitors the batteries.

void LPC3Reg::DeactivateBurnwire ( void  )
staticprivate
void LPC3Reg::DeactivateGF ( GFChan  channel)
staticprivate

References PioOutpClrPhys_.

Referenced by CBIT::scanGFChan(), and CBIT::uninitialize().

void LPC3Reg::DeactivateRadio ( void  )
staticprivate

Deactivate the radio(s) so they are not powered in emergency mode.

References EMERG_RADIO_OFF, Timespan::Milliseconds(), PioOutpClrPhys_, PioOutpSetPhys_, and Timespan::sleepFor().

Referenced by CBIT::initialize().

void LPC3Reg::InitializeHBC ( void  )
staticprivate

Get ready to heartbeat.

References HeartbeatHi_, LPC3250_HEARTBEAT, and PioOutpSetPhys_.

Referenced by CBIT::initialize().

bool LPC3Reg::InitializeWDT ( void  )
staticprivate

Fire up the watchdog timer.

References TimClkCtrl_, WDTimCounter_, WDTimCtrl_, WDTimEMR_, WDTimMCtrl_, WDTimPulse_, and WDTimRes_.

Referenced by CBIT::initialize().

static bool LPC3Reg::IsBurnwireActive ( )
inlinestatic

Returns true if the burn wire is burning, false if not.

References BurnwireActive_.

Referenced by DropWeight::run().

bool LPC3Reg::IsDropweightOK ( void  )
static

Returns true if the drop weight is present, false if not.

References DROP_WEIGHT_STATE, and P3InpStatePhys_.

Referenced by DropWeight::run().

bool LPC3Reg::PowerOffLoads ( void  )
staticprivate
bool LPC3Reg::QueryBackplanePower ( void  )
staticprivate

Returns true if LOAD_CONT_STATE is asserted (note signal is active low)

References BackplanePowerOn_, LOAD_CONT_STATE, and P3InpStatePhys_.

Referenced by CBIT::checkBackplanePower().

bool LPC3Reg::QueryBattPower ( void  )
staticprivate

Returns true if battery power is on, false if not.

References BATT_POWER_STATE, and P3InpStatePhys_.

Referenced by CBIT::checkMainBattery().

bool LPC3Reg::QueryShorepower ( void  )
staticprivate

Returns true if shore power is on, false if not.

References P3InpStatePhys_, and SHORE_POWER_STATE.

Referenced by CBIT::monitorShorePower().

void LPC3Reg::SoftwareReset ( void  )
staticprivate

Force an immediate reset.

References WDTimMCtrl_.

void LPC3Reg::StrobeHBC ( void  )
staticprivate

Strobe the heartbeat counter.

References HeartbeatHi_, LPC3250_HEARTBEAT, PioOutpClrPhys_, and PioOutpSetPhys_.

Referenced by CBIT::assertVitals().

void LPC3Reg::StrobeWDT ( void  )
staticprivate

Kick the dog.

References WDTimCounter_, and WDTimMatch0_.

Referenced by CBIT::assertVitals().

void LPC3Reg::SWReset ( void  )
staticprivate
void LPC3Reg::UninitializeWDT ( void  )
staticprivate

Shut down the watchdog timer.

Uninit function.

References TimClkCtrl_, WDTimCounter_, WDTimCtrl_, WDTimEMR_, WDTimMatch0_, WDTimMCtrl_, and WDTimPulse_.

Referenced by CBIT::uninitialize().

bool LPC3Reg::WaterDetected ( void  )
staticprivate

Returns true if water is detected in the pressure hull.

References P3InpStatePhys_, and WATER_SENSOR_STATE.

Referenced by CBIT::checkLeak().

Friends And Related Function Documentation

friend class CBIT
friend
friend class CommandLine
friend
friend class IBIT
friend
friend class LoadControl
friend
friend class SBIT
friend
friend class Supervisor
friend
friend class VerticalControl
friend

Member Data Documentation

LPC3Reg LPC3Reg::Adc_ = LPC3Reg( 0x40048000, 0x50 )
staticprivate
volatile int & LPC3Reg::AdcClkCtrl1_ = *( SysCtrlPhys_.map_ + 0x60 / sizeof( int ) )
static
volatile int & LPC3Reg::AdcClkCtrl_ = *( SysCtrlPhys_.map_ + 0xB4 / sizeof( int ) )
static
volatile int & LPC3Reg::AdcCtrl_ = *( Adc_.map_ + 0x08 / sizeof( int ) )
static
volatile int & LPC3Reg::AdcSelect_ = *( Adc_.map_ + 0x04 / sizeof( int ) )
static
volatile int & LPC3Reg::AdcValue_ = *( Adc_.map_ + 0x48 / sizeof( int ) )
static
bool LPC3Reg::BackplanePowerOn_
staticprivate

True == backplane power applied.

Referenced by PowerOffLoads(), PowerOnLoads(), and QueryBackplanePower().

unsigned long LPC3Reg::baseAddress_
private

Referenced by LPC3Reg(), and ~LPC3Reg().

bool LPC3Reg::BurnwireActive_
staticprivate
int LPC3Reg::bytesMapped_
private

Referenced by LPC3Reg(), and ~LPC3Reg().

int LPC3Reg::devFD_
private

Referenced by LPC3Reg(), and ~LPC3Reg().

bool LPC3Reg::HeartbeatHi_
staticprivate

Keeps track of flipping the state of the heartbeat signal.

Referenced by InitializeHBC(), and StrobeHBC().

volatile int & LPC3Reg::Hsu1Ctrl_ = *( Hsu1RxPhys_.map_ + 0x0C / sizeof( int ) )
static
volatile int & LPC3Reg::Hsu1RX_ = *( Hsu1RxPhys_.map_ + 0x00 / sizeof( int ) )
static
LPC3Reg LPC3Reg::Hsu1RxPhys_ = LPC3Reg( 0x40014000, 0x10 )
staticprivate
volatile int & LPC3Reg::Hsu2Level_ = *( Hsu2RxPhys_.map_ + 0x04 / sizeof( int ) )
static
volatile int & LPC3Reg::Hsu2RX_ = *( Hsu2RxPhys_.map_ + 0x00 / sizeof( int ) )
static
LPC3Reg LPC3Reg::Hsu2RxPhys_ = LPC3Reg( 0x40018000, 0x10 )
staticprivate
volatile int & LPC3Reg::Hsu7RX_ = *( Hsu7RxPhys_.map_ + 0x00 / sizeof( int ) )
static
LPC3Reg LPC3Reg::Hsu7RxPhys_ = LPC3Reg( 0x4001C000, 0x10 )
staticprivate
int* LPC3Reg::map_
private

Referenced by LPC3Reg(), and ~LPC3Reg().

volatile int & LPC3Reg::P0InpStatePhys_ = *( PioPhys_.map_ + 0x40 / sizeof( int ) )
static
volatile int & LPC3Reg::P0OutpClrPhys_ = *( PioPhys_.map_ + 0x48 / sizeof( int ) )
static
volatile int & LPC3Reg::P0OutpSetPhys_ = *( PioPhys_.map_ + 0x44 / sizeof( int ) )
static
volatile int & LPC3Reg::P3InpStatePhys_ = *( PioPhys_.map_ + 0x0 / sizeof( int ) )
static
volatile int & LPC3Reg::P3MuxClrPhys_ = *( PioPhys_.map_ + 0x114 / sizeof( int ) )
static
volatile int & LPC3Reg::P3MuxSetPhys_ = *( PioPhys_.map_ + 0x110 / sizeof( int ) )
static
volatile int & LPC3Reg::PioMuxClrPhys_ = *( PioPhys_.map_ + 0x104 / sizeof( int ) )
static
volatile int & LPC3Reg::PioMuxSetPhys_ = *( PioPhys_.map_ + 0x28 / sizeof( int ) )
static
volatile int & LPC3Reg::PioOutpClrPhys_ = *( PioPhys_.map_ + 0x08 / sizeof( int ) )
static
volatile int & LPC3Reg::PioOutpSetPhys_ = *( PioPhys_.map_ + 0x04 / sizeof( int ) )
static
LPC3Reg LPC3Reg::PioPhys_ = LPC3Reg( 0x40028000, 0x200 )
staticprivate
LPC3Reg LPC3Reg::Sic1_ = LPC3Reg( 0x4000C000, 0x18 )
staticprivate
volatile int & LPC3Reg::Sic1Apr_ = *( Sic1_.map_ + 0xC / sizeof( int ) )
static
volatile int & LPC3Reg::Sic1Atr_ = *( Sic1_.map_ + 0x10 / sizeof( int ) )
static
volatile int & LPC3Reg::Sic1Er_ = *( Sic1_.map_ + 0x0 / sizeof( int ) )
static
volatile int & LPC3Reg::Sic1Itr_ = *( Sic1_.map_ + 0x14 / sizeof( int ) )
static
volatile int & LPC3Reg::Sic1Rsr_ = *( Sic1_.map_ + 0x4 / sizeof( int ) )
static
volatile int & LPC3Reg::Sic1Sr_ = *( Sic1_.map_ + 0x8 / sizeof( int ) )
static
LPC3Reg LPC3Reg::SysCtrlPhys_ = LPC3Reg( 0x40004000, 0xFF )
staticprivate
volatile int & LPC3Reg::TimClkCtrl_ = *( SysCtrlPhys_.map_ + 0xBC / sizeof( int ) )
static

Referenced by InitializeWDT(), and UninitializeWDT().

volatile int & LPC3Reg::U3ClkPhys_ = *( SysCtrlPhys_.map_ + 0xD0 / sizeof( int ) )
static
volatile int & LPC3Reg::U3DllPhys_ = *( Uart3Phys_.map_ + 0x00 / sizeof( int ) )
static
volatile int & LPC3Reg::U3LsrPhys_ = *( Uart3Phys_.map_ + 0x14 / sizeof( int ) )
static
volatile int & LPC3Reg::U4ClkPhys_ = *( SysCtrlPhys_.map_ + 0xD4 / sizeof( int ) )
static
volatile int & LPC3Reg::U4DllPhys_ = *( Uart4Phys_.map_ + 0x00 / sizeof( int ) )
static
volatile int & LPC3Reg::U4LsrPhys_ = *( Uart4Phys_.map_ + 0x14 / sizeof( int ) )
static
volatile int & LPC3Reg::U5LsrPhys_ = *( Uart5Phys_.map_ + 0x14 / sizeof( int ) )
static
volatile int & LPC3Reg::U6ClkPhys_ = *( SysCtrlPhys_.map_ + 0xDC / sizeof( int ) )
static
volatile int & LPC3Reg::U6DllPhys_ = *( Uart6Phys_.map_ + 0x00 / sizeof( int ) )
static
volatile int & LPC3Reg::U6IERPhys_ = *( Uart6Phys_.map_ + 0x04 / sizeof( int ) )
static
volatile int & LPC3Reg::U6LsrPhys_ = *( Uart6Phys_.map_ + 0x14 / sizeof( int ) )
static
LPC3Reg LPC3Reg::Uart3Phys_ = LPC3Reg( 0x40080000, 0xFF )
staticprivate
LPC3Reg LPC3Reg::Uart4Phys_ = LPC3Reg( 0x40088000, 0xFF )
staticprivate
LPC3Reg LPC3Reg::Uart5Phys_ = LPC3Reg( 0x40090000, 0xFF )
staticprivate
LPC3Reg LPC3Reg::Uart6Phys_ = LPC3Reg( 0x40098000, 0xFF )
staticprivate
volatile int & LPC3Reg::UartClkCtrl_ = *( SysCtrlPhys_.map_ + 0xE4 / sizeof( int ) )
static
volatile int & LPC3Reg::UartClkModePhys_ = *( UartGenCtrlPhys_.map_ + 0x04 / sizeof( int ) )
static
volatile int & LPC3Reg::UartCtrlPhys_ = *( UartGenCtrlPhys_.map_ + 0x00 / sizeof( int ) )
static
LPC3Reg LPC3Reg::UartGenCtrlPhys_ = LPC3Reg( 0x40054000, 0x10 )
staticprivate
volatile int & LPC3Reg::WDTimCounter_ = *( WDTPhys_.map_ + 0x08 / sizeof( int ) )
static
volatile int & LPC3Reg::WDTimCtrl_ = *( WDTPhys_.map_ + 0x04 / sizeof( int ) )
static

Referenced by InitializeWDT(), and UninitializeWDT().

volatile int & LPC3Reg::WDTimEMR_ = *( WDTPhys_.map_ + 0x14 / sizeof( int ) )
static

Referenced by InitializeWDT(), and UninitializeWDT().

volatile int & LPC3Reg::WDTimMatch0_ = *( WDTPhys_.map_ + 0x10 / sizeof( int ) )
static

Referenced by StrobeWDT(), and UninitializeWDT().

volatile int & LPC3Reg::WDTimMCtrl_ = *( WDTPhys_.map_ + 0x0C / sizeof( int ) )
static
volatile int & LPC3Reg::WDTimPulse_ = *( WDTPhys_.map_ + 0x18 / sizeof( int ) )
static

Referenced by InitializeWDT(), and UninitializeWDT().

volatile int & LPC3Reg::WDTimRes_ = *( WDTPhys_.map_ + 0x1C / sizeof( int ) )
static

Referenced by CBIT::initialize(), and InitializeWDT().

LPC3Reg LPC3Reg::WDTPhys_ = LPC3Reg( 0x4003C000, 0xFF )
staticprivate

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