subsys/fb/cfb: Introduce cfb_get_numof_fonts function
Adds the cfb_get_numof_fonts function to get the number of available fonts Signed-off-by: Diego Sueiro <diego.sueiro@gmail.com>
This commit is contained in:
parent
0ab9c46d86
commit
72981ea31a
2 changed files with 16 additions and 0 deletions
|
@ -151,6 +151,15 @@ int cfb_framebuffer_set_font(struct device *dev, u8_t idx);
|
||||||
*/
|
*/
|
||||||
int cfb_get_font_size(struct device *dev, u8_t idx, u8_t *width, u8_t *height);
|
int cfb_get_font_size(struct device *dev, u8_t idx, u8_t *width, u8_t *height);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get number of fonts.
|
||||||
|
*
|
||||||
|
* @param dev Pointer to device structure for driver instance
|
||||||
|
*
|
||||||
|
* @return number of fonts
|
||||||
|
*/
|
||||||
|
int cfb_get_numof_fonts(struct device *dev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Initialize Character Framebuffer.
|
* @brief Initialize Character Framebuffer.
|
||||||
*
|
*
|
||||||
|
|
|
@ -283,6 +283,13 @@ int cfb_get_font_size(struct device *dev, u8_t idx, u8_t *width, u8_t *height)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int cfb_get_numof_fonts(struct device *dev)
|
||||||
|
{
|
||||||
|
const struct char_framebuffer *fb = &char_fb;
|
||||||
|
|
||||||
|
return fb->numof_fonts;
|
||||||
|
}
|
||||||
|
|
||||||
int cfb_framebuffer_init(struct device *dev)
|
int cfb_framebuffer_init(struct device *dev)
|
||||||
{
|
{
|
||||||
const struct display_driver_api *api = dev->driver_api;
|
const struct display_driver_api *api = dev->driver_api;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue