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

Multiple seven-segment display controller. More...

#include <m7seg.hpp>

+ Inheritance diagram for rpihw::display::m7seg:

Public Member Functions

 m7seg (uint8_t a, uint8_t b, uint8_t c, uint8_t d, uint8_t e, uint8_t f, uint8_t g)
 Constructor method. More...
 
 m7seg (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 ~m7seg ()
 Destructor method.
 
void setDisplays (size_t total, iface::output &enabler)
 Sets the number of displays and the enabler interface. More...
 
void setFreq (float frequency)
 Sets the updating frequency. More...
 
float getFreq () const
 Returns the updating frequency. More...
 
void set (float value)
 Sets the value of the display. More...
 
void format (uint8_t decimals, bool zeropad)
 Sets the format of the display. More...
 
void render ()
 Update the displays (threading function).
 
- Public Member Functions inherited from 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. 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...
 

Protected Attributes

size_t m_ndisplay
 Number of the displays.
 
float m_frequency
 Updating frequency (Hz).
 
uint8_t m_decimals
 Number of decimals.
 
bool m_zeropad
 Zeropad flag.
 
iface::outputm_enabler
 Enabler interface.
 
std::thread * m_thread
 Rendering thread.
 
std::mutex * m_mutex
 Mutex of the rendering thread.
 
- Protected Attributes inherited from rpihw::display::s7seg
iface::outputm_display
 Output interface to the display.
 
float m_value
 Value of the display.
 

Additional Inherited Members

- Public Types inherited from rpihw::display::s7seg
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.
 
- Static Public Attributes inherited from rpihw::display::s7seg
static const uint8_t output [12]
 Outputs of digits.
 

Detailed Description

Multiple seven-segment display controller.

Examples:
display/m7seg0.cpp, and display/m7seg1.cpp.

Definition at line 49 of file m7seg.hpp.

Constructor & Destructor Documentation

rpihw::display::m7seg::m7seg ( 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::m7seg::m7seg ( 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

void rpihw::display::m7seg::format ( uint8_t  decimals,
bool  zeropad 
)

Sets the format of the display.

Parameters
[in]decimalsThe number of decimals used to represent the value of the display.
[in]zeropadIf true, zero pad the value of the display.
Examples:
display/m7seg0.cpp, and display/m7seg1.cpp.
float rpihw::display::m7seg::getFreq ( ) const
inline

Returns the updating frequency.

Returns
The updating frequency in Hz.

Definition at line 45 of file m7seg-inl.hpp.

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

Sets the value of the display.

Parameters
[in]valueThe new value of the display.
Examples:
display/m7seg0.cpp, and display/m7seg1.cpp.
void rpihw::display::m7seg::setDisplays ( size_t  total,
iface::output enabler 
)
inline

Sets the number of displays and the enabler interface.

Parameters
[in]totalNumber of the displays.
[in]enablerOutput interface used to enable the displays.
Examples:
display/m7seg0.cpp, and display/m7seg1.cpp.

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

void rpihw::display::m7seg::setFreq ( float  frequency)
inline

Sets the updating frequency.

Parameters
[in]frequencyThe updating frequency in Hz.
Examples:
display/m7seg0.cpp, and display/m7seg1.cpp.

Definition at line 38 of file m7seg-inl.hpp.


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