Update the function documentation in the header files

This commit is contained in:
Kiss-Vamosi Gabor
2017-01-13 23:27:49 +01:00
parent f089ce3929
commit 39af8d8252
40 changed files with 2131 additions and 285 deletions

View File

@@ -64,25 +64,22 @@ typedef struct
/**********************
* GLOBAL PROTOTYPES
**********************/
const font_t * font_get(font_types_t letter);
/**********************
* MACROS
**********************/
/**
* Return with the bitmap of a font.
* Get the font from its id
* @param font_id: the id of a font (an element of font_types_t enum)
* @return pointer to a font descriptor
*/
const font_t * font_get(font_types_t font_id);
/**
* Return with the bitmap of a font.
* @param font_p pointer to a font
* @param letter a letter
* @return pointer to the bitmap of the letter
*/
static inline const uint8_t * font_get_bitmap(const font_t * font_p, uint8_t letter)
{
if(letter < font_p->start_ascii || letter >= font_p->start_ascii + font_p->letter_cnt) return NULL;
uint32_t index = (letter - font_p->start_ascii) * font_p->height_row * font_p->width_byte;
return &font_p->bitmaps_a[index];
}
const uint8_t * font_get_bitmap(const font_t * font_p, uint8_t letter);
/**
* Get the height of a font
@@ -94,24 +91,19 @@ static inline uint8_t font_get_height(const font_t * font_p)
return font_p->height_row;
}
/**
* Get the width of a letter in a font
* @param font_p pointer to a font
* @param letter a letter
* @return the width of a letter
*/
static inline uint8_t font_get_width(const font_t * font_p, uint8_t letter)
{
if(letter < font_p->start_ascii) return 0;
letter -= font_p->start_ascii;
uint8_t w = 0;
if(letter < font_p->letter_cnt) {
w = font_p->fixed_width != 0 ? font_p->fixed_width :
font_p->width_bit_a[letter];
}
uint8_t font_get_width(const font_t * font_p, uint8_t letter);
/**********************
* MACROS
**********************/
return w;
}
#endif