Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 28 additions & 16 deletions hardware/zpuino/zpu/libraries/SevenSegHW/SevenSegHW.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "zpuino.h"
#endif

#define SEVENSEGBASE IO_SLOT(9)
#define SEVENSEGBASE (this->getBaseAddress())
#define SEVSEGDIGITO REGISTER(SEVENSEGBASE,7)
#define SEVSEGDIGIT1 REGISTER(SEVENSEGBASE,6)
#define SEVSEGDIGIT2 REGISTER(SEVENSEGBASE,5)
Expand All @@ -16,39 +16,51 @@

class SEVENSEGHW {
public:
// Default Constructor
// Default Constructor
SEVENSEGHW();

// Set the 4 digits Int value

// configure base address
void begin (int address);

// get base address
inline unsigned long int getBaseAddress ()
{
return this->nBaseAddress;
}

// Set the 4 digits Int value
void setIntValue (unsigned int value, unsigned int pos_dot) ;
// Set a digit value
void setDigitValue (unsigned int value, unsigned int dot, unsigned int digit) ;
// Set a Hexadecimal value
void setHexValue (unsigned int value) ;
// Get the 4 digits Int value
// Get the 4 digits Int value
unsigned int getIntValue () ;
// Get a digit value
// Get a digit value
unsigned int getDigitValue (unsigned int digit) ;
// Get Dot position
unsigned int getDotPosition () ;
// Set a Hexadecimal value
void setHexValue (unsigned int value, unsigned int digit) ;

// Set Brightness
// Set Brightness
void setBrightness (unsigned int value) ;
// Get Brightness
unsigned int getBrightness () ;
// Get Brightness
unsigned int getBrightness () ;

// Set Extra value
// Set Extra value
void setExtra (unsigned int value);
// Get Extra value
unsigned int getExtra ();
// enable/disable segment
// Get Extra value
unsigned int getExtra ();


// enable/disable segment
void setSegmentStatus (unsigned int enabled );
// get segment status
// get segment status
unsigned int getSegmentStatus ();

private :
unsigned long int nBaseAddress;
};

#endif