Public Member Functions | Public Attributes

C9302Hardware Class Reference

C9302Hardware interacts directly with the Cirrus EP9302 hardware peripherals. More...

#include <9302hw.h>

List of all members.

Public Member Functions

 SINGLETON (C9302Hardware)
 This internal macro handles instantiation of this class.
unsigned short GetAD (unsigned int channel)
 Get the raw A/D value given the channel.
void SetGreenLED (bool state)
 Set the state of the green LED on the CPU board.
void SetRedLED (bool state)
 Set the state of the red LED on the CPU board.
volatile unsigned int * PortAData ()
 Set/get Port A data register on EP9302.
volatile unsigned int * PortADataDR ()
 Set/get Port A data direction register on EP9302.
volatile unsigned int * PortBData ()
 Set/get Port B data register on EP9302.
volatile unsigned int * PortBDataDR ()
 Set/get Port B data direction register on EP9302.
volatile unsigned int * PortCData ()
 Set/get Port C data register on EP9302.
volatile unsigned int * PortCDataDR ()
 Set/get Port C data direction register on EP9302.
volatile unsigned int * PortEData ()
 Set/get Port E data register on EP9302.
volatile unsigned int * PortEDataDR ()
 Set/get Port E data direction register on EP9302.
volatile unsigned int * PortFData ()
 Set/get Port F data register on EP9302.
volatile unsigned int * PortFDataDR ()
 Set/get Port F data direction register on EP9302.
volatile unsigned int * PortGData ()
 Set/get Port G data register on EP9302.
volatile unsigned int * PortGDataDR ()
 Set/get Port G data direction register on EP9302.
volatile unsigned int * PortHData ()
 Set/get Port H data register on EP9302.
volatile unsigned int * PortHDataDR ()
 Set/get Port A data register.
unsigned short GetBitstreamVersion ()
 Get the FPGA bitstream version.
unsigned char GetBitstreamMinorVersion ()
 Get the FPGA bitstream minor version.
unsigned char GetBitstreamMajorVersion ()
 Get the FPGA bitstream major version.

Public Attributes

CMemMap m_scr
 memory mapped region of memory controller on EP9302
CMemMap m_gpio
 memory mapped region of general purpose I/O controller on EP9302
CMemMap m_syscon
 memory mapped region of system controller on EP9302
CMemMap m_fpga
 memory mapped region of FPGA on EP9302
CMemMap m_adc
 memory mapped region of analog-to-digital controller on EP9302
CMemMap m_uart1
 memory mapped region of UART1 (serial controller) on EP9302
CMemMap m_uart2
 memory mapped region UART2 (serial controller) on EP9302

Detailed Description

C9302Hardware interacts directly with the Cirrus EP9302 hardware peripherals.

This class is normally only used by other I/O classes. You shouldn't need to use this class if you wish to interact with sensors, actuators, lcd and/or keypad. To instantiate this class:

 // by pointer
 C9302Hardware *phw = C9302Hardware::GetPtr(); 
 // or by reference
 C9302Hardware &hw = C9302Hardware::GetRef();

And when done with this class, call Release(), for each call to GetPtr() or GetRef():

 C9302Hardware::Release();

Member Function Documentation

unsigned short C9302Hardware::GetAD ( unsigned int  channel  ) 

Get the raw A/D value given the channel.

Parameters:
channel value between 0 and 4
Returns:
raw analog value of channel
unsigned char C9302Hardware::GetBitstreamMajorVersion (  ) 

Get the FPGA bitstream major version.

Returns:
FPGA bitstream major version
unsigned char C9302Hardware::GetBitstreamMinorVersion (  ) 

Get the FPGA bitstream minor version.

Returns:
FPGA bitstream minor version
unsigned short C9302Hardware::GetBitstreamVersion (  ) 

Get the FPGA bitstream version.

Returns:
FPGA bitstream version, msb=major version, lsb=minor version
volatile unsigned int* C9302Hardware::PortAData (  )  [inline]

Set/get Port A data register on EP9302.

Returns:
Address of port A data register
volatile unsigned int* C9302Hardware::PortADataDR (  )  [inline]

Set/get Port A data direction register on EP9302.

Returns:
Address of port A data direction register
volatile unsigned int* C9302Hardware::PortBData (  )  [inline]

Set/get Port B data register on EP9302.

Returns:
Address of port B data register
volatile unsigned int* C9302Hardware::PortBDataDR (  )  [inline]

Set/get Port B data direction register on EP9302.

Returns:
Address of port B data direction register
volatile unsigned int* C9302Hardware::PortCData (  )  [inline]

Set/get Port C data register on EP9302.

Returns:
Address of port C data register
volatile unsigned int* C9302Hardware::PortCDataDR (  )  [inline]

Set/get Port C data direction register on EP9302.

Returns:
Address of port C data direction register
volatile unsigned int* C9302Hardware::PortEData (  )  [inline]

Set/get Port E data register on EP9302.

Returns:
Address of port E data register
volatile unsigned int* C9302Hardware::PortEDataDR (  )  [inline]

Set/get Port E data direction register on EP9302.

Returns:
Address of port E data direction register
volatile unsigned int* C9302Hardware::PortFData (  )  [inline]

Set/get Port F data register on EP9302.

Returns:
Address of port F data register
volatile unsigned int* C9302Hardware::PortFDataDR (  )  [inline]

Set/get Port F data direction register on EP9302.

Returns:
Address of port F data direction register
volatile unsigned int* C9302Hardware::PortGData (  )  [inline]

Set/get Port G data register on EP9302.

Returns:
Address of port G data register
volatile unsigned int* C9302Hardware::PortGDataDR (  )  [inline]

Set/get Port G data direction register on EP9302.

Returns:
Address of port G data direction register
volatile unsigned int* C9302Hardware::PortHData (  )  [inline]

Set/get Port H data register on EP9302.

Returns:
Address of port H data register
volatile unsigned int* C9302Hardware::PortHDataDR (  )  [inline]

Set/get Port A data register.

Returns:
Address of port A data register
void C9302Hardware::SetGreenLED ( bool  state  )  [inline]

Set the state of the green LED on the CPU board.

Parameters:
state true=on, false=off
void C9302Hardware::SetRedLED ( bool  state  )  [inline]

Set the state of the red LED on the CPU board.

Parameters:
state true=on, false=off
C9302Hardware::SINGLETON ( C9302Hardware   ) 

This internal macro handles instantiation of this class.


Member Data Documentation

memory mapped region of analog-to-digital controller on EP9302

memory mapped region of FPGA on EP9302

memory mapped region of general purpose I/O controller on EP9302

memory mapped region of memory controller on EP9302

memory mapped region of system controller on EP9302

memory mapped region of UART1 (serial controller) on EP9302

memory mapped region UART2 (serial controller) on EP9302


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