MPLABĀ® Harmony Graphics Suite  GFX v3.13.0
Legato API Documentation
legato_driver.h
Go to the documentation of this file.
1 // DOM-IGNORE-BEGIN
2 /*******************************************************************************
3 * Copyright (C) 2020 Microchip Technology Inc. and its subsidiaries.
4 *
5 * Subject to your compliance with these terms, you may use Microchip software
6 * and any derivatives exclusively with Microchip products. It is your
7 * responsibility to comply with third party license terms applicable to your
8 * use of third party software (including open source software) that may
9 * accompany Microchip software.
10 *
11 * THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
12 * EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY IMPLIED
13 * WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A
14 * PARTICULAR PURPOSE.
15 *
16 * IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE,
17 * INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND
18 * WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP HAS
19 * BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO THE
20 * FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL CLAIMS IN
21 * ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF FEES, IF ANY,
22 * THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.
23 *******************************************************************************/
24 // DOM-IGNORE-END
25 
26 /*******************************************************************************
27  Module for Microchip Graphics Library - Legato User Interface Library
28 
29  Company:
30  Microchip Technology Inc.
31 
32  File Name:
33  legato_driver.h
34 
35  Summary:
36  Abstract display driver definition for the Legato graphics library.
37 
38  Description:
39  Abstract display driver definition for the Legato graphics library.
40 *******************************************************************************/
41 
49 #ifndef LEGATO_DRIVER_H
50 #define LEGATO_DRIVER_H
51 
53 
54 // *****************************************************************************
55 /* Structure:
56  struct leDisplayDriver
57 
58  Summary:
59  Defines the interface for a Legato display driver. All drivers must,
60  at a minimum, implement these interfaces
61 
62  getColorMode - returns the supported color mode for the driver
63 
64  getBufferCount - returns the number of buffers the driver is configured to use
65 
66  getDisplayWidth - returns the width of the driver frame buffer
67 
68  getDisplayHeight - returns the height of the driver frame buffer
69 
70  update - the driver tasks/update function
71 
72  getLayerCount - the number of hardware layers the driver supports
73 
74  getActiveLayer - the current active hardware layer
75 
76  setActiveLayer - sets the current active hardware layer
77  all buffer writes should go to this layer
78 
79  blitBuffer - instructs the driver to blit a buffer (buf) at
80  location (x, y)
81 
82  swap - instructs the driver to swap its buffer chain
83 
84  getVSYNCCount - queries the driver for its VSYNC counter
85  if a driver implements this counter this value
86  can be used to do frame rate calculations
87 
88 */
89 typedef struct leDisplayDriver
90 {
91  leColorMode (*getColorMode)(void);
92 
93  uint32_t (*getBufferCount)(void);
94 
95  uint32_t (*getDisplayWidth)(void);
96 
97  uint32_t (*getDisplayHeight)(void);
98 
99  void (*update)(void);
100 
101  uint32_t (*getLayerCount)(void);
102 
103  uint32_t (*getActiveLayer)(void);
104 
105  leResult (*setActiveLayer)(uint32_t idx);
106 
107  leResult (*blitBuffer)(int32_t x,
108  int32_t y,
109  lePixelBuffer* buf);
110 
111  void (*swap)(void);
112 
113  uint32_t (*getVSYNCCount)(void);
115 
116 #endif // LEGATO_H
Definition: legato_driver.h:89
leResult
This enum represents function call results.
Definition: legato_common.h:123
Pixel Buffer functions and definitions.
Definition: legato_pixelbuffer.h:90
leColorMode
This enum represents the supported RGB color formats.
Definition: legato_color.h:148