added documentation to display headerfile

This commit is contained in:
Hans Haupt 2024-06-04 19:53:31 +02:00
parent d67a33c53f
commit 4ffed430e2
3 changed files with 54 additions and 2 deletions

View File

@ -138,8 +138,20 @@ void Display::print(char *value){
return;
};
void Display::println(char *value){
void Display::flipOrientation(void){
if(this->orientationFlipped){
sendDisplayCMD(setComDirectionNormal);
sendDisplayCMD(setSegmentMap);
} else{
sendDisplayCMD(setComDirectionFlipped);
sendDisplayCMD(setSegmentReMap);
}
this->orientationFlipped = !this->orientationFlipped;
}
void Display::println(char *value){
this ->print(value);
this->print("\n");
};
void Display::print(int value){

View File

@ -21,14 +21,55 @@ class Display{
uint8_t charsOnCurrLine = 0;
//on which line are we currently printing
uint8_t currLine = 0;
//flag that marks if the y-orientation is currently flipped
bool orientationFlipped = false;
/**
* @brief sends the passed cmd to the display, cmd_byte is added as prefix by the function
*
* @param cmd the byte instruction that shold by sent
*/
void sendDisplayCMD(uint8_t cmd);
/**
* @brief should be called whenever characters where printed to the display.
* Updates the data of the class to handle linebreaks correctly
* @param charAmount How many characters where added to the screen
*/
void updateLine(uint charAmount);
public:
/**
* @brief initializes the display datastructures and sents the required cmds to start the display. Should only be called once.
* @warning doesn't initalize the I²C bus itself, therefore wire.begin(1,2) must be called elsewhere, before this method.
*/
void begin(void);
/**
* @brief delets all content from the display, resets the linecounter, new print will start at the top left.
* Orientationflip is not resetted
*/
void clear(void);
/**
* @brief prints the passed string right behind the current displaycontent
* the sequence "\n" can be used to make a linebreak on the display
*
* @param value the string "xyz" that should be printed to the display
*/
void print(char *value);
/**
* @brief same as the print method, but after the string a line break is inserted
*
* @param value the string that should be printed
*/
void println(char *value);
void print(int value);
/**
* @brief flips the horizontal orientation of all content on the display
*/
void flipOrientation(void);
};

View File

@ -26,7 +26,6 @@ class InfraredLED{
/**
* @brief enables selected LED
*
* @param led
*/
void turnOn(void);
/**