Rpi-hw  0.7.2
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
rpihw::display::s7seg Class Reference

Seven-segment display controller. More...

#include <s7seg.hpp>

+ Inheritance diagram for rpihw::display::s7seg:

Public Types

enum  Segments {
  SEGMENT_A = 0, SEGMENT_B = 1, SEGMENT_C = 2, SEGMENT_D = 3,
  SEGMENT_E = 4, SEGMENT_F = 5, SEGMENT_G = 6, SEGMENT_DP = 7
}
 Display segments.
 

Public Member Functions

 s7seg (uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g)
 Constructor method. More...
 
 s7seg (uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g, uint8_t dp)
 Constructor method. More...
 
virtual ~s7seg ()
 Destructor method.
 
void set (float value)
 Sets the value of the display. More...
 
float get () const
 Returns the value of the display. More...
 

Static Public Attributes

static const uint8_t output [12]
 Outputs of digits.
 

Protected Attributes

iface::outputm_display
 Output interface to the display.
 
float m_value
 Value of the display.
 

Detailed Description

Seven-segment display controller.

Examples:
display/s7seg.cpp.

Definition at line 47 of file s7seg.hpp.

Constructor & Destructor Documentation

rpihw::display::s7seg::s7seg ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d,
uint8_t  e,
uint8_t  f,
uint8_t  g 
)

Constructor method.

Parameters
[in]aThe GPIO pin connected to the segment a.
[in]bThe GPIO pin connected to the segment b.
[in]cThe GPIO pin connected to the segment c.
[in]dThe GPIO pin connected to the segment d.
[in]eThe GPIO pin connected to the segment e.
[in]fThe GPIO pin connected to the segment f.
[in]gThe GPIO pin connected to the segment g.
rpihw::display::s7seg::s7seg ( uint8_t  a,
uint8_t  b,
uint8_t  c,
uint8_t  d,
uint8_t  e,
uint8_t  f,
uint8_t  g,
uint8_t  dp 
)

Constructor method.

Parameters
[in]aThe GPIO pin connected to the segment a.
[in]bThe GPIO pin connected to the segment b.
[in]cThe GPIO pin connected to the segment c.
[in]dThe GPIO pin connected to the segment d.
[in]eThe GPIO pin connected to the segment e.
[in]fThe GPIO pin connected to the segment f.
[in]gThe GPIO pin connected to the segment g.
[in]dpThe GPIO pin connected to the segment dp (decimal point).

Member Function Documentation

float rpihw::display::s7seg::get ( ) const
inline

Returns the value of the display.

Returns
The current value of the display.

Definition at line 30 of file s7seg-inl.hpp.

void rpihw::display::s7seg::set ( float  value)

Sets the value of the display.

Parameters
[in]valueThe new value of the display.
Examples:
display/s7seg.cpp.

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