TI-OpenThread  1.08.06.06
LP_CC2652RSIP/thread/thermostat/graphicext.h
Go to the documentation of this file.
1 /******************************************************************************
2 
3  @file graphicext.h
4 
5  @brief Graphics extension APIs used for animations.
6 
7  Group: CMCU, LPC
8  Target Device: cc13xx_cc26xx
9 
10  ******************************************************************************
11 
12  Copyright (c) 2017-2022, Texas Instruments Incorporated
13  All rights reserved.
14 
15  Redistribution and use in source and binary forms, with or without
16  modification, are permitted provided that the following conditions
17  are met:
18 
19  * Redistributions of source code must retain the above copyright
20  notice, this list of conditions and the following disclaimer.
21 
22  * Redistributions in binary form must reproduce the above copyright
23  notice, this list of conditions and the following disclaimer in the
24  documentation and/or other materials provided with the distribution.
25 
26  * Neither the name of Texas Instruments Incorporated nor the names of
27  its contributors may be used to endorse or promote products derived
28  from this software without specific prior written permission.
29 
30  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
31  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
32  THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
33  PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
34  CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
36  PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
37  OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
38  WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
39  OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
40  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
41 
42  ******************************************************************************
43 
44 
45  *****************************************************************************/
46 #ifndef _GRAPHICEXT_H_
47 #define _GRAPHICEXT_H_
48 
49 #ifdef __cplusplus
50 extern "C"
51 {
52 #endif
53 
54 /******************************************************************************
55  Includes
56  *****************************************************************************/
57 /* grlib header defines `NDEBUG`, undefine here to avoid a compile warning */
58 #ifdef NDEBUG
59 #undef NDEBUG
60 #endif
61 
62 #include <ti/display/Display.h>
63 #include <ti/display/DisplayExt.h>
64 #include <ti/sysbios/knl/Event.h>
65 #include <ti/grlib/grlib.h>
66 
67 /******************************************************************************
68  Constants and Definitions
69  *****************************************************************************/
70 /* typedef to define a sprite with X,Y position and an image */
71 typedef struct
72 {
73  uint8_t posX;
74  uint8_t posY;
75  Graphics_Image *image;
77 
78 /******************************************************************************
79  External functions
80  *****************************************************************************/
89 void GraphicExt_initAnimationModule(Display_Handle *lcdHandle,
90  uint32_t frameDuration);
91 
103 void GraphicExt_animateBackground(Graphics_Image *frames, uint8_t startFrame,
104  uint8_t endFrame, bool continuous);
105 
111 void GraphicExt_stopAnimate(void);
112 
126  uint8_t spriteListLen,
127  bool overlayBackground);
128 
135 void GraphicExt_requestProcess(void);
136 
142 void GraphicExt_processEvt(void);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif /* _GRAPHICEXT_H_ */
void GraphicExt_initAnimationModule(Display_Handle *lcdHandle, uint32_t frameDuration)
Set up the animation timer.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.c:256
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.h:71
void GraphicExt_requestProcess(void)
Request processing of event.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/thermostat.c:827
void GraphicExt_drawSprites(GraphicExt_sprite_t *spriteList, uint8_t spriteListLen, bool overlayBackground)
Draws a list of sprites on the screen.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.c:318
void GraphicExt_processEvt(void)
Process an animation event.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.c:336
void GraphicExt_animateBackground(Graphics_Image *frames, uint8_t startFrame, uint8_t endFrame, bool continuous)
Displays an animation by switching through different frames.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.c:279
void GraphicExt_stopAnimate(void)
Stops a continuous animation.
Definition: CC1352P_2_LAUNCHXL/thread/thermostat/graphicext.c:302
© Copyright 1995-2022, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale