A simple CLI progress bar. More...
A simple CLI progress bar.
Definition in file progress_bar.h.
Go to the source code of this file.
Data Structures | |
struct | progress_bar_t |
Progress bar descriptor. More... | |
#define | CONFIG_PROGRESS_BAR_LENGTH (25U) |
Progress bar maximum characters length. | |
#define | CONFIG_PROGRESS_BAR_FULL_CHARACTER "█" |
Progress bar character. | |
#define | CONFIG_PROGRESS_BAR_EMPTY_CHARACTER " " |
Progress bar empty character. | |
#define | CONFIG_PROGRESS_BAR_PREFIX_CHARACTER "|" |
Character displayed on the left of the progress bar. | |
#define | CONFIG_PROGRESS_BAR_SUFFIX_CHARACTER "|" |
Character displayed on the left of the progress bar. | |
#define | CONFIG_PROGRESS_BAR_PREFIX_MAX_LENGTH (32U) |
Progress bar prefix max length. | |
#define | CONFIG_PROGRESS_BAR_SUFFIX_MAX_LENGTH (32U) |
Progress bar suffix max length. | |
void | progress_bar_print (char *prefix, char *suffix, uint8_t value) |
Print a progress bar in the terminal. | |
void | progress_bar_update (progress_bar_t *progress_bar) |
Update the progress bar display in the terminal. | |
void | progress_bar_prepare_multi (uint8_t len) |
Prepare the output for displaying multiple progress bars. | |
void | progress_bar_update_multi (progress_bar_t *progress_bar_list, uint8_t len) |
Update all progress bar displays of the given progress bars list. | |
#define CONFIG_PROGRESS_BAR_EMPTY_CHARACTER " " |
Progress bar empty character.
Definition at line 47 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_FULL_CHARACTER "█" |
Progress bar character.
Definition at line 40 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_LENGTH (25U) |
Progress bar maximum characters length.
Definition at line 33 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_PREFIX_CHARACTER "|" |
Character displayed on the left of the progress bar.
Definition at line 54 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_PREFIX_MAX_LENGTH (32U) |
Progress bar prefix max length.
Definition at line 68 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_SUFFIX_CHARACTER "|" |
Character displayed on the left of the progress bar.
Definition at line 61 of file progress_bar.h.
#define CONFIG_PROGRESS_BAR_SUFFIX_MAX_LENGTH (32U) |
Progress bar suffix max length.
Definition at line 75 of file progress_bar.h.
void progress_bar_prepare_multi | ( | uint8_t | len | ) |
Prepare the output for displaying multiple progress bars.
This function is just adding enough empty lines to give enough space to print the list of progress bars.
This function must be called only once and before starting the progress bar list updates with.
[in] | len | The length of the progress bar array |
void progress_bar_print | ( | char * | prefix, |
char * | suffix, | ||
uint8_t | value | ||
) |
Print a progress bar in the terminal.
[in] | prefix | String displayed on the left of the progress bar |
[in] | suffix | String displayed on the right of the progress bar |
[in] | value | Value of the progress bar |
void progress_bar_update | ( | progress_bar_t * | progress_bar | ) |
Update the progress bar display in the terminal.
[in] | progress_bar | Pointer to the progress bar descriptor |
void progress_bar_update_multi | ( | progress_bar_t * | progress_bar_list, |
uint8_t | len | ||
) |
Update all progress bar displays of the given progress bars list.
[in] | progress_bar_list | An array of progress bars |
[in] | len | The length of the progress bar array |