add BearPi STemWin test demo

This commit is contained in:
morixinguan
2021-01-30 11:26:41 +08:00
parent a01cf34ab8
commit 424b4f729c
190 changed files with 143893 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIConf.c
Purpose : Display controller initialization
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Define the available number of bytes available for the GUI
//
#define GUI_NUMBYTES 0x200000
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* GUI_X_Config
*
* Purpose:
* Called during the initialization process in order to set up the
* available memory for the GUI.
*/
void GUI_X_Config(void) {
//
// 32 bit aligned memory area
//
static U32 aMemory[GUI_NUMBYTES / 4];
//
// Assign memory to emWin
//
GUI_ALLOC_AssignMemory(aMemory, GUI_NUMBYTES);
//
// Set default font
//
GUI_SetDefaultFont(GUI_FONT_6X8);
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,96 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIConf.h
Purpose : Configures emWins abilities, fonts etc.
----------------------------------------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUICONF_H
#define GUICONF_H
/*********************************************************************
*
* Multi layer/display support
*/
#define GUI_NUM_LAYERS 2 // Maximum number of available layers
/*********************************************************************
*
* Multi tasking support
*/
#ifdef OS_SUPPORT
#define GUI_OS (1) // Compile with multitasking support
#else
#define GUI_OS (0)
#endif
/*********************************************************************
*
* Configuration of touch support
*/
#ifndef GUI_SUPPORT_TOUCH
#define GUI_SUPPORT_TOUCH (1) // Support touchscreen
#endif
/*********************************************************************
*
* Default font
*/
#define GUI_DEFAULT_FONT &GUI_Font6x8
/*********************************************************************
*
* Configuration of available packages
*/
#define GUI_SUPPORT_MOUSE (1) /* Support a mouse */
#define GUI_WINSUPPORT (1) /* Use window manager */
#define GUI_SUPPORT_MEMDEV (1) /* Memory device package available */
#define GUI_SUPPORT_DEVICES (1) /* Enable use of device pointers */
#endif /* Avoid multiple inclusion */

View File

@@ -0,0 +1,836 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Template.c
Purpose : Template driver, could be used as starting point for new
simple display drivers supporting only one color depth.
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include <stddef.h>
#include "LCD_Private.h"
#include "GUI_Private.h"
#include "LCD_ConfDefaults.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
/*********************************************************************
*
* Macros for MIRROR_, SWAP_ and LUT_
*/
#if (!defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
#if (!LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) y
#elif (!LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) y
#define LOG2PHYS_Y(x, y) x
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
#elif (!LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) y
#define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
#define LOG2PHYS_Y(x, y) y
#elif ( LCD_MIRROR_X && !LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
#define LOG2PHYS_Y(x, y) x
#elif ( LCD_MIRROR_X && LCD_MIRROR_Y && !LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_XSIZE - 1 - (x)
#define LOG2PHYS_Y(x, y) LCD_YSIZE - 1 - (y)
#elif ( LCD_MIRROR_X && LCD_MIRROR_Y && LCD_SWAP_XY)
#define LOG2PHYS_X(x, y) LCD_YSIZE - 1 - (y)
#define LOG2PHYS_Y(x, y) LCD_XSIZE - 1 - (x)
#endif
#else
#if ( defined (LCD_LUT_COM) && !defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) x
#define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
#elif (!defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
#define LOG2PHYS_Y(x, y) y
#elif ( defined (LCD_LUT_COM) && defined(LCD_LUT_SEG))
#define LOG2PHYS_X(x, y) LCD__aCol2Seg0[x]
#define LOG2PHYS_Y(x, y) LCD__aLine2Com0[y]
#endif
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct {
U32 VRAMAddr;
int xSize, ySize;
int vxSize, vySize;
int vxSizePhys;
int BitsPerPixel;
} DRIVER_CONTEXT_TEMPLATE;
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _SetPixelIndex
*
* Purpose:
* Sets the index of the given pixel. The upper layers
* calling this routine make sure that the coordinates are in range, so
* that no check on the parameters needs to be performed.
*/
static void _SetPixelIndex(GUI_DEVICE * pDevice, int x, int y, int PixelIndex) {
//
// Convert logical into physical coordinates (Dep. on LCDConf.h)
//
#if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
int xPhys, yPhys;
xPhys = LOG2PHYS_X(x, y);
yPhys = LOG2PHYS_Y(x, y);
#else
#define xPhys x
#define yPhys y
#endif
GUI_USE_PARA(pDevice);
GUI_USE_PARA(x);
GUI_USE_PARA(y);
GUI_USE_PARA(PixelIndex);
{
//
// Write into hardware ... Adapt to your system
//
// TBD by customer...
//
}
#if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
#undef xPhys
#undef yPhys
#endif
}
/*********************************************************************
*
* _GetPixelIndex
*
* Purpose:
* Returns the index of the given pixel. The upper layers
* calling this routine make sure that the coordinates are in range, so
* that no check on the parameters needs to be performed.
*/
static unsigned int _GetPixelIndex(GUI_DEVICE * pDevice, int x, int y) {
unsigned int PixelIndex;
//
// Convert logical into physical coordinates (Dep. on LCDConf.h)
//
#if (LCD_MIRROR_X == 1) || (LCD_MIRROR_Y == 1) || (LCD_SWAP_XY == 1)
int xPhys, yPhys;
xPhys = LOG2PHYS_X(x, y);
yPhys = LOG2PHYS_Y(x, y);
#else
#define xPhys x
#define yPhys y
#endif
GUI_USE_PARA(pDevice);
GUI_USE_PARA(x);
GUI_USE_PARA(y);
{
//
// Write into hardware ... Adapt to your system
//
// TBD by customer...
//
PixelIndex = 0;
}
#if (LCD_MIRROR_X == 0) && (LCD_MIRROR_Y == 0) && (LCD_SWAP_XY == 0)
#undef xPhys
#undef yPhys
#endif
return PixelIndex;
}
/*********************************************************************
*
* _XorPixel
*/
static void _XorPixel(GUI_DEVICE * pDevice, int x, int y) {
LCD_PIXELINDEX PixelIndex;
LCD_PIXELINDEX IndexMask;
PixelIndex = _GetPixelIndex(pDevice, x, y);
IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
_SetPixelIndex(pDevice, x, y, PixelIndex ^ IndexMask);
}
/*********************************************************************
*
* _FillRect
*/
static void _FillRect(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
LCD_PIXELINDEX PixelIndex;
int x;
PixelIndex = LCD__GetColorIndex();
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
for (; y0 <= y1; y0++) {
for (x = x0; x <= x1; x++) {
_XorPixel(pDevice, x, y0);
}
}
} else {
for (; y0 <= y1; y0++) {
for (x = x0; x <= x1; x++) {
_SetPixelIndex(pDevice, x, y0, PixelIndex);
}
}
}
}
/*********************************************************************
*
* _DrawHLine
*/
static void _DrawHLine(GUI_DEVICE * pDevice, int x0, int y, int x1) {
_FillRect(pDevice, x0, y, x1, y);
}
/*********************************************************************
*
* _DrawVLine, not optimized
*/
static void _DrawVLine(GUI_DEVICE * pDevice, int x, int y0, int y1) {
_FillRect(pDevice, x, y0, x, y1);
}
/*********************************************************************
*
* Draw Bitmap 1 BPP
*/
static void _DrawBitLine1BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
LCD_PIXELINDEX IndexMask, Index0, Index1, Pixel;
Index0 = *(pTrans + 0);
Index1 = *(pTrans + 1);
x += Diff;
switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
do {
_SetPixelIndex(pDevice, x++, y, (*p & (0x80 >> Diff)) ? Index1 : Index0);
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
case LCD_DRAWMODE_TRANS:
do {
if (*p & (0x80 >> Diff))
_SetPixelIndex(pDevice, x, y, Index1);
x++;
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
case LCD_DRAWMODE_XOR | LCD_DRAWMODE_TRANS:
case LCD_DRAWMODE_XOR:
IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
do {
if (*p & (0x80 >> Diff)) {
Pixel = _GetPixelIndex(pDevice, x, y);
_SetPixelIndex(pDevice, x, y, Pixel ^ IndexMask);
}
x++;
if (++Diff == 8) {
Diff = 0;
p++;
}
} while (--xsize);
break;
}
}
/*********************************************************************
*
* Draw Bitmap 2 BPP
*/
static void _DrawBitLine2BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
LCD_PIXELINDEX Pixels, PixelIndex;
int CurrentPixel, Shift, Index;
Pixels = *p;
CurrentPixel = Diff;
x += Diff;
switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
if (pTrans) {
do {
Shift = (3 - CurrentPixel) << 1;
Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
PixelIndex = *(pTrans + Index);
_SetPixelIndex(pDevice, x++, y, PixelIndex);
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
} else {
do {
Shift = (3 - CurrentPixel) << 1;
Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
_SetPixelIndex(pDevice, x++, y, Index);
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
}
break;
case LCD_DRAWMODE_TRANS:
if (pTrans) {
do {
Shift = (3 - CurrentPixel) << 1;
Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
if (Index) {
PixelIndex = *(pTrans + Index);
_SetPixelIndex(pDevice, x, y, PixelIndex);
}
x++;
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
} else {
do {
Shift = (3 - CurrentPixel) << 1;
Index = (Pixels & (0xC0 >> (6 - Shift))) >> Shift;
if (Index) {
_SetPixelIndex(pDevice, x, y, Index);
}
x++;
if (++CurrentPixel == 4) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
}
break;
}
}
/*********************************************************************
*
* Draw Bitmap 4 BPP
*/
static void _DrawBitLine4BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int Diff, int xsize, const LCD_PIXELINDEX * pTrans) {
LCD_PIXELINDEX Pixels, PixelIndex;
int CurrentPixel, Shift, Index;
Pixels = *p;
CurrentPixel = Diff;
x += Diff;
switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
if (pTrans) {
do {
Shift = (1 - CurrentPixel) << 2;
Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
PixelIndex = *(pTrans + Index);
_SetPixelIndex(pDevice, x++, y, PixelIndex);
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
} else {
do {
Shift = (1 - CurrentPixel) << 2;
Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
_SetPixelIndex(pDevice, x++, y, Index);
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
}
break;
case LCD_DRAWMODE_TRANS:
if (pTrans) {
do {
Shift = (1 - CurrentPixel) << 2;
Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
if (Index) {
PixelIndex = *(pTrans + Index);
_SetPixelIndex(pDevice, x, y, PixelIndex);
}
x++;
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
} else {
do {
Shift = (1 - CurrentPixel) << 2;
Index = (Pixels & (0xF0 >> (4 - Shift))) >> Shift;
if (Index) {
_SetPixelIndex(pDevice, x, y, Index);
}
x++;
if (++CurrentPixel == 2) {
CurrentPixel = 0;
Pixels = *(++p);
}
} while (--xsize);
}
break;
}
}
/*********************************************************************
*
* Draw Bitmap 8 BPP
*/
static void _DrawBitLine8BPP(GUI_DEVICE * pDevice, int x, int y, U8 const GUI_UNI_PTR * p, int xsize, const LCD_PIXELINDEX * pTrans) {
LCD_PIXELINDEX Pixel;
switch (GUI_pContext->DrawMode & (LCD_DRAWMODE_TRANS | LCD_DRAWMODE_XOR)) {
case 0:
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
_SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
_SetPixelIndex(pDevice, x, y, *p);
}
}
break;
case LCD_DRAWMODE_TRANS:
if (pTrans) {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
if (Pixel) {
_SetPixelIndex(pDevice, x, y, *(pTrans + Pixel));
}
}
} else {
for (; xsize > 0; xsize--, x++, p++) {
Pixel = *p;
if (Pixel) {
_SetPixelIndex(pDevice, x, y, Pixel);
}
}
}
break;
}
}
/*********************************************************************
*
* Draw Bitmap 16 BPP, not optimized
*
* Purpose:
* Drawing of 16bpp high color bitmaps.
* Only required for 16bpp color depth of target. Should be removed otherwise.
*/
static void _DrawBitLine16BPP(GUI_DEVICE * pDevice, int x, int y, U16 const GUI_UNI_PTR * p, int xsize) {
for (;xsize > 0; xsize--, x++, p++) {
_SetPixelIndex(pDevice, x, y, *p);
}
}
/*********************************************************************
*
* Draw Bitmap 32 BPP, not optimized
*
* Purpose:
* Drawing of 32bpp true color bitmaps.
* Only required for 32bpp color depth of target. Should be removed otherwise.
*/
static void _DrawBitLine32BPP(GUI_DEVICE * pDevice, int x, int y, U32 const GUI_UNI_PTR * p, int xsize) {
for (;xsize > 0; xsize--, x++, p++) {
_SetPixelIndex(pDevice, x, y, *p);
}
}
/*********************************************************************
*
* _DrawBitmap
*/
static void _DrawBitmap(GUI_DEVICE * pDevice, int x0, int y0,
int xSize, int ySize,
int BitsPerPixel,
int BytesPerLine,
const U8 GUI_UNI_PTR * pData, int Diff,
const LCD_PIXELINDEX * pTrans) {
int i;
switch (BitsPerPixel) {
case 1:
for (i = 0; i < ySize; i++) {
_DrawBitLine1BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
pData += BytesPerLine;
}
break;
case 2:
for (i = 0; i < ySize; i++) {
_DrawBitLine2BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
pData += BytesPerLine;
}
break;
case 4:
for (i = 0; i < ySize; i++) {
_DrawBitLine4BPP(pDevice, x0, i + y0, pData, Diff, xSize, pTrans);
pData += BytesPerLine;
}
break;
case 8:
for (i = 0; i < ySize; i++) {
_DrawBitLine8BPP(pDevice, x0, i + y0, pData, xSize, pTrans);
pData += BytesPerLine;
}
break;
//
// Only required for 16bpp color depth of target. Should be removed otherwise.
//
case 16:
for (i = 0; i < ySize; i++) {
_DrawBitLine16BPP(pDevice, x0, i + y0, (const U16 *)pData, xSize);
pData += BytesPerLine;
}
break;
//
// Only required for 32bpp color depth of target. Should be removed otherwise.
//
case 32:
for (i = 0; i < ySize; i++) {
_DrawBitLine32BPP(pDevice, x0, i + y0, (const U32 *)pData, xSize);
pData += BytesPerLine;
}
break;
}
}
/*********************************************************************
*
* _InitOnce
*
* Purpose:
* Allocates a fixed block for the context of the driver
*
* Return value:
* 0 on success, 1 on error
*/
static int _InitOnce(GUI_DEVICE * pDevice) {
DRIVER_CONTEXT_TEMPLATE * pContext;
if (pDevice->u.pContext == NULL) {
pDevice->u.pContext = GUI_ALLOC_GetFixedBlock(sizeof(DRIVER_CONTEXT_TEMPLATE));
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
pContext->BitsPerPixel = LCD__GetBPP(pDevice->pColorConvAPI->pfGetIndexMask());
}
return pDevice->u.pContext ? 0 : 1;
}
/*********************************************************************
*
* _GetDevProp
*/
static I32 _GetDevProp(GUI_DEVICE * pDevice, int Index) {
DRIVER_CONTEXT_TEMPLATE * pContext;
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
switch (Index) {
case LCD_DEVCAP_XSIZE:
return pContext->xSize;
case LCD_DEVCAP_YSIZE:
return pContext->ySize;
case LCD_DEVCAP_VXSIZE:
return pContext->vxSize;
case LCD_DEVCAP_VYSIZE:
return pContext->vySize;
case LCD_DEVCAP_BITSPERPIXEL:
return pContext->BitsPerPixel;
case LCD_DEVCAP_NUMCOLORS:
return 0;
case LCD_DEVCAP_XMAG:
return 1;
case LCD_DEVCAP_YMAG:
return 1;
case LCD_DEVCAP_MIRROR_X:
return 0;
case LCD_DEVCAP_MIRROR_Y:
return 0;
case LCD_DEVCAP_SWAP_XY:
return 0;
}
return -1;
}
/*********************************************************************
*
* _GetDevData
*/
static void * _GetDevData(GUI_DEVICE * pDevice, int Index) {
GUI_USE_PARA(pDevice);
#if GUI_SUPPORT_MEMDEV
switch (Index) {
case LCD_DEVDATA_MEMDEV:
return (void *)&GUI_MEMDEV_DEVICE_16; // TBD: Has to be adapted to the right memory device depending on the used color depth!
}
#else
GUI_USE_PARA(Index);
#endif
return NULL;
}
/*********************************************************************
*
* _GetRect
*/
static void _GetRect(GUI_DEVICE * pDevice, LCD_RECT * pRect) {
DRIVER_CONTEXT_TEMPLATE * pContext;
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
pRect->x0 = 0;
pRect->y0 = 0;
pRect->x1 = pContext->vxSize - 1;
pRect->y1 = pContext->vySize - 1;
}
/*********************************************************************
*
* _SetOrg
*/
static void _SetOrg(GUI_DEVICE * pDevice, int x, int y) {
LCD_X_SETORG_INFO Data = {0};
Data.xPos = x;
Data.yPos = y;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETORG, (void *)&Data);
}
/*********************************************************************
*
* Static code: Functions available by _GetDevFunc()
*
**********************************************************************
*/
/*********************************************************************
*
* _SetVRAMAddr
*/
static void _SetVRAMAddr(GUI_DEVICE * pDevice, void * pVRAM) {
DRIVER_CONTEXT_TEMPLATE * pContext;
LCD_X_SETVRAMADDR_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
pContext->VRAMAddr = (U32)pVRAM;
Data.pVRAM = pVRAM;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETVRAMADDR, (void *)&Data);
}
}
/*********************************************************************
*
* _SetVSize
*/
static void _SetVSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
DRIVER_CONTEXT_TEMPLATE * pContext;
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
pContext->vxSize = xSize;
pContext->vySize = ySize;
pContext->vxSizePhys = xSize;
}
}
/*********************************************************************
*
* _SetSize
*/
static void _SetSize(GUI_DEVICE * pDevice, int xSize, int ySize) {
DRIVER_CONTEXT_TEMPLATE * pContext;
LCD_X_SETSIZE_INFO Data = {0};
_InitOnce(pDevice);
if (pDevice->u.pContext) {
pContext = (DRIVER_CONTEXT_TEMPLATE *)pDevice->u.pContext;
pContext->vxSizePhys = (pContext->vxSizePhys == 0) ? xSize : pContext->vxSizePhys;
pContext->xSize = xSize;
pContext->ySize = ySize;
Data.xSize = xSize;
Data.ySize = ySize;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETSIZE, (void *)&Data);
}
}
/*********************************************************************
*
* _Init
*/
static int _Init(GUI_DEVICE * pDevice) {
int r;
r = _InitOnce(pDevice);
r |= LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_INITCONTROLLER, NULL);
return r;
}
/*********************************************************************
*
* _On
*/
static void _On (GUI_DEVICE * pDevice) {
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_ON, NULL);
}
/*********************************************************************
*
* _Off
*/
static void _Off (GUI_DEVICE * pDevice) {
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_OFF, NULL);
}
/*********************************************************************
*
* _SetLUTEntry
*/
static void _SetLUTEntry(GUI_DEVICE * pDevice, U8 Pos, LCD_COLOR Color) {
LCD_X_SETLUTENTRY_INFO Data = {0};
Data.Pos = Pos;
Data.Color = Color;
LCD_X_DisplayDriver(pDevice->LayerIndex, LCD_X_SETLUTENTRY, (void *)&Data);
}
/*********************************************************************
*
* _GetDevFunc
*/
static void (* _GetDevFunc(GUI_DEVICE ** ppDevice, int Index))(void) {
GUI_USE_PARA(ppDevice);
switch (Index) {
case LCD_DEVFUNC_SET_VRAM_ADDR:
return (void (*)(void))_SetVRAMAddr;
case LCD_DEVFUNC_SET_VSIZE:
return (void (*)(void))_SetVSize;
case LCD_DEVFUNC_SET_SIZE:
return (void (*)(void))_SetSize;
case LCD_DEVFUNC_INIT:
return (void (*)(void))_Init;
case LCD_DEVFUNC_ON:
return (void (*)(void))_On;
case LCD_DEVFUNC_OFF:
return (void (*)(void))_Off;
case LCD_DEVFUNC_SETLUTENTRY:
return (void (*)(void))_SetLUTEntry;
}
return NULL;
}
/*********************************************************************
*
* Public data
*
**********************************************************************
*/
/*********************************************************************
*
* GUI_DEVICE_API structure
*/
const GUI_DEVICE_API GUIDRV_Template_API = {
//
// Data
//
DEVICE_CLASS_DRIVER,
//
// Drawing functions
//
_DrawBitmap,
_DrawHLine,
_DrawVLine,
_FillRect,
_GetPixelIndex,
_SetPixelIndex,
_XorPixel,
//
// Set origin
//
_SetOrg,
//
// Request information
//
_GetDevFunc,
_GetDevProp,
_GetDevData,
_GetRect,
};
/*************************** End of file ****************************/

View File

@@ -0,0 +1,73 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Template.h
Purpose : Interface definition for GUIDRV_Template driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_TEMPLATE_H
#define GUIDRV_TEMPLATE_H
/*********************************************************************
*
* Display drivers
*/
//
// Addresses
//
extern const GUI_DEVICE_API GUIDRV_Template_API;
//
// Macro to be used in configuration files
//
#define GUIDRV_TEMPLATE &GUIDRV_Template_API
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,236 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf_FlexColor_Template.c
Purpose : Display controller configuration (single layer)
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI.h"
#include "GUIDRV_FlexColor.h"
/*********************************************************************
*
* Layer configuration (to be modified)
*
**********************************************************************
*/
//
// Physical display size
//
#define XSIZE_PHYS 240 // To be adapted to x-screen size
#define YSIZE_PHYS 320 // To be adapted to y-screen size
/*********************************************************************
*
* Configuration checking
*
**********************************************************************
*/
#ifndef VXSIZE_PHYS
#define VXSIZE_PHYS XSIZE_PHYS
#endif
#ifndef VYSIZE_PHYS
#define VYSIZE_PHYS YSIZE_PHYS
#endif
#ifndef XSIZE_PHYS
#error Physical X size of display is not defined!
#endif
#ifndef YSIZE_PHYS
#error Physical Y size of display is not defined!
#endif
#ifndef GUICC_565
#error Color conversion not defined!
#endif
#ifndef GUIDRV_FLEXCOLOR
#error No display driver defined!
#endif
/*********************************************************************
*
* Local functions
*
**********************************************************************
*/
/********************************************************************
*
* LcdWriteReg
*
* Function description:
* Sets display register
*/
static void LcdWriteReg(U16 Data) {
// ... TBD by user
}
/********************************************************************
*
* LcdWriteData
*
* Function description:
* Writes a value to a display register
*/
static void LcdWriteData(U16 Data) {
// ... TBD by user
}
/********************************************************************
*
* LcdWriteDataMultiple
*
* Function description:
* Writes multiple values to a display register.
*/
static void LcdWriteDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
// ... TBD by user
}
}
/********************************************************************
*
* LcdReadDataMultiple
*
* Function description:
* Reads multiple values from a display register.
*/
static void LcdReadDataMultiple(U16 * pData, int NumItems) {
while (NumItems--) {
// ... TBD by user
}
}
/*********************************************************************
*
* Public functions
*
**********************************************************************
*/
/*********************************************************************
*
* LCD_X_Config
*
* Function description:
* Called during the initialization process in order to set up the
* display driver configuration.
*
*/
void LCD_X_Config(void) {
GUI_DEVICE * pDevice;
CONFIG_FLEXCOLOR Config = {0};
GUI_PORT_API PortAPI = {0};
//
// Set display driver and color conversion
//
pDevice = GUI_DEVICE_CreateAndLink(GUIDRV_FLEXCOLOR, GUICC_565, 0, 0);
//
// Display driver configuration, required for Lin-driver
//
LCD_SetSizeEx (0, XSIZE_PHYS , YSIZE_PHYS);
LCD_SetVSizeEx(0, VXSIZE_PHYS, VYSIZE_PHYS);
//
// Orientation
//
Config.Orientation = GUI_SWAP_XY | GUI_MIRROR_Y;
GUIDRV_FlexColor_Config(pDevice, &Config);
//
// Set controller and operation mode
//
PortAPI.pfWrite16_A0 = LcdWriteReg;
PortAPI.pfWrite16_A1 = LcdWriteData;
PortAPI.pfWriteM16_A1 = LcdWriteDataMultiple;
PortAPI.pfReadM16_A1 = LcdReadDataMultiple;
GUIDRV_FlexColor_SetFunc(pDevice, &PortAPI, GUIDRV_FLEXCOLOR_F66708, GUIDRV_FLEXCOLOR_M16C0B16);
}
/*********************************************************************
*
* LCD_X_DisplayDriver
*
* Function description:
* This function is called by the display driver for several purposes.
* To support the according task the routine needs to be adapted to
* the display controller. Please note that the commands marked with
* 'optional' are not cogently required and should only be adapted if
* the display controller supports these features.
*
* Parameter:
* LayerIndex - Index of layer to be configured
* Cmd - Please refer to the details in the switch statement below
* pData - Pointer to a LCD_X_DATA structure
*
* Return Value:
* < -1 - Error
* -1 - Command not handled
* 0 - Ok
*/
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
int r;
(void) LayerIndex;
(void) pData;
switch (Cmd) {
case LCD_X_INITCONTROLLER: {
//
// Called during the initialization process in order to set up the
// display controller and put it into operation. If the display
// controller is not initialized by any external routine this needs
// to be adapted by the customer...
//
// ...
return 0;
}
default:
r = -1;
}
return r;
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,59 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf_FlexColor_Template.h
Purpose : Display driver configuration file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LCDCONF_H
#define LCDCONF_H
#endif /* LCDCONF_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,262 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf_Lin_Template.c
Purpose : Display controller configuration (single layer)
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI.h"
#include "GUIDRV_Lin.h"
/*********************************************************************
*
* Layer configuration (to be modified)
*
**********************************************************************
*/
//
// Physical display size
//
#define XSIZE_PHYS 320
#define YSIZE_PHYS 240
//
// Color conversion
//
#define COLOR_CONVERSION GUICC_8888
//
// Display driver
//
#define DISPLAY_DRIVER GUIDRV_WIN32
//
// Buffers / VScreens
//
#define NUM_BUFFERS 1 // Number of multiple buffers to be used
#define NUM_VSCREENS 1 // Number of virtual screens to be used
/*********************************************************************
*
* Configuration checking
*
**********************************************************************
*/
#ifndef VRAM_ADDR
#define VRAM_ADDR 0 // TBD by customer: This has to be the frame buffer start address
#endif
#ifndef XSIZE_PHYS
#error Physical X size of display is not defined!
#endif
#ifndef YSIZE_PHYS
#error Physical Y size of display is not defined!
#endif
#ifndef COLOR_CONVERSION
#error Color conversion not defined!
#endif
#ifndef DISPLAY_DRIVER
#error No display driver defined!
#endif
#ifndef NUM_VSCREENS
#define NUM_VSCREENS 1
#else
#if (NUM_VSCREENS <= 0)
#error At least one screeen needs to be defined!
#endif
#endif
#if (NUM_VSCREENS > 1) && (NUM_BUFFERS > 1)
#error Virtual screens and multiple buffers are not allowed!
#endif
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* LCD_X_Config
*
* Purpose:
* Called during the initialization process in order to set up the
* display driver configuration.
*
*/
void LCD_X_Config(void) {
//
// At first initialize use of multiple buffers on demand
//
#if (NUM_BUFFERS > 1)
GUI_MULTIBUF_Config(NUM_BUFFERS);
#endif
//
// Set display driver and color conversion for 1st layer
//
GUI_DEVICE_CreateAndLink(DISPLAY_DRIVER, COLOR_CONVERSION, 0, 0);
//
// Display driver configuration, required for Lin-driver
//
if (LCD_GetSwapXY()) {
LCD_SetSizeEx (0, YSIZE_PHYS, XSIZE_PHYS);
LCD_SetVSizeEx(0, YSIZE_PHYS * NUM_VSCREENS, XSIZE_PHYS);
} else {
LCD_SetSizeEx (0, XSIZE_PHYS, YSIZE_PHYS);
LCD_SetVSizeEx(0, XSIZE_PHYS, YSIZE_PHYS * NUM_VSCREENS);
}
LCD_SetVRAMAddrEx(0, (void *)VRAM_ADDR);
//
// Set user palette data (only required if no fixed palette is used)
//
#if defined(PALETTE)
LCD_SetLUTEx(0, PALETTE);
#endif
//
// Set custom functions for several operations to optimize native processes
//
LCD_SetDevFunc(0, LCD_DEVFUNC_COPYBUFFER, (void(*)(void))CUSTOM_LCD_CopyBuffer);
LCD_SetDevFunc(0, LCD_DEVFUNC_COPYRECT, (void(*)(void))CUSTOM_LCD_CopyRect);
LCD_SetDevFunc(0, LCD_DEVFUNC_FILLRECT, (void(*)(void))CUSTOM_LCD_FillRect);
LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_8BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap8bpp);
LCD_SetDevFunc(0, LCD_DEVFUNC_DRAWBMP_16BPP, (void(*)(void))CUSTOM_LCD_DrawBitmap16bpp);
}
/*********************************************************************
*
* LCD_X_DisplayDriver
*
* Purpose:
* This function is called by the display driver for several purposes.
* To support the according task the routine needs to be adapted to
* the display controller. Please note that the commands marked with
* 'optional' are not cogently required and should only be adapted if
* the display controller supports these features.
*
* Parameter:
* LayerIndex - Index of layer to be configured
* Cmd - Please refer to the details in the switch statement below
* pData - Pointer to a LCD_X_DATA structure
*
* Return Value:
* < -1 - Error
* -1 - Command not handled
* 0 - Ok
*/
int LCD_X_DisplayDriver(unsigned LayerIndex, unsigned Cmd, void * pData) {
int r;
switch (Cmd) {
case LCD_X_INITCONTROLLER: {
//
// Called during the initialization process in order to set up the
// display controller and put it into operation. If the display
// controller is not initialized by any external routine this needs
// to be adapted by the customer...
//
// ...
return 0;
}
case LCD_X_SETVRAMADDR: {
//
// Required for setting the address of the video RAM for drivers
// with memory mapped video RAM which is passed in the 'pVRAM' element of p
//
LCD_X_SETVRAMADDR_INFO * p;
p = (LCD_X_SETVRAMADDR_INFO *)pData;
//...
return 0;
}
case LCD_X_SETORG: {
//
// Required for setting the display origin which is passed in the 'xPos' and 'yPos' element of p
//
LCD_X_SETORG_INFO * p;
p = (LCD_X_SETORG_INFO *)pData;
//...
return 0;
}
case LCD_X_SHOWBUFFER: {
//
// Required if multiple buffers are used. The 'Index' element of p contains the buffer index.
//
LCD_X_SHOWBUFFER_INFO * p;
p = (LCD_X_SHOWBUFFER_INFO *)pData;
//...
return 0;
}
case LCD_X_SETLUTENTRY: {
//
// Required for setting a lookup table entry which is passed in the 'Pos' and 'Color' element of p
//
LCD_X_SETLUTENTRY_INFO * p;
p = (LCD_X_SETLUTENTRY_INFO *)pData;
//...
return 0;
}
case LCD_X_ON: {
//
// Required if the display controller should support switching on and off
//
return 0;
}
case LCD_X_OFF: {
//
// Required if the display controller should support switching on and off
//
// ...
return 0;
}
default:
r = -1;
}
return r;
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,59 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.30 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : LCDConf_Lin_Template.h
Purpose : Display driver configuration file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef LCDCONF_H
#define LCDCONF_H
#endif /* LCDCONF_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,71 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with a license and should not be re-
distributed in any way. We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : SIMConf.c
Purpose : Windows Simulator configuration
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifdef WIN32
#include "LCD_SIM.h"
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* SIM_X_Config
*
* Purpose:
* Called during the initialization process in order to configure
* the simulator.
*/
void SIM_X_Config() {
SIM_GUI_SetTransColor(0xff0000); // Define the transparent color
}
#else
void SIMConf_C(void); // Avoid empty object files
void SIMConf_C(void) {}
#endif
/*************************** End of file ****************************/

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,123 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_X.C
Purpose : Config / System dependent externals for GUI
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUI.h"
/*********************************************************************
*
* Global data
*/
volatile GUI_TIMER_TIME OS_TimeMS;
/*********************************************************************
*
* Timing:
* GUI_X_GetTime()
* GUI_X_Delay(int)
Some timing dependent routines require a GetTime
and delay function. Default time unit (tick), normally is
1 ms.
*/
GUI_TIMER_TIME GUI_X_GetTime(void) {
return OS_TimeMS;
}
void GUI_X_Delay(int ms) {
int tEnd = OS_TimeMS + ms;
while ((tEnd - OS_TimeMS) > 0);
}
/*********************************************************************
*
* GUI_X_Init()
*
* Note:
* GUI_X_Init() is called from GUI_Init is a possibility to init
* some hardware which needs to be up and running before the GUI.
* If not required, leave this routine blank.
*/
void GUI_X_Init(void) {}
/*********************************************************************
*
* GUI_X_ExecIdle
*
* Note:
* Called if WM is in idle state
*/
void GUI_X_ExecIdle(void) {}
/*********************************************************************
*
* Logging: OS dependent
Note:
Logging is used in higher debug levels only. The typical target
build does not use logging and does therefor not require any of
the logging routines below. For a release build without logging
the routines below may be eliminated to save some space.
(If the linker is not function aware and eliminates unreferenced
functions automatically)
*/
void GUI_X_Log (const char *s) { GUI_USE_PARA(s); }
void GUI_X_Warn (const char *s) { GUI_USE_PARA(s); }
void GUI_X_ErrorOut(const char *s) { GUI_USE_PARA(s); }
/*************************** End of file ****************************/

View File

@@ -0,0 +1,192 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUI_X.C
Purpose : This file provides emWin Interface with FreeRTOS
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include "GUI.h"
/* FreeRTOS include files */
#include "cmsis_os.h"
/*********************************************************************
*
* Global data
*/
static osMutexId osMutex;
static osSemaphoreId osSemaphore;
/*********************************************************************
*
* Timing:
* GUI_X_GetTime()
* GUI_X_Delay(int)
Some timing dependent routines require a GetTime
and delay function. Default time unit (tick), normally is
1 ms.
*/
int GUI_X_GetTime(void)
{
return ((int) xTaskGetTickCount());
}
void GUI_X_Delay(int ms)
{
vTaskDelay( ms );
}
/*********************************************************************
*
* GUI_X_Init()
*
* Note:
* GUI_X_Init() is called from GUI_Init is a possibility to init
* some hardware which needs to be up and running before the GUI.
* If not required, leave this routine blank.
*/
void GUI_X_Init(void) {
}
/*********************************************************************
*
* GUI_X_ExecIdle
*
* Note:
* Called if WM is in idle state
*/
void GUI_X_ExecIdle(void) {}
/*********************************************************************
*
* Multitasking:
*
* GUI_X_InitOS()
* GUI_X_GetTaskId()
* GUI_X_Lock()
* GUI_X_Unlock()
*
* Note:
* The following routines are required only if emWin is used in a
* true multi task environment, which means you have more than one
* thread using the emWin API.
* In this case the
* #define GUI_OS 1
* needs to be in GUIConf.h
*/
/* Init OS */
void GUI_X_InitOS(void)
{
/* Create Mutex lock */
osMutexDef(MUTEX);
/* Create the Mutex used by the two threads */
osMutex = osMutexCreate(osMutex(MUTEX));
/* Create Semaphore lock */
osSemaphoreDef(SEM);
/* Create the Semaphore used by the two threads */
osSemaphore= osSemaphoreCreate(osSemaphore(SEM), 1);
}
void GUI_X_Unlock(void)
{
osMutexRelease(osMutex);
}
void GUI_X_Lock(void)
{
osMutexWait(osMutex , osWaitForever) ;
}
/* Get Task handle */
U32 GUI_X_GetTaskId(void)
{
return ((U32) osThreadGetId());
}
void GUI_X_WaitEvent (void)
{
osSemaphoreWait(osSemaphore , osWaitForever) ;
}
void GUI_X_SignalEvent (void)
{
osMutexRelease(osSemaphore);
}
/*********************************************************************
*
* Logging: OS dependent
Note:
Logging is used in higher debug levels only. The typical target
build does not use logging and does therefor not require any of
the logging routines below. For a release build without logging
the routines below may be eliminated to save some space.
(If the linker is not function aware and eliminates unreferenced
functions automatically)
*/
void GUI_X_Log (const char *s) { }
void GUI_X_Warn (const char *s) { }
void GUI_X_ErrorOut(const char *s) { }
/*************************** End of file ****************************/

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,75 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
----------------------------------------------------------------------
File : WinMain.c
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include <windows.h>
#include "GUI_SIM_Win32.h"
/*********************************************************************
*
* Public data
*
**********************************************************************
*/
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
/*********************************************************************
*
* WinMain
*/
int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) {
return SIM_GUI_App(hInstance, hPrevInstance, lpCmdLine, nCmdShow);
}
/*************************** End of file ****************************/

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,21 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: <X_SIZE>x<Y_SIZE>.bat
*
* Purpose: This file simply calls MakeMovie.bat with its own file name
* as parameter %2 which defines the resolution used by FFmpeg
* to create the JPEG files.
* By copying and renaming this file further resolutions can
* be simply achieved.
*
* Note: The file name of this file needs to match the size
* specification parameter '-s' for FFmpeg.exe.
*
******************************************************************************
:START
@%~dp0MakeMovie.bat %1 %~n0

View File

@@ -0,0 +1,83 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: MakeMovie.bat
*
* Parameters: 4 (3 optional)
* %1: Movie file to be converted
* %2: Size
* %3: Quality
* %4: Framerate
*
* Requirement: The free available tool FFmpeg is required for the conversion
* operation. FFmpeg is available under the following link:
*
* http://www.ffmpeg.org/
*
* Please note that Prep.bat needs to be adapted before using
* MakeMovie.bat.
*
* This file (MakeMovie.bat) normally do not need to be modified.
*
* Purpose: This batch file converts a video file to an (E)mWin (M)ovie (F)ile.
* It first uses FFmpeg for converting the given movie into single
* JPEG files. After that the emWin tool JPEG2Movie is used to
* convert these images into an emWin movie file.
*
* For details about all supported file types and the parameters
* resolution, quality and frame rate please refer to the FFmpeg
* documentation.
*
* Output: A copy of the converted file will be copied into the folder of
* the source file. The file name will be the same as the source file
* with a size postfix and the extension '.emf' (emWin movie file).
*
******************************************************************************
:START
CALL %~dp0PREP.BAT
IF "%2" == "" GOTO CONT2
SET SIZE=%2
GOTO NEXT2
:CONT2
SET SIZE=%DEFAULT_SIZE%
:NEXT2
IF "%3" == "" GOTO CONT3
SET QUALITY=%3
GOTO NEXT3
:CONT3
SET QUALITY=%DEFAULT_QUALITY%
:NEXT3
IF "%4" == "" GOTO CONT4
SET FRAMERATE=%4
GOTO NEXT4
:CONT4
SET FRAMERATE=%DEFAULT_FRAMERATE%
:NEXT4
DEL /Q "%OUTPUT%*.*"
"%FFMPEG%" -y -i %1 -r %FRAMERATE% -q %QUALITY% -s %SIZE% -f image2 -pix_fmt yuvj420p "%OUTPUT%img-%%05d.jpeg"
"%JPEG2MOVIE%" "%OUTPUT%"
IF ERRORLEVEL 1 GOTO ERROR
GOTO NOERROR
:ERROR
ECHO Error using JPEG2Movie!
PAUSE
:NOERROR
COPY /B %OUTPUT%*.emf %~dp1%~n1_%SIZE%.emf
SET SIZE=
SET QUALITY=
SET FRAMERATE=
SET FOLDER=
SET FFMPEG=
SET JPEG2MOVIE=

View File

@@ -0,0 +1,50 @@
@ECHO OFF
GOTO START
******************************************************************************
*
* File: Prep.bat
*
* Parameters: none
*
* Purpose: This batch file is called by MakeMovie.bat and sets the default
* values for working folder, FFmpeg and JPEG2MOVIE path. It needs
* to be adapted before MakeMovie.bat can be used.
*
******************************************************************************
:START
REM **************************************************************************
REM
REM Configuration: Default values for size, quality and framerate
REM
REM **************************************************************************
SET DEFAULT_SIZE=320x240
SET DEFAULT_QUALITY=5
SET DEFAULT_FRAMERATE=25
REM **************************************************************************
REM
REM Configuration: Working folder
REM
REM **************************************************************************
SET OUTPUT=C:\Movie\Output\
REM **************************************************************************
REM
REM Configuration: FFmpeg
REM
REM **************************************************************************
SET FFMPEG=C:\FFmpeg\ffmpeg.exe
REM **************************************************************************
REM
REM Configuration: JPEG2Movie
REM
REM **************************************************************************
SET JPEG2MOVIE=C:\Movie\JPEG2Movie.exe

Binary file not shown.

View File

@@ -0,0 +1,224 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : BUTTON.h
Purpose : BUTTON public header file (API)
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef BUTTON_H
#define BUTTON_H
#include "WM.h"
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
#include "WIDGET.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Create flags
*/
/* For compatibility only ! */
#define BUTTON_CF_HIDE WM_CF_HIDE
#define BUTTON_CF_SHOW WM_CF_SHOW
#define BUTTON_CF_MEMDEV WM_CF_MEMDEV
/*********************************************************************
*
* Color indices
*/
#define BUTTON_CI_UNPRESSED 0
#define BUTTON_CI_PRESSED 1
#define BUTTON_CI_DISABLED 2
/*********************************************************************
*
* Bitmap indices
*/
#define BUTTON_BI_UNPRESSED 0
#define BUTTON_BI_PRESSED 1
#define BUTTON_BI_DISABLED 2
/*********************************************************************
*
* States
*/
#define BUTTON_STATE_FOCUS WIDGET_STATE_FOCUS
#define BUTTON_STATE_PRESSED WIDGET_STATE_USER0
/*********************************************************************
*
* Skinning property indices
*/
#define BUTTON_SKINFLEX_PI_PRESSED 0
#define BUTTON_SKINFLEX_PI_FOCUSSED 1
#define BUTTON_SKINFLEX_PI_ENABLED 2
#define BUTTON_SKINFLEX_PI_DISABLED 3
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef WM_HMEM BUTTON_Handle;
typedef struct {
GUI_COLOR aColorFrame[3];
GUI_COLOR aColorUpper[2];
GUI_COLOR aColorLower[2];
int Radius;
} BUTTON_SKINFLEX_PROPS;
/*********************************************************************
*
* Create function(s)
Note: the parameters to a create function may vary.
Some widgets may have multiple create functions
*/
BUTTON_Handle BUTTON_Create (int x0, int y0, int xSize, int ySize, int ID, int Flags);
BUTTON_Handle BUTTON_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
BUTTON_Handle BUTTON_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
BUTTON_Handle BUTTON_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
BUTTON_Handle BUTTON_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
GUI_COLOR BUTTON_GetDefaultBkColor (unsigned Index);
const GUI_FONT * BUTTON_GetDefaultFont (void);
int BUTTON_GetDefaultTextAlign (void);
GUI_COLOR BUTTON_GetDefaultTextColor (unsigned Index);
void BUTTON_SetDefaultBkColor (GUI_COLOR Color, unsigned Index);
GUI_COLOR BUTTON_SetDefaultFocusColor(GUI_COLOR Color);
void BUTTON_SetDefaultFont (const GUI_FONT * pFont);
void BUTTON_SetDefaultTextAlign (int Align);
void BUTTON_SetDefaultTextColor (GUI_COLOR Color, unsigned Index);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void BUTTON_Callback(WM_MESSAGE *pMsg);
/*********************************************************************
*
* Member functions
*
**********************************************************************
*/
GUI_COLOR BUTTON_GetBkColor (BUTTON_Handle hObj, unsigned int Index);
const GUI_BITMAP * BUTTON_GetBitmap(BUTTON_Handle hObj,unsigned int Index);
const GUI_FONT * BUTTON_GetFont (BUTTON_Handle hObj);
GUI_COLOR BUTTON_GetFrameColor (BUTTON_Handle hObj);
WIDGET * BUTTON_GetpWidget (BUTTON_Handle hObj);
void BUTTON_GetText (BUTTON_Handle hObj, char * pBuffer, int MaxLen);
GUI_COLOR BUTTON_GetTextColor (BUTTON_Handle hObj, unsigned int Index);
int BUTTON_GetTextAlign (BUTTON_Handle hObj);
int BUTTON_GetUserData (BUTTON_Handle hObj, void * pDest, int NumBytes);
unsigned BUTTON_IsPressed (BUTTON_Handle hObj);
void BUTTON_SetBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap);
void BUTTON_SetBitmapEx (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP * pBitmap, int x, int y);
void BUTTON_SetBkColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color);
void BUTTON_SetBMP (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap);
void BUTTON_SetBMPEx (BUTTON_Handle hObj, unsigned int Index, const void * pBitmap, int x, int y);
void BUTTON_SetFont (BUTTON_Handle hObj, const GUI_FONT * pfont);
void BUTTON_SetFrameColor (BUTTON_Handle hObj, GUI_COLOR Color);
void BUTTON_SetState (BUTTON_Handle hObj, int State); /* Not to be doc. */
void BUTTON_SetPressed (BUTTON_Handle hObj, int State);
GUI_COLOR BUTTON_SetFocusColor (BUTTON_Handle hObj, GUI_COLOR Color);
void BUTTON_SetFocussable (BUTTON_Handle hObj, int State);
void BUTTON_SetStreamedBitmap (BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap);
void BUTTON_SetStreamedBitmapEx(BUTTON_Handle hObj, unsigned int Index, const GUI_BITMAP_STREAM * pBitmap, int x, int y);
int BUTTON_SetText (BUTTON_Handle hObj, const char* s);
void BUTTON_SetTextAlign (BUTTON_Handle hObj, int Align);
void BUTTON_SetTextColor (BUTTON_Handle hObj, unsigned int Index, GUI_COLOR Color);
void BUTTON_SetTextOffset (BUTTON_Handle hObj, int xPos, int yPos);
void BUTTON_SetSelfDrawEx (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw, int x, int y); /* Not to be doc. */
void BUTTON_SetSelfDraw (BUTTON_Handle hObj, unsigned int Index, GUI_DRAW_SELF_CB * pDraw); /* Not to be doc. */
void BUTTON_SetReactOnLevel (void);
void BUTTON_SetReactOnTouch (void);
int BUTTON_SetUserData (BUTTON_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* Member functions: Skinning
*
**********************************************************************
*/
void BUTTON_GetSkinFlexProps (BUTTON_SKINFLEX_PROPS * pProps, int Index);
void BUTTON_SetSkinClassic (BUTTON_Handle hObj);
void BUTTON_SetSkin (BUTTON_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
int BUTTON_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void BUTTON_SetSkinFlexProps (const BUTTON_SKINFLEX_PROPS * pProps, int Index);
void BUTTON_SetDefaultSkinClassic(void);
WIDGET_DRAW_ITEM_FUNC * BUTTON_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
#define BUTTON_SKIN_FLEX BUTTON_DrawSkinFlex
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // BUTTON_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,146 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : BUTTON_Private.h
Purpose : BUTTON private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef BUTTON_PRIVATE_H
#define BUTTON_PRIVATE_H
#include "WM.h"
#include "BUTTON.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#ifndef BUTTON_3D_MOVE_X
#define BUTTON_3D_MOVE_X 1
#endif
#ifndef BUTTON_3D_MOVE_Y
#define BUTTON_3D_MOVE_Y 1
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} BUTTON_SKIN_PRIVATE;
typedef struct {
GUI_COLOR aBkColor[3];
GUI_COLOR aTextColor[3];
GUI_COLOR FocusColor;
GUI_COLOR FrameColor;
const GUI_FONT * pFont;
BUTTON_SKIN_PRIVATE SkinPrivate;
I16 Align;
I16 xPosText, yPosText;
} BUTTON_PROPS;
typedef struct {
WIDGET Widget;
BUTTON_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WM_HMEM hpText;
WM_HMEM ahDrawObj[3];
} BUTTON_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define BUTTON_INIT_ID(p) (p->Widget.DebugId = BUTTON_ID)
#else
#define BUTTON_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
BUTTON_Obj * BUTTON_LockH(BUTTON_Handle h);
#define BUTTON_LOCK_H(h) BUTTON_LockH(h)
#else
#define BUTTON_LOCK_H(h) (BUTTON_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern BUTTON_PROPS BUTTON__DefaultProps;
extern const WIDGET_SKIN BUTTON__SkinClassic;
extern WIDGET_SKIN BUTTON__Skin;
extern WIDGET_SKIN const * BUTTON__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void BUTTON__SetDrawObj(BUTTON_Handle hObj, int Index, GUI_DRAW_HANDLE hDrawObj);
#endif /* GUI_WINSUPPORT */
#endif /* BUTTON_H */

View File

@@ -0,0 +1,171 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CALENDAR.h
Purpose : Message box interface
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CALENDAR_H
#define CALENDAR_H
#include "WM.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define CALENDAR_CI_WEEKEND 0
#define CALENDAR_CI_WEEKDAY 1
#define CALENDAR_CI_SEL 2
#define CALENDAR_CI_HEADER 3
#define CALENDAR_CI_MONTH 4
#define CALENDAR_CI_LABEL 5
#define CALENDAR_CI_FRAME 6
#define CALENDAR_FI_CONTENT 0
#define CALENDAR_FI_HEADER 1
#define CALENDAR_SI_HEADER 0
#define CALENDAR_SI_CELL_X 1
#define CALENDAR_SI_CELL_Y 2
/*********************************************************************
*
* Notification codes
*
* The following is the list of notification codes specific to this widget,
* Send with the WM_NOTIFY_PARENT message
*/
#define CALENDAR_NOTIFICATION_MONTH_CLICKED (WM_NOTIFICATION_WIDGET + 0)
#define CALENDAR_NOTIFICATION_MONTH_RELEASED (WM_NOTIFICATION_WIDGET + 1)
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/*********************************************************************
*
* CALENDAR_DATE
*/
typedef struct {
int Year;
int Month;
int Day;
} CALENDAR_DATE;
/*********************************************************************
*
* CALENDAR_SKINFLEX_PROPS
*/
typedef struct {
GUI_COLOR aColorFrame[3]; // Frame colors of buttons
GUI_COLOR aColorUpper[2]; // Upper gradient colors of buttons
GUI_COLOR aColorLower[2]; // Lower gradient colors of buttons
GUI_COLOR ColorArrow; // Arrow colors
} CALENDAR_SKINFLEX_PROPS;
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
WM_HWIN CALENDAR_Create (WM_HWIN hParent, int xPos, int yPos, unsigned Year, unsigned Month, unsigned Day, unsigned FirstDayOfWeek, int Id, int Flags);
void CALENDAR_GetDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
void CALENDAR_GetSel (WM_HWIN hWin, CALENDAR_DATE * pDate);
void CALENDAR_SetDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
void CALENDAR_SetSel (WM_HWIN hWin, CALENDAR_DATE * pDate);
void CALENDAR_ShowDate (WM_HWIN hWin, CALENDAR_DATE * pDate);
/*********************************************************************
*
* Default related
*/
void CALENDAR_SetDefaultBkColor(unsigned Index, GUI_COLOR Color);
void CALENDAR_SetDefaultColor (unsigned Index, GUI_COLOR Color);
void CALENDAR_SetDefaultDays (const char ** apDays);
void CALENDAR_SetDefaultFont (unsigned Index, const GUI_FONT * pFont);
void CALENDAR_SetDefaultMonths (const char ** apMonths);
void CALENDAR_SetDefaultSize (unsigned Index, unsigned Size);
/*********************************************************************
*
* Skinning related
*/
void CALENDAR_GetSkinFlexProps (CALENDAR_SKINFLEX_PROPS * pProps, int Index);
void CALENDAR_SetSkinFlexProps (const CALENDAR_SKINFLEX_PROPS * pProps, int Index);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void CALENDAR_Callback(WM_MESSAGE * pMsg);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // CALENDAR_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,218 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHECKBOX.h
Purpose : CHECKBOX include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CHECKBOX_H
#define CHECKBOX_H
#include "WM.h"
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
#include "WIDGET.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
/*********************************************************************
*
* Color indices
*/
#define CHECKBOX_CI_DISABLED 0
#define CHECKBOX_CI_ENABLED 1
/*********************************************************************
*
* Bitmap indices
*/
#define CHECKBOX_BI_INACTIV_UNCHECKED 0
#define CHECKBOX_BI_ACTIV_UNCHECKED 1
#define CHECKBOX_BI_INACTIV_CHECKED 2
#define CHECKBOX_BI_ACTIV_CHECKED 3
#define CHECKBOX_BI_INACTIV_3STATE 4
#define CHECKBOX_BI_ACTIV_3STATE 5
/*********************************************************************
*
* Skinning property indices
*/
#define CHECKBOX_SKINFLEX_PI_ENABLED 0
#define CHECKBOX_SKINFLEX_PI_DISABLED 1
/*********************************************************************
*
* Public Types
*
**********************************************************************
*/
typedef WM_HMEM CHECKBOX_Handle;
typedef struct {
GUI_COLOR aColorFrame[3];
GUI_COLOR aColorInner[2];
GUI_COLOR ColorCheck;
int ButtonSize;
} CHECKBOX_SKINFLEX_PROPS;
/*********************************************************************
*
* Create functions
*
**********************************************************************
*/
CHECKBOX_Handle CHECKBOX_Create (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags);
CHECKBOX_Handle CHECKBOX_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
CHECKBOX_Handle CHECKBOX_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
CHECKBOX_Handle CHECKBOX_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void CHECKBOX_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
int CHECKBOX_GetDefaultAlign (void);
GUI_COLOR CHECKBOX_GetDefaultBkColor (void);
const GUI_FONT * CHECKBOX_GetDefaultFont (void);
int CHECKBOX_GetDefaultSpacing (void);
int CHECKBOX_GetDefaultTextAlign (void);
GUI_COLOR CHECKBOX_GetDefaultTextColor (void);
int CHECKBOX_GetUserData (CHECKBOX_Handle hObj, void * pDest, int NumBytes);
void CHECKBOX_SetDefaultAlign (int Align);
void CHECKBOX_SetDefaultBkColor (GUI_COLOR Color);
GUI_COLOR CHECKBOX_SetDefaultFocusColor(GUI_COLOR Color);
void CHECKBOX_SetDefaultFont (const GUI_FONT * pFont);
void CHECKBOX_SetDefaultImage (const GUI_BITMAP * pBitmap, unsigned int Index);
void CHECKBOX_SetDefaultSpacing (int Spacing);
void CHECKBOX_SetDefaultTextAlign (int Align);
void CHECKBOX_SetDefaultTextColor (GUI_COLOR Color);
/*********************************************************************
*
* Member functions
*
**********************************************************************
*/
int CHECKBOX_GetState (CHECKBOX_Handle hObj);
int CHECKBOX_GetText (CHECKBOX_Handle hObj, char * pBuffer, int MaxLen);
int CHECKBOX_IsChecked (CHECKBOX_Handle hObj);
void CHECKBOX_SetBkColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
GUI_COLOR CHECKBOX_SetBoxBkColor(CHECKBOX_Handle hObj, GUI_COLOR Color, int Index);
GUI_COLOR CHECKBOX_SetFocusColor(CHECKBOX_Handle hObj, GUI_COLOR Color);
void CHECKBOX_SetFont (CHECKBOX_Handle hObj, const GUI_FONT * pFont);
void CHECKBOX_SetImage (CHECKBOX_Handle hObj, const GUI_BITMAP * pBitmap, unsigned int Index);
void CHECKBOX_SetNumStates (CHECKBOX_Handle hObj, unsigned NumStates);
void CHECKBOX_SetSpacing (CHECKBOX_Handle hObj, unsigned Spacing);
void CHECKBOX_SetState (CHECKBOX_Handle hObj, unsigned State);
void CHECKBOX_SetText (CHECKBOX_Handle hObj, const char * pText);
void CHECKBOX_SetTextAlign (CHECKBOX_Handle hObj, int Align);
void CHECKBOX_SetTextColor (CHECKBOX_Handle hObj, GUI_COLOR Color);
int CHECKBOX_SetUserData (CHECKBOX_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* Member functions: Skinning
*
**********************************************************************
*/
void CHECKBOX_GetSkinFlexProps (CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
void CHECKBOX_SetSkinClassic (CHECKBOX_Handle hObj);
void CHECKBOX_SetSkin (CHECKBOX_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
int CHECKBOX_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void CHECKBOX_SetSkinFlexProps (const CHECKBOX_SKINFLEX_PROPS * pProps, int Index);
void CHECKBOX_SetDefaultSkinClassic (void);
int CHECKBOX_GetSkinFlexButtonSize (CHECKBOX_Handle hObj);
void CHECKBOX_SetSkinFlexButtonSize (CHECKBOX_Handle hObj, int ButtonSize);
WIDGET_DRAW_ITEM_FUNC * CHECKBOX_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
#define CHECKBOX_SKIN_FLEX CHECKBOX_DrawSkinFlex
/*********************************************************************
*
* Macros for compatibility
*
**********************************************************************
*/
#define CHECKBOX_Check(hObj) CHECKBOX_SetState(hObj, 1)
#define CHECKBOX_Uncheck(hObj) CHECKBOX_SetState(hObj, 0)
#define CHECKBOX_BI_INACTIV CHECKBOX_BI_INACTIV_CHECKED
#define CHECKBOX_BI_ACTIV CHECKBOX_BI_ACTIV_CHECKED
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // CHECKBOX_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,173 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHECKBOX_Private.h
Purpose : CHECKBOX private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CHECKBOX_PRIVATE_H
#define CHECKBOX_PRIVATE_H
#include "WM.h"
#include "WIDGET.h"
#include "CHECKBOX.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#ifndef CHECKBOX_BKCOLOR0_DEFAULT
#define CHECKBOX_BKCOLOR0_DEFAULT 0x808080 /* Inactive color */
#endif
#ifndef CHECKBOX_BKCOLOR1_DEFAULT
#define CHECKBOX_BKCOLOR1_DEFAULT GUI_WHITE /* Active color */
#endif
#ifndef CHECKBOX_FGCOLOR0_DEFAULT
#define CHECKBOX_FGCOLOR0_DEFAULT 0x101010
#endif
#ifndef CHECKBOX_FGCOLOR1_DEFAULT
#define CHECKBOX_FGCOLOR1_DEFAULT GUI_BLACK
#endif
#ifndef CHECKBOX_DEFAULT_SIZE
#define CHECKBOX_DEFAULT_SIZE 15
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
unsigned (* pfGetButtonSize)(void);
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} CHECKBOX_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBkColorBox[2]; /* Colors used to draw the box background */
GUI_COLOR BkColor; /* Widget background color */
GUI_COLOR TextColor;
GUI_COLOR FocusColor;
CHECKBOX_SKIN_PRIVATE SkinPrivate;
I16 Align;
U8 Spacing;
const GUI_BITMAP * apBm[6];
} CHECKBOX_PROPS;
typedef struct {
WIDGET Widget;
CHECKBOX_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
U8 NumStates;
U8 CurrentState;
WM_HMEM hpText;
U32 ButtonSize;
} CHECKBOX_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define CHECKBOX_INIT_ID(p) (p->Widget.DebugId = CHECKBOX_ID)
#else
#define CHECKBOX_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
CHECKBOX_Obj * CHECKBOX_LockH(CHECKBOX_Handle h);
#define CHECKBOX_LOCK_H(h) CHECKBOX_LockH(h)
#else
#define CHECKBOX_LOCK_H(h) (CHECKBOX_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
unsigned CHECKBOX__GetButtonSize(void);
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern CHECKBOX_PROPS CHECKBOX__DefaultProps;
extern const WIDGET_SKIN CHECKBOX__SkinClassic;
extern WIDGET_SKIN CHECKBOX__Skin;
extern WIDGET_SKIN const * CHECKBOX__pSkinDefault;
/*********************************************************************
*
* Extern data
*
**********************************************************************
*/
extern const GUI_BITMAP CHECKBOX__abmCheck[2];
#endif /* GUI_WINSUPPORT */
#endif /* CHECKBOX_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,149 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHOOSECOLOR.h
Purpose : Message box interface
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CHOOSECOLOR_H
#define CHOOSECOLOR_H
#include "WM.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define CHOOSECOLOR_CF_MOVEABLE FRAMEWIN_CF_MOVEABLE
#define CHOOSECOLOR_CI_FRAME 0
#define CHOOSECOLOR_CI_FOCUS 1
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/*********************************************************************
*
* CHOOSECOLOR_PROPS
*/
typedef struct {
unsigned aBorder[2];
unsigned aSpace[2];
unsigned aButtonSize[2];
GUI_COLOR aColor[2];
} CHOOSECOLOR_PROPS;
/*********************************************************************
*
* CHOOSECOLOR_CONTEXT
*/
typedef struct {
U32 LastColor;
const GUI_COLOR * pColor;
unsigned NumColors;
unsigned NumColorsPerLine;
int SelOld;
int Sel;
WM_HWIN hParent;
CHOOSECOLOR_PROPS Props;
} CHOOSECOLOR_CONTEXT;
/*********************************************************************
*
* Public code
*
**********************************************************************
*/
WM_HWIN CHOOSECOLOR_Create(WM_HWIN hParent,
int xPos,
int yPos,
int xSize,
int ySize,
const GUI_COLOR * pColor,
unsigned NumColors,
unsigned NumColorsPerLine,
int Sel,
const char * sCaption,
int Flags);
int CHOOSECOLOR_GetSel(WM_HWIN hObj);
void CHOOSECOLOR_SetSel(WM_HWIN hObj, int Sel);
void CHOOSECOLOR_SetDefaultColor (unsigned Index, GUI_COLOR Color);
void CHOOSECOLOR_SetDefaultSpace (unsigned Index, unsigned Space);
void CHOOSECOLOR_SetDefaultBorder (unsigned Index, unsigned Border);
void CHOOSECOLOR_SetDefaultButtonSize(unsigned Index, unsigned ButtonSize);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void CHOOSECOLOR_Callback(WM_MESSAGE * pMsg);
#if defined(__cplusplus)
}
#endif
#endif /* GUI_WINSUPPORT */
#endif /* CHOOSECOLOR_H */

View File

@@ -0,0 +1,144 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : CHOOSEFILE.h
Purpose : File dialog interface
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef CHOOSEFILE_H
#define CHOOSEFILE_H
#include "WM.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define CHOOSEFILE_FINDFIRST 0
#define CHOOSEFILE_FINDNEXT 1
#define CHOOSEFILE_FLAG_DIRECTORY (1 << 0)
#ifndef CHOOSEFILE_MAXLEN
#define CHOOSEFILE_MAXLEN 256
#endif
#define CHOOSEFILE_BI_CANCEL 0
#define CHOOSEFILE_BI_OK 1
#define CHOOSEFILE_BI_UP 2
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/*********************************************************************
*
* CHOOSEFILE_INFO
*/
typedef struct CHOOSEFILE_INFO CHOOSEFILE_INFO;
struct CHOOSEFILE_INFO {
int Cmd; // Command for GetData() function
int Id; // Id of pressed button (for internal use only)
const char * pMask; // Mask to be used for searching files
char * pName; // (for internal use only)
char * pExt; // (for internal use only)
char * pAttrib; // (for internal use only)
WM_TOOLTIP_HANDLE hToolTip; // (for internal use only)
U32 SizeL; // FileSize low word
U32 SizeH; // FileSize high word
U32 Flags; // File flags
char pRoot[CHOOSEFILE_MAXLEN]; // Buffer used internally and for passing result
int (* pfGetData)(CHOOSEFILE_INFO * pInfo); // Pointer to GetData() function
};
/*********************************************************************
*
* Functions
*
**********************************************************************
*/
WM_HWIN CHOOSEFILE_Create(WM_HWIN hParent, // Parent window
int xPos, // xPosition in window coordinates
int yPos, // yPosition in window coordinates
int xSize, // xSize in pixels
int ySize, // ySize in pixels
const char * apRoot[], // Pointers to root strings
int NumRoot, // Number of roots
int SelRoot, // Root to be selected at first
const char * sCaption, // Shown in title bar
int Flags, // Flags for FRAMEWINDOW
CHOOSEFILE_INFO * pInfo // Pointer to CHOOSEFILE_INFO structure
);
void CHOOSEFILE_Callback (WM_MESSAGE * pMsg);
void CHOOSEFILE_EnableToolTips (void);
void CHOOSEFILE_SetButtonText (WM_HWIN hWin, unsigned ButtonIndex, const char * pText);
void CHOOSEFILE_SetDefaultButtonText(unsigned ButtonIndex, const char * pText);
void CHOOSEFILE_SetDelim (char Delim);
void CHOOSEFILE_SetToolTips (const TOOLTIP_INFO * pInfo, int NumItems);
void CHOOSEFILE_SetTopMode (unsigned OnOff);
#if defined(__cplusplus)
}
#endif
#endif /* GUI_WINSUPPORT */
#endif /* CHOOSEFILE_H */

View File

@@ -0,0 +1,113 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : Dialog.h
Purpose : Dialog box include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef DIALOG_H
#define DIALOG_H
#include "WM.h"
#include "BUTTON.h"
#include "CALENDAR.h"
#include "CHECKBOX.h"
#include "CHOOSECOLOR.h"
#include "CHOOSEFILE.h"
#include "DROPDOWN.h"
#include "EDIT.h"
#include "FRAMEWIN.h"
#include "GRAPH.h"
#include "HEADER.h"
#include "ICONVIEW.h"
#include "IMAGE.h"
#include "LISTBOX.h"
#include "LISTVIEW.h"
#include "LISTWHEEL.h"
#include "MENU.h"
#include "MULTIEDIT.h"
#include "MULTIPAGE.h"
#include "PROGBAR.h"
#include "RADIO.h"
#include "SCROLLBAR.h"
#include "SLIDER.h"
#include "SPINBOX.h"
#include "TEXT.h"
#include "TREEVIEW.h"
#include "KNOB.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* WINDOW API
*/
WM_HWIN WINDOW_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb);
WM_HWIN WINDOW_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, WM_CALLBACK * cb, int NumExtraBytes);
WM_HWIN WINDOW_CreateIndirect (const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
GUI_COLOR WINDOW_GetDefaultBkColor(void);
int WINDOW_GetUserData (WM_HWIN hObj, void * pDest, int NumBytes);
void WINDOW_SetBkColor (WM_HWIN hObj, GUI_COLOR Color);
void WINDOW_SetDefaultBkColor(GUI_COLOR Color);
int WINDOW_SetUserData (WM_HWIN hObj, const void * pSrc, int NumBytes);
void WINDOW_Callback(WM_MESSAGE * pMsg);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // DIALOG_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,120 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : Dialog.h
Purpose : Dialog box include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef DIALOG_INTERN_H
#define DIALOG_INTERN_H
#include "WM.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { // Make sure we have C-declarations in C++ programs
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct GUI_WIDGET_CREATE_INFO_struct GUI_WIDGET_CREATE_INFO;
typedef WM_HWIN GUI_WIDGET_CREATE_FUNC (const GUI_WIDGET_CREATE_INFO * pCreate, WM_HWIN hWin, int x0, int y0, WM_CALLBACK * cb);
/*********************************************************************
*
* Structures
*
**********************************************************************
*/
struct GUI_WIDGET_CREATE_INFO_struct {
GUI_WIDGET_CREATE_FUNC * pfCreateIndirect;
const char * pName; // Text ... Not used on all widgets
I16 Id; // ID ... should be unique in a dialog
I16 x0; // x position
I16 y0; // y position
I16 xSize; // x size
I16 ySize; // y size
U16 Flags; // Widget specific create flags (opt.)
I32 Para; // Widget specific parameter (opt.)
U32 NumExtraBytes; // Number of extra bytes usable with <WIDGET>_SetUserData & <WIDGET>_GetUserData
};
/*********************************************************************
*
* Public API functions
*
**********************************************************************
*/
WM_HWIN GUI_CreateDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0);
void GUI_EndDialog (WM_HWIN hWin, int r);
int GUI_ExecDialogBox (const GUI_WIDGET_CREATE_INFO * paWidget, int NumWidgets, WM_CALLBACK * cb, WM_HWIN hParent, int x0, int y0);
int GUI_ExecCreatedDialog (WM_HWIN hDialog);
WM_DIALOG_STATUS * GUI_GetDialogStatusPtr(WM_HWIN hDialog); // Not to be documented
void GUI_SetDialogStatusPtr(WM_HWIN hDialog, WM_DIALOG_STATUS * pDialogStatus); // Not to be documented
/*********************************************************************
*
* Obsolete
*/
LCD_COLOR DIALOG_GetBkColor(void);
LCD_COLOR DIALOG_SetBkColor(LCD_COLOR BkColor);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // DIALOG_INTERN_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,211 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : DROPDOWN.h
Purpose : Multiple choice object include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef DROPDOWN_H
#define DROPDOWN_H
#include "WM.h"
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
#include "LISTBOX.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/************************************************************
*
* Create flags
*/
#define DROPDOWN_CF_AUTOSCROLLBAR (1 << 0)
#define DROPDOWN_CF_UP (1 << 1)
/*********************************************************************
*
* Color indices
*/
#define DROPDOWN_CI_UNSEL 0
#define DROPDOWN_CI_SEL 1
#define DROPDOWN_CI_SELFOCUS 2
#define DROPDOWN_CI_ARROW 0
#define DROPDOWN_CI_BUTTON 1
/*********************************************************************
*
* Skinning property indices
*/
#define DROPDOWN_SKINFLEX_PI_EXPANDED 0
#define DROPDOWN_SKINFLEX_PI_FOCUSSED 1
#define DROPDOWN_SKINFLEX_PI_ENABLED 2
#define DROPDOWN_SKINFLEX_PI_DISABLED 3
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef WM_HMEM DROPDOWN_Handle;
typedef struct {
GUI_COLOR aColorFrame[3];
GUI_COLOR aColorUpper[2];
GUI_COLOR aColorLower[2];
GUI_COLOR ColorArrow;
GUI_COLOR ColorText;
GUI_COLOR ColorSep;
int Radius;
} DROPDOWN_SKINFLEX_PROPS;
/*********************************************************************
*
* Create functions
*
**********************************************************************
*/
DROPDOWN_Handle DROPDOWN_Create (WM_HWIN hWinParent, int x0, int y0, int xSize, int ySize, int Flags);
DROPDOWN_Handle DROPDOWN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
DROPDOWN_Handle DROPDOWN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
DROPDOWN_Handle DROPDOWN_CreateIndirect(const GUI_WIDGET_CREATE_INFO* pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK* cb);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void DROPDOWN_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Member functions
*
**********************************************************************
*/
void DROPDOWN_AddKey (DROPDOWN_Handle hObj, int Key);
void DROPDOWN_AddString (DROPDOWN_Handle hObj, const char* s);
void DROPDOWN_Collapse (DROPDOWN_Handle hObj);
void DROPDOWN_DecSel (DROPDOWN_Handle hObj);
void DROPDOWN_DecSelExp (DROPDOWN_Handle hObj);
void DROPDOWN_DeleteItem (DROPDOWN_Handle hObj, unsigned int Index);
void DROPDOWN_Expand (DROPDOWN_Handle hObj);
unsigned DROPDOWN_GetItemDisabled (DROPDOWN_Handle hObj, unsigned Index);
unsigned DROPDOWN_GetItemSpacing (DROPDOWN_Handle hObj);
int DROPDOWN_GetItemText (DROPDOWN_Handle hObj, unsigned Index, char * pBuffer, int MaxSize);
LISTBOX_Handle DROPDOWN_GetListbox (DROPDOWN_Handle hObj);
int DROPDOWN_GetNumItems (DROPDOWN_Handle hObj);
int DROPDOWN_GetSel (DROPDOWN_Handle hObj);
int DROPDOWN_GetSelExp (DROPDOWN_Handle hObj);
int DROPDOWN_GetUserData (DROPDOWN_Handle hObj, void * pDest, int NumBytes);
void DROPDOWN_IncSel (DROPDOWN_Handle hObj);
void DROPDOWN_IncSelExp (DROPDOWN_Handle hObj);
void DROPDOWN_InsertString (DROPDOWN_Handle hObj, const char* s, unsigned int Index);
void DROPDOWN_SetAutoScroll (DROPDOWN_Handle hObj, int OnOff);
void DROPDOWN_SetBkColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR color);
void DROPDOWN_SetColor (DROPDOWN_Handle hObj, unsigned int Index, GUI_COLOR Color);
void DROPDOWN_SetFont (DROPDOWN_Handle hObj, const GUI_FONT * pfont);
void DROPDOWN_SetItemDisabled (DROPDOWN_Handle hObj, unsigned Index, int OnOff);
void DROPDOWN_SetItemSpacing (DROPDOWN_Handle hObj, unsigned Value);
int DROPDOWN_SetListHeight (DROPDOWN_Handle hObj, unsigned Height);
void DROPDOWN_SetScrollbarColor(DROPDOWN_Handle hObj, unsigned Index, GUI_COLOR Color);
void DROPDOWN_SetScrollbarWidth(DROPDOWN_Handle hObj, unsigned Width);
void DROPDOWN_SetSel (DROPDOWN_Handle hObj, int Sel);
void DROPDOWN_SetSelExp (DROPDOWN_Handle hObj, int Sel);
void DROPDOWN_SetTextAlign (DROPDOWN_Handle hObj, int Align);
void DROPDOWN_SetTextColor (DROPDOWN_Handle hObj, unsigned int index, GUI_COLOR color);
void DROPDOWN_SetTextHeight (DROPDOWN_Handle hObj, unsigned TextHeight);
int DROPDOWN_SetUpMode (DROPDOWN_Handle hObj, int OnOff);
int DROPDOWN_SetUserData (DROPDOWN_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* Member functions: Skinning
*
**********************************************************************
*/
void DROPDOWN_GetSkinFlexProps (DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
void DROPDOWN_SetSkinClassic (DROPDOWN_Handle hObj);
void DROPDOWN_SetSkin (DROPDOWN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
int DROPDOWN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void DROPDOWN_SetSkinFlexProps (const DROPDOWN_SKINFLEX_PROPS * pProps, int Index);
void DROPDOWN_SetDefaultSkinClassic(void);
WIDGET_DRAW_ITEM_FUNC * DROPDOWN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
#define DROPDOWN_SKIN_FLEX DROPDOWN_DrawSkinFlex
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
GUI_COLOR DROPDOWN_GetDefaultBkColor (int Index);
GUI_COLOR DROPDOWN_GetDefaultColor (int Index);
const GUI_FONT * DROPDOWN_GetDefaultFont (void);
GUI_COLOR DROPDOWN_GetDefaultScrollbarColor(int Index);
void DROPDOWN_SetDefaultFont (const GUI_FONT * pFont);
GUI_COLOR DROPDOWN_SetDefaultBkColor (int Index, GUI_COLOR Color);
GUI_COLOR DROPDOWN_SetDefaultColor (int Index, GUI_COLOR Color);
GUI_COLOR DROPDOWN_SetDefaultScrollbarColor(int Index, GUI_COLOR Color);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // DROPDOWN_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,154 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : DROPDOWN_Private.h
Purpose : DROPDOWN private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef DROPDOWN_PRIVATE_H
#define DROPDOWN_PRIVATE_H
#include "DROPDOWN.h"
#include "WIDGET.h"
#include "GUI_ARRAY.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define DROPDOWN_SF_AUTOSCROLLBAR DROPDOWN_CF_AUTOSCROLLBAR
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} DROPDOWN_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBackColor[3];
GUI_COLOR aTextColor[3];
GUI_COLOR aColor[2];
GUI_COLOR aScrollbarColor[3];
DROPDOWN_SKIN_PRIVATE SkinPrivate;
I16 TextBorderSize;
I16 Align;
} DROPDOWN_PROPS;
typedef struct {
WIDGET Widget;
I16 Sel; // Current selection
I16 ySizeLB; // ySize of assigned LISTBOX in expanded state
I16 TextHeight;
GUI_ARRAY Handles;
WM_SCROLL_STATE ScrollState;
DROPDOWN_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WM_HWIN hListWin;
U8 Flags;
U16 ItemSpacing;
U8 ScrollbarWidth;
char IsPressed;
WM_HMEM hDisabled;
} DROPDOWN_Obj;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define DROPDOWN_INIT_ID(p) (p->Widget.DebugId = DROPDOWN_ID)
#else
#define DROPDOWN_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
DROPDOWN_Obj * DROPDOWN_LockH(DROPDOWN_Handle h);
#define DROPDOWN_LOCK_H(h) DROPDOWN_LockH(h)
#else
#define DROPDOWN_LOCK_H(h) (DROPDOWN_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Private (module internal) data
*
**********************************************************************
*/
extern DROPDOWN_PROPS DROPDOWN__DefaultProps;
extern const WIDGET_SKIN DROPDOWN__SkinClassic;
extern WIDGET_SKIN DROPDOWN__Skin;
extern WIDGET_SKIN const * DROPDOWN__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void DROPDOWN__AdjustHeight(DROPDOWN_Handle hObj);
int DROPDOWN__GetNumItems (DROPDOWN_Obj * pObj);
const char * DROPDOWN__GetpItemLocked(DROPDOWN_Handle hObj, int Index);
#endif // GUI_WINSUPPORT
#endif // DROPDOWN_PRIVATE_H

View File

@@ -0,0 +1,236 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : EDIT.h
Purpose : EDIT include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef EDIT_H
#define EDIT_H
#include "WM.h"
#include "DIALOG_Intern.h" // Required for Create indirect data structure
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { // Make sure we have C-declarations in C++ programs
#endif
/*********************************************************************
*
* Defaults for configuration switches
*
* The following are defaults for config switches which affect the
* interface specified in this module
*
**********************************************************************
*/
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Create / Status flags
//
#define EDIT_CF_LEFT GUI_TA_LEFT
#define EDIT_CF_RIGHT GUI_TA_RIGHT
#define EDIT_CF_HCENTER GUI_TA_HCENTER
#define EDIT_CF_VCENTER GUI_TA_VCENTER
#define EDIT_CF_TOP GUI_TA_TOP
#define EDIT_CF_BOTTOM GUI_TA_BOTTOM
//
// Color indices
//
#define EDIT_CI_DISABLED 0
#define EDIT_CI_ENABLED 1
#define EDIT_CI_CURSOR 2
//
// Signed or normal mode
//
#define GUI_EDIT_NORMAL (0 << 0)
#define GUI_EDIT_SIGNED (1 << 0)
#define GUI_EDIT_SUPPRESS_LEADING_ZEROES (1 << 1)
//
// Cursor coloring
//
#define GUI_EDIT_SHOWCURSOR (1 << 2)
#define GUI_EDIT_CUSTCOLORMODE (1 << 3)
//
// Edit modes
//
#define GUI_EDIT_MODE_INSERT 0
#define GUI_EDIT_MODE_OVERWRITE 1
//
// Compatibility macros
//
#define EDIT_CI_DISABELD EDIT_CI_DISABLED
#define EDIT_CI_ENABELD EDIT_CI_ENABLED
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef WM_HMEM EDIT_Handle;
typedef void tEDIT_AddKeyEx (EDIT_Handle hObj, int Key);
typedef void tEDIT_UpdateBuffer(EDIT_Handle hObj);
/*********************************************************************
*
* Create functions
*/
EDIT_Handle EDIT_Create (int x0, int y0, int xSize, int ySize, int Id, int MaxLen, int Flags);
EDIT_Handle EDIT_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int Id, int Flags, int MaxLen);
EDIT_Handle EDIT_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen);
EDIT_Handle EDIT_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int MaxLen, int NumExtraBytes);
EDIT_Handle EDIT_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void EDIT_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
void EDIT_SetDefaultBkColor (unsigned int Index, GUI_COLOR Color);
void EDIT_SetDefaultFont (const GUI_FONT * pFont);
void EDIT_SetDefaultTextAlign(int Align);
void EDIT_SetDefaultTextColor(unsigned int Index, GUI_COLOR Color);
/*********************************************************************
*
* Individual member functions
*/
//
// Query preferences
//
GUI_COLOR EDIT_GetDefaultBkColor(unsigned int Index);
const GUI_FONT * EDIT_GetDefaultFont(void);
int EDIT_GetDefaultTextAlign(void);
GUI_COLOR EDIT_GetDefaultTextColor(unsigned int Index);
//
// Methods changing properties
//
void EDIT_AddKey (EDIT_Handle hObj, int Key);
void EDIT_EnableBlink (EDIT_Handle hObj, int Period, int OnOff);
GUI_COLOR EDIT_GetBkColor (EDIT_Handle hObj, unsigned int Index);
void EDIT_SetBkColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR color);
void EDIT_SetCursorAtChar (EDIT_Handle hObj, int Pos);
void EDIT_SetCursorAtPixel (EDIT_Handle hObj, int xPos);
void EDIT_SetFocussable (EDIT_Handle hObj, int State);
void EDIT_SetFont (EDIT_Handle hObj, const GUI_FONT * pFont);
int EDIT_SetInsertMode (EDIT_Handle hObj, int OnOff);
void EDIT_SetMaxLen (EDIT_Handle hObj, int MaxLen);
void EDIT_SetpfAddKeyEx (EDIT_Handle hObj, tEDIT_AddKeyEx * pfAddKeyEx);
void EDIT_SetpfUpdateBuffer(EDIT_Handle hObj, tEDIT_UpdateBuffer * pfUpdateBuffer);
void EDIT_SetText (EDIT_Handle hObj, const char * s);
void EDIT_SetTextAlign (EDIT_Handle hObj, int Align);
GUI_COLOR EDIT_GetTextColor(EDIT_Handle hObj, unsigned int Index);
void EDIT_SetTextColor (EDIT_Handle hObj, unsigned int Index, GUI_COLOR Color);
void EDIT_SetSel (EDIT_Handle hObj, int FirstChar, int LastChar);
int EDIT_SetUserData (EDIT_Handle hObj, const void * pSrc, int NumBytes);
int EDIT_EnableInversion (EDIT_Handle hObj, int OnOff);
//
// Get/Set user input
//
int EDIT_GetCursorCharPos (EDIT_Handle hObj);
void EDIT_GetCursorPixelPos (EDIT_Handle hObj, int * pxPos, int * pyPos);
float EDIT_GetFloatValue (EDIT_Handle hObj);
const GUI_FONT * EDIT_GetFont(EDIT_Handle hObj);
int EDIT_GetNumChars (EDIT_Handle hObj);
void EDIT_GetText (EDIT_Handle hObj, char * sDest, int MaxLen);
I32 EDIT_GetValue (EDIT_Handle hObj);
void EDIT_SetFloatValue (EDIT_Handle hObj, float Value);
int EDIT_GetUserData (EDIT_Handle hObj, void * pDest, int NumBytes);
void EDIT_SetValue (EDIT_Handle hObj, I32 Value);
/*********************************************************************
*
* Routines for editing values
*
**********************************************************************
*/
void EDIT_SetHexMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
void EDIT_SetBinMode (EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
void EDIT_SetDecMode (EDIT_Handle hEdit, I32 Value, I32 Min, I32 Max, int Shift, U8 Flags);
void EDIT_SetFloatMode(EDIT_Handle hEdit, float Value, float Min, float Max, int Shift, U8 Flags);
void EDIT_SetTextMode (EDIT_Handle hEdit);
void EDIT_SetUlongMode(EDIT_Handle hEdit, U32 Value, U32 Min, U32 Max);
U32 GUI_EditHex (U32 Value, U32 Min, U32 Max, int Len, int xSize);
U32 GUI_EditBin (U32 Value, U32 Min, U32 Max, int Len, int xSize);
I32 GUI_EditDec (I32 Value, I32 Min, I32 Max, int Len, int xSize, int Shift, U8 Flags);
float GUI_EditFloat (float Value, float Min, float Max, int Len, int xSize, int Shift, U8 Flags);
void GUI_EditString (char * pString, int Len, int xSize);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // EDIT_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,152 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : EDIT_Private.h
Purpose : Internal header file
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef EDIT_PRIVATE_H
#define EDIT_PRIVATE_H
#include "EDIT.h"
#if GUI_WINSUPPORT
#include "WIDGET.h"
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define EDIT_REALLOC_SIZE 16
#ifndef EDIT_XOFF
#define EDIT_XOFF 1
#endif
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct EDIT_Obj_struct EDIT_Obj;
typedef struct {
int Align;
int Border;
const GUI_FONT * pFont;
GUI_COLOR aTextColor[3];
GUI_COLOR aBkColor[3];
} EDIT_PROPS;
struct EDIT_Obj_struct {
WIDGET Widget;
WM_HMEM hpText;
I16 MaxLen;
U16 BufferSize;
I32 Min, Max; // Min max values as normalized floats (integers)
U8 NumDecs; // Number of decimals
I32 CurrentValue; // Current value
int CursorPos; // Cursor position. 0 means left most
unsigned SelSize; // Number of selected characters
U8 EditMode; // Insert or overwrite mode
U8 XSizeCursor; // Size of cursor when working in insert mode
U8 Flags;
tEDIT_AddKeyEx * pfAddKeyEx; // Handle key input
tEDIT_UpdateBuffer * pfUpdateBuffer; // Update textbuffer
EDIT_PROPS Props;
WM_HTIMER hTimer;
U8 MinMaxMode;
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define EDIT_INIT_ID(p) (p->Widget.DebugId = EDIT_ID)
#else
#define EDIT_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
EDIT_Obj * EDIT_LockH(EDIT_Handle h);
#define EDIT_LOCK_H(h) EDIT_LockH(h)
#else
#define EDIT_LOCK_H(h) (EDIT_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern EDIT_PROPS EDIT__DefaultProps;
/*********************************************************************
*
* Public functions (internal)
*
**********************************************************************
*/
U16 EDIT__GetCurrentChar (EDIT_Obj * pObj);
void EDIT__SetCursorPos (EDIT_Handle hObj, int CursorPos);
void EDIT__SetValueUnsigned(EDIT_Handle hObj, I32 Value);
#endif // GUI_WINSUPPORT
#endif // EDIT_PRIVATE_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,274 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : FRAMEWIN.h
Purpose : Frame window include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef FRAMEWIN_H
#define FRAMEWIN_H
#include "WM.h"
#include "WIDGET.h" /* Req. for WIDGET_DRAW_ITEM_FUNC */
#if GUI_WINSUPPORT
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
/*********************************************************************
*
* Configuration
*/
#ifndef FRAMEWIN_ALLOW_DRAG_ON_FRAME
#define FRAMEWIN_ALLOW_DRAG_ON_FRAME 1
#endif
/*********************************************************************
*
* Color indices
*/
#define FRAMEWIN_CI_INACTIVE 0
#define FRAMEWIN_CI_ACTIVE 1
/*********************************************************************
*
* Create / Status flags
*/
#define FRAMEWIN_CF_ACTIVE (1<<3)
#define FRAMEWIN_CF_MOVEABLE (1<<4)
#define FRAMEWIN_CF_TITLEVIS (1<<5)
#define FRAMEWIN_CF_MINIMIZED (1<<6)
#define FRAMEWIN_CF_MAXIMIZED (1<<7)
#define FRAMEWIN_CF_DRAGGING (1<<8)
#define FRAMEWIN_SF_ACTIVE FRAMEWIN_CF_ACTIVE
#define FRAMEWIN_SF_MOVEABLE FRAMEWIN_CF_MOVEABLE
#define FRAMEWIN_SF_TITLEVIS FRAMEWIN_CF_TITLEVIS
#define FRAMEWIN_SF_MINIMIZED FRAMEWIN_CF_MINIMIZED
#define FRAMEWIN_SF_MAXIMIZED FRAMEWIN_CF_MAXIMIZED
#define FRAMEWIN_SF_DRAGGING FRAMEWIN_CF_DRAGGING
/*********************************************************************
*
* BUTTON Flags
*/
#define FRAMEWIN_BUTTON_RIGHT (1<<0)
#define FRAMEWIN_BUTTON_LEFT (1<<1)
/*********************************************************************
*
* Skinning property indices
*/
#define FRAMEWIN_SKINFLEX_PI_ACTIVE 0
#define FRAMEWIN_SKINFLEX_PI_INACTIVE 1
/*********************************************************************
*
* Getting border size
*/
#define FRAMEWIN_BORDERSIZE_T 0
#define FRAMEWIN_BORDERSIZE_L 1
#define FRAMEWIN_BORDERSIZE_B 2
#define FRAMEWIN_BORDERSIZE_R 3
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef WM_HMEM FRAMEWIN_Handle;
typedef struct {
GUI_COLOR aColorFrame[3];
GUI_COLOR aColorTitle[2];
int Radius;
int SpaceX;
int BorderSizeL;
int BorderSizeR;
int BorderSizeT;
int BorderSizeB;
} FRAMEWIN_SKINFLEX_PROPS;
/*********************************************************************
*
* Create functions
*
**********************************************************************
*/
FRAMEWIN_Handle FRAMEWIN_Create (const char * pTitle, WM_CALLBACK * cb, int Flags, int x0, int y0, int xSize, int ySize);
FRAMEWIN_Handle FRAMEWIN_CreateAsChild (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, const char * pText, WM_CALLBACK * cb, int Flags);
FRAMEWIN_Handle FRAMEWIN_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb);
FRAMEWIN_Handle FRAMEWIN_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, const char * pTitle, WM_CALLBACK * cb, int NumExtraBytes);
FRAMEWIN_Handle FRAMEWIN_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void FRAMEWIN_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Member functions: Set Properties
*
**********************************************************************
*/
WM_HWIN FRAMEWIN_AddButton (FRAMEWIN_Handle hObj, int Flags, int Off, int Id);
WM_HWIN FRAMEWIN_AddCloseButton(FRAMEWIN_Handle hObj, int Flags, int Off);
WM_HWIN FRAMEWIN_AddMaxButton (FRAMEWIN_Handle hObj, int Flags, int Off);
void FRAMEWIN_AddMenu (FRAMEWIN_Handle hObj, WM_HWIN hMenu);
WM_HWIN FRAMEWIN_AddMinButton (FRAMEWIN_Handle hObj, int Flags, int Off);
void FRAMEWIN_Minimize (FRAMEWIN_Handle hObj);
void FRAMEWIN_Maximize (FRAMEWIN_Handle hObj);
void FRAMEWIN_Restore (FRAMEWIN_Handle hObj);
void FRAMEWIN_SetActive (FRAMEWIN_Handle hObj, int State);
void FRAMEWIN_SetBarColor (FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color);
void FRAMEWIN_SetBorderSize (FRAMEWIN_Handle hObj, unsigned Size);
void FRAMEWIN_SetClientColor(FRAMEWIN_Handle hObj, GUI_COLOR Color);
void FRAMEWIN_SetFont (FRAMEWIN_Handle hObj, const GUI_FONT * pFont);
void FRAMEWIN_SetMoveable (FRAMEWIN_Handle hObj, int State);
void FRAMEWIN_SetOwnerDraw (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawItem);
void FRAMEWIN_SetResizeable (FRAMEWIN_Handle hObj, int State);
void FRAMEWIN_SetText (FRAMEWIN_Handle hObj, const char* s);
void FRAMEWIN_SetTextAlign (FRAMEWIN_Handle hObj, int Align);
void FRAMEWIN_SetTextColor (FRAMEWIN_Handle hObj, GUI_COLOR Color);
void FRAMEWIN_SetTextColorEx(FRAMEWIN_Handle hObj, unsigned Index, GUI_COLOR Color);
void FRAMEWIN_SetTitleVis (FRAMEWIN_Handle hObj, int Show);
int FRAMEWIN_SetTitleHeight(FRAMEWIN_Handle hObj, int Height);
int FRAMEWIN_SetUserData (FRAMEWIN_Handle hObj, const void * pSrc, int NumBytes);
/*********************************************************************
*
* Member functions: Skinning
*
**********************************************************************
*/
void FRAMEWIN_GetSkinFlexProps (FRAMEWIN_SKINFLEX_PROPS * pProps, int Index);
void FRAMEWIN_SetSkinClassic (FRAMEWIN_Handle hObj);
void FRAMEWIN_SetSkin (FRAMEWIN_Handle hObj, WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
int FRAMEWIN_DrawSkinFlex (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void FRAMEWIN_SetSkinFlexProps (const FRAMEWIN_SKINFLEX_PROPS * pProps, int Index);
void FRAMEWIN_SetDefaultSkinClassic(void);
WIDGET_DRAW_ITEM_FUNC * FRAMEWIN_SetDefaultSkin(WIDGET_DRAW_ITEM_FUNC * pfDrawSkin);
#define FRAMEWIN_SKIN_FLEX FRAMEWIN_DrawSkinFlex
/*********************************************************************
*
* Member functions: Get Properties
*
**********************************************************************
*/
const GUI_FONT * FRAMEWIN_GetFont(FRAMEWIN_Handle hObj);
int FRAMEWIN_GetActive (FRAMEWIN_Handle hObj);
int FRAMEWIN_GetTitleHeight (FRAMEWIN_Handle hObj);
GUI_COLOR FRAMEWIN_GetBarColor (FRAMEWIN_Handle hObj, unsigned Index);
int FRAMEWIN_GetBorderSize (FRAMEWIN_Handle hObj);
int FRAMEWIN_GetBorderSizeEx(FRAMEWIN_Handle hObj, unsigned Edge);
void FRAMEWIN_GetText (FRAMEWIN_Handle hObj, char * pBuffer, int MaxLen);
int FRAMEWIN_GetTextAlign (FRAMEWIN_Handle hObj);
int FRAMEWIN_GetUserData (FRAMEWIN_Handle hObj, void * pDest, int NumBytes);
int FRAMEWIN_IsMinimized (FRAMEWIN_Handle hObj);
int FRAMEWIN_IsMaximized (FRAMEWIN_Handle hObj);
/*********************************************************************
*
* Managing default values
*
**********************************************************************
*/
GUI_COLOR FRAMEWIN_GetDefaultBarColor (unsigned Index);
int FRAMEWIN_GetDefaultBorderSize (void);
int FRAMEWIN_GetDefaultTitleHeight(void);
GUI_COLOR FRAMEWIN_GetDefaultClientColor(void);
const GUI_FONT * FRAMEWIN_GetDefaultFont (void);
GUI_COLOR FRAMEWIN_GetDefaultTextColor (unsigned Index);
int FRAMEWIN_OwnerDraw (const WIDGET_ITEM_DRAW_INFO * pDrawItemInfo);
void FRAMEWIN_SetDefaultBarColor (unsigned Index, GUI_COLOR Color);
void FRAMEWIN_SetDefaultBorderSize (int DefaultBorderSize);
void FRAMEWIN_SetDefaultTitleHeight(int DefaultTitleHeight);
void FRAMEWIN_SetDefaultClientColor(GUI_COLOR Color);
void FRAMEWIN_SetDefaultFont (const GUI_FONT * pFont);
int FRAMEWIN_SetDefaultTextAlign (int TextAlign);
void FRAMEWIN_SetDefaultTextColor (unsigned Index, GUI_COLOR Color);
/*********************************************************************
*
* Macros for compatibility
*
**********************************************************************
*/
#define FRAMEWIN_SetDefaultCaptionSize(Height) FRAMEWIN_SetDefaultTitleHeight(Height)
#define FRAMEWIN_GetDefaultCaptionSize() FRAMEWIN_GetDefaultTitleHeight()
#define FRAMEWIN_CreateButton(hObj, Flags, Off, Id) FRAMEWIN_AddButton(hObj, Flags, Off, Id)
#define FRAMEWIN_CreateCloseButton(hObj, Flags, Off) FRAMEWIN_AddCloseButton(hObj, Flags, Off)
#define FRAMEWIN_CreateMaxButton(hObj, Flags, Off) FRAMEWIN_AddMaxButton(hObj, Flags, Off)
#define FRAMEWIN_CreateMinButton(hObj, Flags, Off) FRAMEWIN_AddMinButton(hObj, Flags, Off)
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // FRAMEWIN_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,267 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : FRAMEWIN_Private.h
Purpose : FRAMEWIN private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef FRAMEWIN_PRIVATE_H
#define FRAMEWIN_PRIVATE_H
#include "WM.h"
#include "FRAMEWIN.h"
#include "WIDGET.h"
#include "GUI_HOOK.h"
#if GUI_WINSUPPORT
/******************************************************************
*
* Config defaults
*
*******************************************************************
*/
//
//Support for 3D effects
//
#ifndef FRAMEWIN_CLIENTCOLOR_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_WHITE
#else
#define FRAMEWIN_CLIENTCOLOR_DEFAULT GUI_GRAY_C0
#endif
#endif
//
// Default for top frame size
//
#ifndef FRAMEWIN_TITLEHEIGHT_DEFAULT
#define FRAMEWIN_TITLEHEIGHT_DEFAULT 0
#endif
//
// Default for left/right/top/bottom frame size
//
#ifndef FRAMEWIN_BORDER_DEFAULT
#define FRAMEWIN_BORDER_DEFAULT 3
#endif
//
// Default for inner frame size
//
#ifndef FRAMEWIN_IBORDER_DEFAULT
#define FRAMEWIN_IBORDER_DEFAULT 1
#endif
//
// Default font
//
#ifndef FRAMEWIN_DEFAULT_FONT
#if WIDGET_USE_FLEX_SKIN
#if WIDGET_USE_SCHEME_SMALL
#define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
#elif WIDGET_USE_SCHEME_MEDIUM
#define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
#elif WIDGET_USE_SCHEME_LARGE
#define FRAMEWIN_DEFAULT_FONT &GUI_Font24_1
#endif
#else
#if WIDGET_USE_SCHEME_SMALL
#define FRAMEWIN_DEFAULT_FONT &GUI_Font8_1
#elif WIDGET_USE_SCHEME_MEDIUM
#define FRAMEWIN_DEFAULT_FONT &GUI_Font13_1
#elif WIDGET_USE_SCHEME_LARGE
#define FRAMEWIN_DEFAULT_FONT &GUI_Font16_1
#endif
#endif
#endif
//
// Default bar color when framewin is active
//
#ifndef FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT
#define FRAMEWIN_BARCOLOR_ACTIVE_DEFAULT GUI_BLUE
#endif
//
// Default bar color when framewin is inactive
//
#ifndef FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT
#define FRAMEWIN_BARCOLOR_INACTIVE_DEFAULT GUI_DARKGRAY
#endif
//
// Default frame color
//
#ifndef FRAMEWIN_FRAMECOLOR_DEFAULT
#define FRAMEWIN_FRAMECOLOR_DEFAULT GUI_GRAY_AA
#endif
//
// Default text color when framewin is active
//
#ifndef FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_BLACK
#else
#define FRAMEWIN_TEXTCOLOR_INACTIVE_DEFAULT GUI_WHITE
#endif
#endif
//
// Default text color when framewin is inactive
//
#ifndef FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT
#if WIDGET_USE_FLEX_SKIN
#define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_BLACK
#else
#define FRAMEWIN_TEXTCOLOR_ACTIVE_DEFAULT GUI_WHITE
#endif
#endif
//
// Default text alignment
//
#ifndef FRAMEWIN_TEXTALIGN_DEFAULT
#define FRAMEWIN_TEXTALIGN_DEFAULT GUI_TA_LEFT
#endif
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct {
unsigned (* pfGetBordersize)(FRAMEWIN_Handle hObj, unsigned Index);
WIDGET_DRAW_ITEM_FUNC * pfDrawSkin;
} FRAMEWIN_SKIN_PRIVATE;
typedef struct {
const GUI_FONT * pFont;
GUI_COLOR aBarColor[2];
GUI_COLOR aTextColor[2];
GUI_COLOR ClientColor;
FRAMEWIN_SKIN_PRIVATE SkinPrivate;
I16 TitleHeight;
I16 BorderSize;
I16 IBorderSize;
I16 TextAlign;
} FRAMEWIN_PROPS;
typedef struct {
WIDGET Widget;
FRAMEWIN_PROPS Props;
WIDGET_SKIN const * pWidgetSkin;
WIDGET_DRAW_ITEM_FUNC * pfDrawItem; // Only for drawing the title bar...
WM_CALLBACK * cb;
WM_HWIN hClient;
WM_HWIN hMenu;
WM_HWIN hText;
GUI_RECT rRestore;
U16 Flags;
WM_HWIN hFocussedChild; // Handle to focussed child .. default none (0)
WM_DIALOG_STATUS * pDialogStatus;
GUI_HOOK * pFirstHook;
} FRAMEWIN_Obj;
typedef struct {
I16 TitleHeight;
I16 MenuHeight;
GUI_RECT rClient;
GUI_RECT rTitleText;
} FRAMEWIN_POSITIONS;
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define FRAMEWIN_INIT_ID(p) (p->Widget.DebugId = FRAMEWIN_ID)
#else
#define FRAMEWIN_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
FRAMEWIN_Obj * FRAMEWIN_LockH(FRAMEWIN_Handle h);
#define FRAMEWIN_LOCK_H(h) FRAMEWIN_LockH(h)
#else
#define FRAMEWIN_LOCK_H(h) (FRAMEWIN_Obj *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern FRAMEWIN_PROPS FRAMEWIN__DefaultProps;
extern const WIDGET_SKIN FRAMEWIN__SkinClassic;
extern WIDGET_SKIN FRAMEWIN__Skin;
extern const WIDGET_SKIN * FRAMEWIN__pSkinDefault;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void FRAMEWIN__CalcPositions (FRAMEWIN_Handle hObj, FRAMEWIN_POSITIONS * pPos);
int FRAMEWIN__CalcTitleHeight(FRAMEWIN_Obj * pObj);
void FRAMEWIN__UpdatePositions(FRAMEWIN_Handle hObj);
void FRAMEWIN__UpdateButtons (FRAMEWIN_Handle hObj, int OldHeight, int OldBorderSizeL, int OldBorderSizeR, int OldBorderSizeT);
void FRAMEWIN__GetTitleLimits (FRAMEWIN_Handle hObj, int * pxMin, int * pxMax);
unsigned FRAMEWIN__GetBorderSize (FRAMEWIN_Handle hObj, unsigned Index);
#endif // GUI_WINSUPPORT
#endif // FRAMEWIN_PRIVATE_H

View File

@@ -0,0 +1,204 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GRAPH.h
Purpose : GRAPH include
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GRAPH_H
#define GRAPH_H
#include "WM.h"
#include "DIALOG_Intern.h" /* Req. for Create indirect data structure */
#include "WIDGET.h"
#if GUI_WINSUPPORT
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define GRAPH_CI_BK 0
#define GRAPH_CI_BORDER 1
#define GRAPH_CI_FRAME 2
#define GRAPH_CI_GRID 3
#define GRAPH_SCALE_CF_HORIZONTAL (0 << 0)
#define GRAPH_SCALE_CF_VERTICAL (1 << 0)
#define GRAPH_SCALE_SF_HORIZONTAL GRAPH_SCALE_CF_HORIZONTAL
#define GRAPH_SCALE_SF_VERTICAL GRAPH_SCALE_CF_VERTICAL
#define GRAPH_DRAW_FIRST 0
#define GRAPH_DRAW_AFTER_BORDER 1
#define GRAPH_DRAW_LAST 2
#define GRAPH_ALIGN_RIGHT (0 << 0)
#define GRAPH_ALIGN_LEFT (1 << 0)
//
// Creation flags (ExFlags)
//
#define GRAPH_CF_GRID_FIXED_X (1 << 0)
#define GRAPH_CF_AVOID_SCROLLBAR_H (1 << 1)
#define GRAPH_CF_AVOID_SCROLLBAR_V (1 << 2)
//
// Status flags
//
#define GRAPH_SF_AVOID_SCROLLBAR_H GRAPH_CF_AVOID_SCROLLBAR_H
#define GRAPH_SF_AVOID_SCROLLBAR_V GRAPH_CF_AVOID_SCROLLBAR_V
/*********************************************************************
*
* Public Types
*
**********************************************************************
*/
typedef WM_HMEM GRAPH_Handle;
typedef WM_HMEM GRAPH_DATA_Handle;
typedef WM_HMEM GRAPH_SCALE_Handle;
/*********************************************************************
*
* Create functions
*
**********************************************************************
*/
GRAPH_Handle GRAPH_CreateEx (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id);
GRAPH_Handle GRAPH_CreateUser (int x0, int y0, int xSize, int ySize, WM_HWIN hParent, int WinFlags, int ExFlags, int Id, int NumExtraBytes);
GRAPH_Handle GRAPH_CreateIndirect(const GUI_WIDGET_CREATE_INFO * pCreateInfo, WM_HWIN hWinParent, int x0, int y0, WM_CALLBACK * cb);
GRAPH_DATA_Handle GRAPH_DATA_XY_Create(GUI_COLOR Color, unsigned MaxNumItems, GUI_POINT * pData, unsigned NumItems);
GRAPH_DATA_Handle GRAPH_DATA_YT_Create(GUI_COLOR Color, unsigned MaxNumItems, I16 * pData, unsigned NumItems);
GRAPH_SCALE_Handle GRAPH_SCALE_Create (int Pos, int TextAlign, unsigned Flags, unsigned TickDist);
/*********************************************************************
*
* The callback ...
*
* Do not call it directly ! It is only to be used from within an
* overwritten callback.
*/
void GRAPH_Callback(WM_MESSAGE * pMsg);
/*********************************************************************
*
* Member functions
*
**********************************************************************
*/
void GRAPH_AttachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData);
void GRAPH_AttachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale);
void GRAPH_DetachData (GRAPH_Handle hObj, GRAPH_DATA_Handle hData);
void GRAPH_DetachScale (GRAPH_Handle hObj, GRAPH_SCALE_Handle hScale);
I32 GRAPH_GetScrollValue (GRAPH_Handle hObj, U8 Coord);
int GRAPH_GetUserData (GRAPH_Handle hObj, void * pDest, int NumBytes);
void GRAPH_SetAutoScrollbar (GRAPH_Handle hObj, U8 Coord, U8 OnOff);
void GRAPH_SetBorder (GRAPH_Handle hObj, unsigned BorderL, unsigned BorderT, unsigned BorderR, unsigned BorderB);
GUI_COLOR GRAPH_SetColor (GRAPH_Handle hObj, GUI_COLOR Color, unsigned Index);
unsigned GRAPH_SetGridFixedX (GRAPH_Handle hObj, unsigned OnOff);
unsigned GRAPH_SetGridOffY (GRAPH_Handle hObj, unsigned Value);
unsigned GRAPH_SetGridVis (GRAPH_Handle hObj, unsigned OnOff);
unsigned GRAPH_SetGridDistX (GRAPH_Handle hObj, unsigned Value);
unsigned GRAPH_SetGridDistY (GRAPH_Handle hObj, unsigned Value);
U8 GRAPH_SetLineStyleH (GRAPH_Handle hObj, U8 Value);
U8 GRAPH_SetLineStyleV (GRAPH_Handle hObj, U8 Value);
void GRAPH_SetLineStyle (GRAPH_Handle hObj, U8 Value);
void GRAPH_SetScrollValue (GRAPH_Handle hObj, U8 Coord, U32 Value);
unsigned GRAPH_SetVSizeX (GRAPH_Handle hObj, unsigned Value);
unsigned GRAPH_SetVSizeY (GRAPH_Handle hObj, unsigned Value);
int GRAPH_SetUserData (GRAPH_Handle hObj, const void * pSrc, int NumBytes);
void GRAPH_SetUserDraw (GRAPH_Handle hObj, void (* pOwnerDraw)(WM_HWIN, int));
void GRAPH_DATA_YT_AddValue (GRAPH_DATA_Handle hDataObj, I16 Value);
void GRAPH_DATA_YT_Clear (GRAPH_DATA_Handle hDataObj);
void GRAPH_DATA_YT_Delete (GRAPH_DATA_Handle hDataObj);
void GRAPH_DATA_YT_SetAlign (GRAPH_DATA_Handle hDataObj, int Align);
void GRAPH_DATA_YT_SetOffY (GRAPH_DATA_Handle hDataObj, int Off);
void GRAPH_DATA_YT_MirrorX (GRAPH_DATA_Handle hDataObj, int OnOff);
void GRAPH_DATA_XY_AddPoint (GRAPH_DATA_Handle hDataObj, GUI_POINT * pPoint);
void GRAPH_DATA_XY_Clear (GRAPH_DATA_Handle hDataObj);
void GRAPH_DATA_XY_Delete (GRAPH_DATA_Handle hDataObj);
unsigned GRAPH_DATA_XY_GetLineVis (GRAPH_DATA_Handle hDataObj);
unsigned GRAPH_DATA_XY_GetPointVis (GRAPH_DATA_Handle hDataObj);
void GRAPH_DATA_XY_SetLineStyle (GRAPH_DATA_Handle hDataObj, U8 LineStyle);
unsigned GRAPH_DATA_XY_SetLineVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff);
void GRAPH_DATA_XY_SetOffX (GRAPH_DATA_Handle hDataObj, int Off);
void GRAPH_DATA_XY_SetOffY (GRAPH_DATA_Handle hDataObj, int Off);
void GRAPH_DATA_XY_SetPenSize (GRAPH_DATA_Handle hDataObj, U8 PenSize);
void GRAPH_DATA_XY_SetPointSize (GRAPH_DATA_Handle hDataObj, unsigned PointSize);
unsigned GRAPH_DATA_XY_SetPointVis (GRAPH_DATA_Handle hDataObj, unsigned OnOff);
void GRAPH_DATA_XY_SetOwnerDraw (GRAPH_DATA_Handle hDataObj, WIDGET_DRAW_ITEM_FUNC * pOwnerDraw);
void GRAPH_SCALE_Delete (GRAPH_SCALE_Handle hScaleObj);
float GRAPH_SCALE_SetFactor (GRAPH_SCALE_Handle hScaleObj, float Factor);
const GUI_FONT * GRAPH_SCALE_SetFont (GRAPH_SCALE_Handle hScaleObj, const GUI_FONT * pFont);
int GRAPH_SCALE_SetNumDecs (GRAPH_SCALE_Handle hScaleObj, int NumDecs);
int GRAPH_SCALE_SetOff (GRAPH_SCALE_Handle hScaleObj, int Off);
int GRAPH_SCALE_SetPos (GRAPH_SCALE_Handle hScaleObj, int Pos);
GUI_COLOR GRAPH_SCALE_SetTextColor(GRAPH_SCALE_Handle hScaleObj, GUI_COLOR Color);
unsigned GRAPH_SCALE_SetTickDist (GRAPH_SCALE_Handle hScaleObj, unsigned Value);
#if defined(__cplusplus)
}
#endif
#endif // GUI_WINSUPPORT
#endif // GRAPH_H
/*************************** End of file ****************************/

View File

@@ -0,0 +1,170 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GRAPH_Private.h
Purpose : GRAPH private header file
--------------------END-OF-HEADER-------------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GRAPH_PRIVATE_H
#define GRAPH_PRIVATE_H
#include "GRAPH.h"
#include "GUI_ARRAY.h"
#include "WIDGET.h"
#if GUI_WINSUPPORT
/*********************************************************************
*
* Object definition
*
**********************************************************************
*/
typedef struct GRAPH_OBJ GRAPH_OBJ;
typedef struct GRAPH_DATA_OBJ GRAPH_DATA_OBJ;
typedef struct GRAPH_SCALE_OBJ GRAPH_SCALE_OBJ;
typedef struct GRAPH_PAINT_OBJ GRAPH_PAINT_OBJ;
struct GRAPH_PAINT_OBJ {
void (* pfOnPaint) (WM_HMEM hObj, GUI_RECT * pRectInvalid); /* Pointer to paint function */
void (* pfOnDelete) (WM_HMEM hObj); /* Pointer to delete function */
WM_HWIN hGraph; /* Handle of graph widget */
};
typedef struct {
GUI_COLOR TextColor;
const GUI_FONT * pFont;
} GRAPH_SCALE_PROPS;
struct GRAPH_SCALE_OBJ {
GRAPH_PAINT_OBJ PaintObj;
GRAPH_SCALE_PROPS Props;
int Pos;
int TextAlign;
unsigned TickDist;
int Off;
U16 Flags;
float Factor;
int NumDecs;
};
struct GRAPH_DATA_OBJ {
GRAPH_PAINT_OBJ PaintObj;
void (* pfInvalidateNewItem)(GRAPH_DATA_OBJ * pDataObj); /* Pointer to a function which can be used for invalidating the required area */
unsigned NumItems;
unsigned MaxNumItems;
GUI_COLOR Color;
int OffX, OffY;
};
typedef struct {
GUI_COLOR aColor[4];
unsigned GridSpacingX;
unsigned GridSpacingY;
unsigned GridOffX;
unsigned GridOffY;
unsigned BorderL;
unsigned BorderT;
unsigned BorderR;
unsigned BorderB;
} GRAPH_PROPS;
struct GRAPH_OBJ {
WIDGET Widget;
GRAPH_PROPS Props;
GUI_ARRAY GraphArray;
GUI_ARRAY ScaleArray;
U8 ShowGrid;
unsigned RangeX, RangeY;
U16 Flags;
U8 LineStyleV;
U8 LineStyleH;
WM_SCROLL_STATE ScrollStateV;
WM_SCROLL_STATE ScrollStateH;
void (* pUserDraw)(WM_HWIN hObj, int Stage);
};
/*********************************************************************
*
* Macros for internal use
*
**********************************************************************
*/
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
#define GRAPH_INIT_ID(p) (p->Widget.DebugId = GRAPH_ID)
#else
#define GRAPH_INIT_ID(p)
#endif
#if GUI_DEBUG_LEVEL >= GUI_DEBUG_LEVEL_CHECK_ALL
GRAPH_OBJ * GRAPH_LockH(GRAPH_Handle h);
#define GRAPH_LOCK_H(h) GRAPH_LockH(h)
#else
#define GRAPH_LOCK_H(h) (GRAPH_OBJ *)GUI_LOCK_H(h)
#endif
/*********************************************************************
*
* Public data (internal defaults)
*
**********************************************************************
*/
extern GRAPH_PROPS GRAPH__DefaultProps;
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void GRAPH__AddValue (GRAPH_DATA_OBJ * pDataObj, void * pData, void * pValue, int Size);
void GRAPH__InvalidateGraph(GRAPH_Handle hObj);
#endif /* GUI_WINSUPPORT */
#endif /* GRAPH_PRIVATE_H */

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,105 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_DCache.h
Purpose : Interface definition for GUIDRV_DCache driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_DCACHE_H
#define GUIDRV_DCACHE_H
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Display driver
*/
//
// Address
//
extern const GUI_DEVICE_API GUIDRV_DCache_API;
//
// Macros to be used in configuration files
//
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_DCACHE &GUIDRV_Win_API
#else
#define GUIDRV_DCACHE &GUIDRV_DCache_API
#endif
/*********************************************************************
*
* Public routines
*/
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_DCache_AddDriver(pDevice, pDriver)
#define GUIDRV_DCache_SetMode1bpp(pDevice)
#else
void GUIDRV_DCache_AddDriver (GUI_DEVICE * pDevice, GUI_DEVICE * pDriver);
void GUIDRV_DCache_SetMode1bpp(GUI_DEVICE * pDevice);
#endif
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_DCACHE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,157 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_DCache_Private.h
Purpose : Private declarations for GUIDRV_DCache driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_DCACHE_PRIVATE_H
#define GUIDRV_DCACHE_PRIVATE_H
#include "GUIDRV_DCache.h"
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_DCACHE
/*********************************************************************
*
* Types
*
**********************************************************************
*/
/*********************************************************************
*
* DRIVER_CONTEXT
*/
typedef struct {
//
// Data
//
int xSize, ySize; // Display size
int vxSize, vySize; // Virtual display size
int BitsPerPixelDriver;
int BitsPerPixel;
int NumColors;
LCD_PIXELINDEX IndexMask;
U32 MemSize;
GUI_RECT rDirty;
const GUI_DEVICE_API * pMemdev_API;
//
// Cache mamagement
//
void (* pfFlush )(GUI_DEVICE * pDevice);
void (* pfSendCacheRect)(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1);
//
// Setting the rectangle to be filled up within the real driver
//
void (* pfSetRect )(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1, int OnOff);
//
// Mode dependent drawing functions
//
void (* pfDrawBitmap )(GUI_DEVICE * pDevice, int x0, int y0, int xsize, int ysize, int _BitsPerPixel, int BytesPerLine, const U8 * pData, int Diff, const LCD_PIXELINDEX * pTrans);
void (* pfFillRect )(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1);
unsigned (* pfGetPixelIndex)(GUI_DEVICE * pDevice, int x, int y);
void (* pfSetPixelIndex)(GUI_DEVICE * pDevice, int x, int y, int ColorIndex);
//
// Request information
//
I32 (* pfGetDevProp )(GUI_DEVICE * pDevice, int Index);
//
// Initialization
//
void (* pfInit) (GUI_DEVICE * pDevice);
//
// Conversion array from cache to real display driver
//
LCD_PIXELINDEX * pConvert;
LCD_PIXELINDEX * pIndex;
//
// Cache
//
U8 * pVRAM;
U8 * pVRAM_Lock;
int CacheLocked;
int CacheStat;
int CacheDirty;
//
// The driver which is used for the actual drawing operations
//
GUI_DEVICE * pDriver;
} DRIVER_CONTEXT;
/*********************************************************************
*
* Private interface
*
**********************************************************************
*/
void GUIDRV_DCache__AddDirtyRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
void GUIDRV_DCache__ClearDirtyRect(DRIVER_CONTEXT * pContext);
void GUIDRV_DCache__InitOnce (GUI_DEVICE * pDevice);
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_DCACHE_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,103 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Dist.h
Purpose : Interface definition for GUIDRV_Dist driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_DIST_H
#define GUIDRV_DIST_H
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Display driver
*/
//
// Address
//
extern const GUI_DEVICE_API GUIDRV_Dist_API;
//
// Macros to be used in configuration files
//
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_DIST &GUIDRV_Win_API
#else
#define GUIDRV_DIST &GUIDRV_Dist_API
#endif
/*********************************************************************
*
* Public routines
*/
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_Dist_AddDriver(pDevice, pDriver, pRect)
#else
void GUIDRV_Dist_AddDriver(GUI_DEVICE * pDevice, GUI_DEVICE * pDriver, GUI_RECT * pRect);
#endif
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_DIST_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,283 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_FlexColor.h
Purpose : Interface definition for GUIDRV_FlexColor driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_FLEXCOLOR_H
#define GUIDRV_FLEXCOLOR_H
#include "GUI.h"
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Configuration macros
*/
//
// Operation modes (16bpp)
//
#define GUIDRV_FLEXCOLOR_M16C0B8 GUIDRV_FlexColor_SetMode16bppC0B8
#define GUIDRV_FLEXCOLOR_M16C1B8 GUIDRV_FlexColor_SetMode16bppC1B8
#define GUIDRV_FLEXCOLOR_M16C0B16 GUIDRV_FlexColor_SetMode16bppC0B16
#define GUIDRV_FLEXCOLOR_M16C1B16 GUIDRV_FlexColor_SetMode16bppC1B16
//
// Operation modes (18bpp)
//
#define GUIDRV_FLEXCOLOR_M18C0B9 GUIDRV_FlexColor_SetMode18bppC0B9
#define GUIDRV_FLEXCOLOR_M18C1B9 GUIDRV_FlexColor_SetMode18bppC1B9
#define GUIDRV_FLEXCOLOR_M18C0B18 GUIDRV_FlexColor_SetMode18bppC0B18
#define GUIDRV_FLEXCOLOR_M18C1B18 GUIDRV_FlexColor_SetMode18bppC1B18
//
// Controller selection
//
#define GUIDRV_FLEXCOLOR_F66702 GUIDRV_FlexColor_SetFunc66702
#define GUIDRV_FLEXCOLOR_F66708 GUIDRV_FlexColor_SetFunc66708
#define GUIDRV_FLEXCOLOR_F66709 GUIDRV_FlexColor_SetFunc66709
#define GUIDRV_FLEXCOLOR_F66712 GUIDRV_FlexColor_SetFunc66712
#define GUIDRV_FLEXCOLOR_F66714 GUIDRV_FlexColor_SetFunc66714
#define GUIDRV_FLEXCOLOR_F66715 GUIDRV_FlexColor_SetFunc66715
#define GUIDRV_FLEXCOLOR_F66718 GUIDRV_FlexColor_SetFunc66718
#define GUIDRV_FLEXCOLOR_F66719 GUIDRV_FlexColor_SetFunc66719
#define GUIDRV_FLEXCOLOR_F66720 GUIDRV_FlexColor_SetFunc66720
#define GUIDRV_FLEXCOLOR_F66721 GUIDRV_FlexColor_SetFunc66721
#define GUIDRV_FLEXCOLOR_F66722 GUIDRV_FlexColor_SetFunc66722
#define GUIDRV_FLEXCOLOR_F66772 GUIDRV_FlexColor_SetFunc66772
//
// Hardware interfaces
//
#define GUIDRV_FLEXCOLOR_IF_TYPE_I 0
#define GUIDRV_FLEXCOLOR_IF_TYPE_II 1
//
// Reading interface
//
#define GUIDRV_FLEXCOLOR_READ_FUNC_I 0
#define GUIDRV_FLEXCOLOR_READ_FUNC_II 1
#define GUIDRV_FLEXCOLOR_READ_FUNC_III 2
/*********************************************************************
*
* Configuration structure
*/
typedef struct {
//
// Driver specific configuration items
//
int FirstSEG;
int FirstCOM;
int Orientation;
U16 RegEntryMode;
int NumDummyReads;
} CONFIG_FLEXCOLOR;
/*********************************************************************
*
* Display drivers
*/
//
// Addresses
//
extern const GUI_DEVICE_API GUIDRV_Win_API;
extern const GUI_DEVICE_API GUIDRV_FlexColor_API;
//
// Macros to be used in configuration files
//
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_FLEXCOLOR &GUIDRV_Win_API
#else
#define GUIDRV_FLEXCOLOR &GUIDRV_FlexColor_API
#endif
/*********************************************************************
*
* Configuration interface
*/
#if !defined(WIN32) || defined(LCD_SIMCONTROLLER)
//
// Display controller configuration
//
void GUIDRV_FlexColor_SetFunc66702 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66708 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66709 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66712 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66714 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66715 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66718 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66719 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66720 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66721 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66722 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetFunc66772 (GUI_DEVICE * pDevice);
//
// Operation mode configuration (16bpp)
//
void GUIDRV_FlexColor_SetMode16bppC0B8 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode16bppC1B8 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode16bppC0B16(GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode16bppC1B16(GUI_DEVICE * pDevice);
//
// Drawing mode configuration (18bpp)
//
void GUIDRV_FlexColor_SetMode18bppC0B9 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode18bppC1B9 (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode18bppC0B18(GUI_DEVICE * pDevice);
void GUIDRV_FlexColor_SetMode18bppC1B18(GUI_DEVICE * pDevice);
//
// User interface
//
void GUIDRV_FlexColor_SetFunc(GUI_DEVICE * pDevice, GUI_PORT_API * pHW_API, void (* pfFunc)(GUI_DEVICE *), void (* pfMode)(GUI_DEVICE *));
void GUIDRV_FlexColor_Config (GUI_DEVICE * pDevice, CONFIG_FLEXCOLOR * pConfig);
//
// Setting up hardware interface to be used
//
void GUIDRV_FlexColor_SetInterface66712_B9 (GUI_DEVICE * pDevice, int Type);
void GUIDRV_FlexColor_SetInterface66712_B18(GUI_DEVICE * pDevice, int Type);
#define GUIDRV_FlexColor_SetInterface66715_B9(pDevice, Type) GUIDRV_FlexColor_SetInterface66712_B9(pDevice, Type)
#define GUIDRV_FlexColor_SetInterface66715_B18(pDevice, Type) GUIDRV_FlexColor_SetInterface66712_B18(pDevice, Type)
//
// Setting up interface for reading back data
//
void GUIDRV_FlexColor_SetReadFunc66709_B16(GUI_DEVICE * pDevice, int Func);
void GUIDRV_FlexColor_SetReadFunc66712_B9 (GUI_DEVICE * pDevice, int Func);
void GUIDRV_FlexColor_SetReadFunc66712_B16(GUI_DEVICE * pDevice, int Func);
#define GUIDRV_FlexColor_SetReadFunc66715_B9(pDevice, Func) GUIDRV_FlexColor_SetReadFunc66712_B9(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66715_B16(pDevice, Func) GUIDRV_FlexColor_SetReadFunc66712_B16(pDevice, Func)
void GUIDRV_FlexColor_SetReadFunc66720_B16(GUI_DEVICE * pDevice, int Func);
void GUIDRV_FlexColor_SetReadFunc66772_B8 (GUI_DEVICE * pDevice, int Func);
void GUIDRV_FlexColor_SetReadFunc66772_B16(GUI_DEVICE * pDevice, int Func);
#else
//
// Display controller configuration
//
#define GUIDRV_FlexColor_SetFunc66708(pDevice)
#define GUIDRV_FlexColor_SetFunc66709(pDevice)
#define GUIDRV_FlexColor_SetFunc66712(pDevice)
#define GUIDRV_FlexColor_SetFunc66714(pDevice)
#define GUIDRV_FlexColor_SetFunc66715(pDevice)
#define GUIDRV_FlexColor_SetFunc66718(pDevice)
#define GUIDRV_FlexColor_SetFunc66719(pDevice)
#define GUIDRV_FlexColor_SetFunc66720(pDevice)
#define GUIDRV_FlexColor_SetFunc66721(pDevice)
#define GUIDRV_FlexColor_SetFunc66722(pDevice)
#define GUIDRV_FlexColor_SetFunc66772(pDevice)
//
// Operation mode configuration (16bpp)
//
#define GUIDRV_FlexColor_SetMode16bppC0B8(pDevice)
#define GUIDRV_FlexColor_SetMode16bppC1B8(pDevice)
#define GUIDRV_FlexColor_SetMode16bppC0B16(pDevice)
#define GUIDRV_FlexColor_SetMode16bppC1B16(pDevice)
//
// Drawing mode configuration (18bpp)
//
#define GUIDRV_FlexColor_SetMode18bppC0B9(pDevice)
#define GUIDRV_FlexColor_SetMode18bppC1B9(pDevice)
#define GUIDRV_FlexColor_SetMode18bppC0B18(pDevice)
#define GUIDRV_FlexColor_SetMode18bppC1B18(pDevice)
//
// User interface
//
#define GUIDRV_FlexColor_SetFunc(pDevice, pHW_API, pfFunc, pfMode)
#define GUIDRV_FlexColor_Config(pDevice, pConfig)
//
// Setting up hardware interface to be used
//
#define GUIDRV_FlexColor_SetInterface66712_B9(pDevice, Type)
#define GUIDRV_FlexColor_SetInterface66712_B18(pDevice, Type)
#define GUIDRV_FlexColor_SetInterface66720_B18(pDevice, Type)
#define GUIDRV_FlexColor_SetInterface66715_B9(pDevice, Type)
#define GUIDRV_FlexColor_SetInterface66715_B18(pDevice, Type)
//
// Setting up interface for reading back data
//
#define GUIDRV_FlexColor_SetReadFunc66709_B16(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66712_B9(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66712_B16(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66715_B9(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66715_B16(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66720_B16(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66772_B8(pDevice, Func)
#define GUIDRV_FlexColor_SetReadFunc66772_B16(pDevice, Func)
#endif
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_FLEXCOLOR_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,260 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_FlexColor_Private.h
Purpose : Private declarations for GUIDRV_FlexColor driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#include "GUIDRV_FlexColor.h"
#ifndef GUIDRV_FLEXCOLOR_PRIVATE_H
#define GUIDRV_FLEXCOLOR_PRIVATE_H
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Defines
*
**********************************************************************
*/
#define LCD_WRITE_BUFFER_SIZE 500
#define FLEXCOLOR_CF_MANAGE_ORIENTATION (1 << 0)
#define FLEXCOLOR_CF_RAM_ADDR_SET (1 << 1)
#define FLEXCOLOR_CF_SET_CURSOR (1 << 2)
#define FLEXCOLOR_CF_DEFAULT FLEXCOLOR_CF_RAM_ADDR_SET
#define FLEXCOLOR_MAX_NUM_DUMMY_READS 5
#define FLEXCOLOR_NUM_DUMMY_READS 1
#define PUSH_RECT 0
#define POP_RECT 1
//
// Use unique context identified
//
#define DRIVER_CONTEXT DRIVER_CONTEXT_FLEXCOLOR
/*********************************************************************
*
* Types
*
**********************************************************************
*/
typedef struct DRIVER_CONTEXT DRIVER_CONTEXT;
/*********************************************************************
*
* DRIVER_CONTEXT
*/
struct DRIVER_CONTEXT {
//
// Data
//
int xSize, ySize; // Display size
int vxSize, vySize; // Virtual display size
int x0, y0, x1, y1; // Current rectangle
int NumDummyReads; // Number of required dummy reads
U16 RegEntryMode; // Can be used for storing additional configuration bits for 'EntryMode' register which is modified by the driver
U16 Flags;
LCD_PIXELINDEX IndexMask;
int FirstSEG, FirstCOM;
int Orientation;
int BitsPerPixel;
int Shift;
GUI_DEVICE * pDevice;
const GUI_DEVICE_API * pMemdev_API;
//
// Cache
//
void * pVRAM;
int CacheLocked;
int CacheStat;
int xPos, yPos;
U32 Addr;
GUI_RECT CacheRect;
//
// Buffers
//
void * pWriteBuffer;
void * pLineBuffer;
U8 aPair_8 [3 + FLEXCOLOR_MAX_NUM_DUMMY_READS];
U16 aPair_16[3 + FLEXCOLOR_MAX_NUM_DUMMY_READS];
//
// Functions for writing single items (data, cmd) regardless of the interface and getting the status
//
U16 (* pfReadReg) (DRIVER_CONTEXT * _pContext);
void (* pfSetReg) (DRIVER_CONTEXT * _pContext, U16 _Data);
void (* pfWritePara) (DRIVER_CONTEXT * _pContext, U16 _Data);
void (* pfSetInterface)(DRIVER_CONTEXT * _pContext, int _BusWidth);
//
// Setting read mode, required for RA8870
//
void (* pfSetReadMode)(DRIVER_CONTEXT * _pContext, int OnOff, int SetCursor);
//
// Cache related function pointers
//
void (* pfSendCacheRect)(DRIVER_CONTEXT * _pContext, int _x0, int _y0, int _x1, int _y1);
U32 (* pfReadData) (DRIVER_CONTEXT * _pContext);
void (* pfWriteData) (DRIVER_CONTEXT * _pContext, U32 _PixelIndex);
//
// Controller specific routines
//
void (* pfSetRect) (DRIVER_CONTEXT * _pContext, int _x0, int _y0, int _x1, int _y1);
void (* pfSetPhysRAMAddr) (DRIVER_CONTEXT * _pContext, int _x, int _y);
void (* pfSetOrientation) (DRIVER_CONTEXT * _pContext);
U16 (* pfReadPixel_16bpp_B16)(DRIVER_CONTEXT * _pContext);
U16 (* pfReadPixel_16bpp_B8) (DRIVER_CONTEXT * _pContext);
U32 (* pfReadPixel_18bpp_B9) (DRIVER_CONTEXT * _pContext);
U32 (* pfReadPixel_18bpp_B18)(DRIVER_CONTEXT * _pContext);
void (* pfReadRect_16bpp_B16) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U16 * _pBuffer);
void (* pfReadRect_16bpp_B8) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U16 * _pBuffer);
void (* pfReadRect_18bpp_B9) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U32 * _pBuffer);
void (* pfReadRect_18bpp_B18) (GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1, U32 * _pBuffer);
//
// Custom read functions
//
U16 (* pfReadPixelCust_16bpp) (int LayerIndex);
U32 (* pfReadPixelCust_18bpp) (int LayerIndex);
void(* pfReadMPixelCust_16bpp)(int LayerIndex, U16 * pBuffer, U32 NumPixels);
void(* pfReadMPixelCust_18bpp)(int LayerIndex, U32 * pBuffer, U32 NumPixels);
//
// Mode dependent drawing functions
//
void (* pfDrawBitmap )(GUI_DEVICE * _pDevice, int _x0, int _y0, int _xsize, int _ysize, int _BitsPerPixel, int _BytesPerLine, const U8 * _pData, int _Diff, const LCD_PIXELINDEX * _pTrans);
void (* pfFillRect )(GUI_DEVICE * _pDevice, int _x0, int _y0, int _x1, int _y1);
unsigned(* pfGetPixelIndex)(GUI_DEVICE * _pDevice, int _x, int _y);
void (* pfSetPixelIndex)(GUI_DEVICE * _pDevice, int _x, int _y, int _ColorIndex);
int (* pfControlCache )(GUI_DEVICE * _pDevice, int _Cmd);
void (* pfRefresh )(GUI_DEVICE * _pDevice);
//
// Controller dependent function pointers
//
void (* pfReadRect)(void);
//
// Orientation
//
int (* pfLog2PhysX)(DRIVER_CONTEXT * _pContext, int _x, int _y);
int (* pfLog2PhysY)(DRIVER_CONTEXT * _pContext, int _x, int _y);
//
// Function pointer for setting up pfLog2Phys<X,Y>
//
void (* pfSetLog2Phys)(DRIVER_CONTEXT * _pContext);
//
// Hardware routines
//
GUI_PORT_API HW_API;
};
/*********************************************************************
*
* Private functions
*
**********************************************************************
*/
void GUIDRV_FlexColor__InitOnce (GUI_DEVICE * pDevice);
int GUIDRV_FlexColor__ControlCache (GUI_DEVICE * pDevice, int Cmd);
void GUIDRV_FlexColor__Refresh (GUI_DEVICE * pDevice);
void GUIDRV_FlexColor__AddCacheRect (DRIVER_CONTEXT * pContext);
void GUIDRV_FlexColor__ManageRect (DRIVER_CONTEXT * pContext, int Cmd);
void GUIDRV_FlexColor__SetCacheAddr (DRIVER_CONTEXT * pContext, int x, int y);
void GUIDRV_FlexColor__SetCacheRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
void GUIDRV_FlexColor__SetLog2Phys (DRIVER_CONTEXT * pContext);
void GUIDRV_FlexColor__SetSubRect (DRIVER_CONTEXT * pContext, int x0, int y0, int x1, int y1);
unsigned int GUIDRV_FlexColor__GetPixelIndexCache (GUI_DEVICE * pDevice, int x, int y);
void GUIDRV_FlexColor__SetPixelIndexCache (GUI_DEVICE * pDevice, int x, int y, int PixelIndex);
unsigned int GUIDRV_FlexColor__GetPixelIndexNoCache(GUI_DEVICE * pDevice, int x, int y);
void GUIDRV_FlexColor__SetPixelIndexNoCache(GUI_DEVICE * pDevice, int x, int y, int PixelIndex);
void GUIDRV_FlexColor__SetFunc66712(GUI_DEVICE * pDevice, U16 AndMask_SetAddrRAM);
/*********************************************************************
*
* Simulation (Segger internal use only)
*
**********************************************************************
*/
#if defined(WIN32) && defined(LCD_SIMCONTROLLER)
extern GUI_PORT_API SIM_FlexColor_HW_API;
void SIM_FlexColor_Config (GUI_DEVICE * pDevice, int Orientation, int xSize, int ySize, int FirstSEG, int FirstCOM, int BitsPerPixel, int NumDummyReads);
void SIM_FlexColor_SetBus8 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus9 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus16 (GUI_DEVICE * pDevice);
void SIM_FlexColor_SetBus32 (GUI_DEVICE * pDevice, int Shift);
void SIM_FlexColor_SetFunc66702(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66708(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66709(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66712(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66714(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66715(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66718(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66719(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66720(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66721(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66722(GUI_DEVICE * pDevice);
void SIM_FlexColor_SetFunc66772(GUI_DEVICE * pDevice);
#endif
#if defined(__cplusplus)
}
#endif
#endif /* GUIDRV_FLEXCOLOR_PRIVATE_H */
/*************************** End of file ****************************/

View File

@@ -0,0 +1,274 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin.h
Purpose : Interface definition for GUIDRV_Lin driver
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
#ifndef GUIDRV_LIN_H
#define GUIDRV_LIN_H
#if defined(__cplusplus)
extern "C" { /* Make sure we have C-declarations in C++ programs */
#endif
/*********************************************************************
*
* Display drivers
*/
//
// Addresses
//
extern const GUI_DEVICE_API GUIDRV_Win_API;
extern const GUI_DEVICE_API GUIDRV_Lin_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_1_API;
extern const GUI_DEVICE_API GUIDRV_Lin_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_2_API;
extern const GUI_DEVICE_API GUIDRV_Lin_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_4_API;
extern const GUI_DEVICE_API GUIDRV_Lin_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_8_API;
extern const GUI_DEVICE_API GUIDRV_Lin_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_16_API;
extern const GUI_DEVICE_API GUIDRV_Lin_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_24_API;
extern const GUI_DEVICE_API GUIDRV_Lin_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OY_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OX_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OXY_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OS_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSY_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSX_32_API;
extern const GUI_DEVICE_API GUIDRV_Lin_OSXY_32_API;
//
// Macros to be used in configuration files
//
#if defined(WIN32) && !defined(LCD_SIMCONTROLLER)
#define GUIDRV_LIN_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_1 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_1 &GUIDRV_Win_API
#define GUIDRV_LIN_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_2 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_2 &GUIDRV_Win_API
#define GUIDRV_LIN_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_4 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_4 &GUIDRV_Win_API
#define GUIDRV_LIN_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_8 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_8 &GUIDRV_Win_API
#define GUIDRV_LIN_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_16 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_16 &GUIDRV_Win_API
#define GUIDRV_LIN_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_24 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_24 &GUIDRV_Win_API
#define GUIDRV_LIN_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OY_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OX_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OXY_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OS_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OSY_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OSX_32 &GUIDRV_Win_API
#define GUIDRV_LIN_OSXY_32 &GUIDRV_Win_API
#else
#define GUIDRV_LIN_1 &GUIDRV_Lin_1_API
#define GUIDRV_LIN_OY_1 &GUIDRV_Lin_OY_1_API
#define GUIDRV_LIN_OX_1 &GUIDRV_Lin_OX_1_API
#define GUIDRV_LIN_OXY_1 &GUIDRV_Lin_OXY_1_API
#define GUIDRV_LIN_OS_1 &GUIDRV_Lin_OS_1_API
#define GUIDRV_LIN_OSY_1 &GUIDRV_Lin_OSY_1_API
#define GUIDRV_LIN_OSX_1 &GUIDRV_Lin_OSX_1_API
#define GUIDRV_LIN_OSXY_1 &GUIDRV_Lin_OSXY_1_API
#define GUIDRV_LIN_2 &GUIDRV_Lin_2_API
#define GUIDRV_LIN_OY_2 &GUIDRV_Lin_OY_2_API
#define GUIDRV_LIN_OX_2 &GUIDRV_Lin_OX_2_API
#define GUIDRV_LIN_OXY_2 &GUIDRV_Lin_OXY_2_API
#define GUIDRV_LIN_OS_2 &GUIDRV_Lin_OS_2_API
#define GUIDRV_LIN_OSY_2 &GUIDRV_Lin_OSY_2_API
#define GUIDRV_LIN_OSX_2 &GUIDRV_Lin_OSX_2_API
#define GUIDRV_LIN_OSXY_2 &GUIDRV_Lin_OSXY_2_API
#define GUIDRV_LIN_4 &GUIDRV_Lin_4_API
#define GUIDRV_LIN_OY_4 &GUIDRV_Lin_OY_4_API
#define GUIDRV_LIN_OX_4 &GUIDRV_Lin_OX_4_API
#define GUIDRV_LIN_OXY_4 &GUIDRV_Lin_OXY_4_API
#define GUIDRV_LIN_OS_4 &GUIDRV_Lin_OS_4_API
#define GUIDRV_LIN_OSY_4 &GUIDRV_Lin_OSY_4_API
#define GUIDRV_LIN_OSX_4 &GUIDRV_Lin_OSX_4_API
#define GUIDRV_LIN_OSXY_4 &GUIDRV_Lin_OSXY_4_API
#define GUIDRV_LIN_8 &GUIDRV_Lin_8_API
#define GUIDRV_LIN_OY_8 &GUIDRV_Lin_OY_8_API
#define GUIDRV_LIN_OX_8 &GUIDRV_Lin_OX_8_API
#define GUIDRV_LIN_OXY_8 &GUIDRV_Lin_OXY_8_API
#define GUIDRV_LIN_OS_8 &GUIDRV_Lin_OS_8_API
#define GUIDRV_LIN_OSY_8 &GUIDRV_Lin_OSY_8_API
#define GUIDRV_LIN_OSX_8 &GUIDRV_Lin_OSX_8_API
#define GUIDRV_LIN_OSXY_8 &GUIDRV_Lin_OSXY_8_API
#define GUIDRV_LIN_16 &GUIDRV_Lin_16_API
#define GUIDRV_LIN_OY_16 &GUIDRV_Lin_OY_16_API
#define GUIDRV_LIN_OX_16 &GUIDRV_Lin_OX_16_API
#define GUIDRV_LIN_OXY_16 &GUIDRV_Lin_OXY_16_API
#define GUIDRV_LIN_OS_16 &GUIDRV_Lin_OS_16_API
#define GUIDRV_LIN_OSY_16 &GUIDRV_Lin_OSY_16_API
#define GUIDRV_LIN_OSX_16 &GUIDRV_Lin_OSX_16_API
#define GUIDRV_LIN_OSXY_16 &GUIDRV_Lin_OSXY_16_API
#define GUIDRV_LIN_24 &GUIDRV_Lin_24_API
#define GUIDRV_LIN_OY_24 &GUIDRV_Lin_OY_24_API
#define GUIDRV_LIN_OX_24 &GUIDRV_Lin_OX_24_API
#define GUIDRV_LIN_OXY_24 &GUIDRV_Lin_OXY_24_API
#define GUIDRV_LIN_OS_24 &GUIDRV_Lin_OS_24_API
#define GUIDRV_LIN_OSY_24 &GUIDRV_Lin_OSY_24_API
#define GUIDRV_LIN_OSX_24 &GUIDRV_Lin_OSX_24_API
#define GUIDRV_LIN_OSXY_24 &GUIDRV_Lin_OSXY_24_API
#define GUIDRV_LIN_32 &GUIDRV_Lin_32_API
#define GUIDRV_LIN_OY_32 &GUIDRV_Lin_OY_32_API
#define GUIDRV_LIN_OX_32 &GUIDRV_Lin_OX_32_API
#define GUIDRV_LIN_OXY_32 &GUIDRV_Lin_OXY_32_API
#define GUIDRV_LIN_OS_32 &GUIDRV_Lin_OS_32_API
#define GUIDRV_LIN_OSY_32 &GUIDRV_Lin_OSY_32_API
#define GUIDRV_LIN_OSX_32 &GUIDRV_Lin_OSX_32_API
#define GUIDRV_LIN_OSXY_32 &GUIDRV_Lin_OSXY_32_API
#endif
#if defined(__cplusplus)
}
#endif
#endif
/*************************** End of file ****************************/

View File

@@ -0,0 +1,216 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin_Opt_16.h
Purpose : Optimized routines, included by GUIDRV_Lin_..._16.c
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _FillRectOpt16
*
* Purpose:
* Optimized filling routine for 16 bpp
*/
static void _FillRectOpt16(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
DRIVER_CONTEXT * pContext;
U32 * pDest;
U32 * pDest0;
U32 Off, OffLine;
int RemPixels, NumLines, RemLines, RemItems;
U32 Data, ColorMask;
LCD_PIXELINDEX ColorIndex;
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
ColorIndex = LCD__GetColorIndex();
Off = XY2OFF32(pContext->vxSizePhys, x0, y0);
pDest0 = OFF2PTR32(pContext->VRAMAddr, Off);
RemPixels = x1 - x0 + 1;
NumLines = y1 - y0 + 1;
OffLine = pContext->vxSizePhys >> 1;
pDest = NULL;
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
//
// First DWORD
//
if (x0 & 1) {
for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) {
Data = READ_MEM32P(pDest);
#if (LCD_ENDIAN_BIG == 0)
Data ^= 0xFFFF0000;
#else
Data ^= 0xFFFF;
#endif
WRITE_MEM32P(pDest, Data);
pDest += OffLine;
}
pDest0++;
RemPixels--;
}
//
// Complete DWORDS
//
if (RemPixels >= 2) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = pDest0 + OffLine * (RemLines - 1);
do {
Data = READ_MEM32P(pDest);
Data ^= 0xFFFFFFFF;
WRITE_MEM32P(pDest, Data);
pDest++;
RemItems -= 2;
} while (RemItems >= 2);
}
pDest0 = pDest;
RemPixels -= (RemPixels >> 1) << 1;
}
//
// Last DWORD
//
if (RemPixels > 0) {
for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) {
Data = READ_MEM32P(pDest);
#if (LCD_ENDIAN_BIG == 0)
Data ^= 0xFFFF;
#else
Data ^= 0xFFFF0000;
#endif
WRITE_MEM32P(pDest, Data);
pDest += OffLine;
}
}
} else {
//
// First DWORD
//
if (x0 & 1) {
for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) {
Data = READ_MEM32P(pDest);
#if (LCD_ENDIAN_BIG == 0)
Data &= 0xFFFF;
Data |= (((U32)ColorIndex) << 16);
#else
Data &= 0xFFFF0000;
Data |= ColorIndex;
#endif
WRITE_MEM32P(pDest, Data);
pDest += OffLine;
}
pDest0++;
RemPixels--;
}
//
// Complete DWORDS
//
ColorMask = ColorIndex * 0x00010001;
if (RemPixels >= 16) {
RemPixels -= 16;
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = pDest0 + OffLine * (RemLines - 1);
do {
WRITE_MEM32P(pDest, ColorMask);
WRITE_MEM32P(pDest + 1, ColorMask);
WRITE_MEM32P(pDest + 2, ColorMask);
WRITE_MEM32P(pDest + 3, ColorMask);
WRITE_MEM32P(pDest + 4, ColorMask);
WRITE_MEM32P(pDest + 5, ColorMask);
WRITE_MEM32P(pDest + 6, ColorMask);
WRITE_MEM32P(pDest + 7, ColorMask);
pDest += 8;
RemItems -= 16;
} while (RemItems >= 0);
}
pDest0 = pDest;
RemPixels += 16;
RemPixels -= (RemPixels >> 4) << 4;
}
if (RemPixels >= 2) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = pDest0 + OffLine * (RemLines - 1);
do {
WRITE_MEM32P(pDest, ColorMask);
pDest++;
RemItems -= 2;
} while (RemItems >= 2);
}
pDest0 = pDest;
RemPixels -= (RemPixels >> 1) << 1;
}
//
// Last DWORD
//
if (RemPixels > 0) {
for (RemLines = NumLines, pDest = pDest0; RemLines; RemLines--) {
Data = READ_MEM32P(pDest);
#if (LCD_ENDIAN_BIG == 0)
Data &= 0xFFFF0000;
Data |= ColorIndex;
#else
Data &= 0xFFFF;
Data |= (((U32)ColorIndex) << 16);
#endif
WRITE_MEM32P(pDest, Data);
pDest += OffLine;
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,299 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin_Opt_24.h
Purpose : Optimized routines, included by GUIDRV_Lin_..._24.c
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _FillRectOpt24
*
* Purpose:
* Optimized filling routine for 24 bpp
*/
static void _FillRectOpt24(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
DRIVER_CONTEXT * pContext;
U32 Off, Off0, OffLine;
int RemPixels, NumLines, RemLines, RemItems, Odd;
U32 Data, Data0, Data1, Data2;
LCD_PIXELINDEX ColorIndex;
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0);
RemPixels = x1 - x0 + 1;
Odd = x0 & 3;
NumLines = y1 - y0 + 1;
OffLine = (pContext->vxSizePhys + pContext->vxSizePhys +pContext->vxSizePhys) >> 2;
RemItems = 0;
Off = 0;
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
//
// First triple DWORD
//
if (Odd) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
Data = READ_MEM32(pContext->VRAMAddr, Off);
switch (Odd) {
case 1:
Data ^= 0xFF000000;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data ^= 0x0000FFFF;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
break;
}
//
// no break at this position required...
//
case 2:
Data ^= 0xFFFF0000;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data ^= 0x000000FF;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
break;
}
//
// no break at this position required...
//
case 3:
Data ^= 0xFFFFFF00;
RemItems--;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
}
}
Off0 = Off;
RemPixels -= (RemPixels - RemItems);
}
//
// Complete triple DWORDS
//
if (RemPixels >= 4) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
do {
Data = READ_MEM32(pContext->VRAMAddr, Off + 0);
Data ^= 0xFFFFFFFF;
WRITE_MEM32(pContext->VRAMAddr, Off + 0, Data);
Data = READ_MEM32(pContext->VRAMAddr, Off + 1);
Data ^= 0xFFFFFFFF;
WRITE_MEM32(pContext->VRAMAddr, Off + 1, Data);
Data = READ_MEM32(pContext->VRAMAddr, Off + 2);
Data ^= 0xFFFFFFFF;
WRITE_MEM32(pContext->VRAMAddr, Off + 2, Data);
Off += 3;
} while ((RemItems -= 4) >= 4);
}
Off0 = Off;
RemPixels -= (RemPixels >> 2) << 2;
}
//
// Last triple DWORD
//
if (RemPixels) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data ^= 0x00FFFFFF;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
continue;
}
Data ^= 0xFF000000;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data ^= 0x0000FFFF;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
continue;
}
Data ^= 0xFFFF0000;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data ^= 0x000000FF;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
}
}
} else {
ColorIndex = LCD__GetColorIndex();
//
// First triple DWORD
//
if (Odd) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
Data = READ_MEM32(pContext->VRAMAddr, Off);
switch (Odd) {
case 1:
Data &= 0x00FFFFFF;
Data |= ColorIndex << 24;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data &= 0xFFFF0000;
Data |= ColorIndex >> 8;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
break;
}
//
// no break at this position required...
//
case 2:
Data &= 0x0000FFFF;
Data |= ColorIndex << 16;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data &= 0xFFFFFF00;
Data |= ColorIndex >> 16;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
break;
}
//
// no break at this position required...
//
case 3:
Data &= 0x000000FF;
Data |= ColorIndex << 8;
RemItems--;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
}
}
Off0 = Off;
RemPixels -= (RemPixels - RemItems);
}
//
// Complete triple DWORDS
//
if (RemPixels >= 4) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
Data0 = (ColorIndex ) | (ColorIndex << 24);
Data1 = (ColorIndex >> 8) | (ColorIndex << 16);
Data2 = (ColorIndex >> 16) | (ColorIndex << 8);
do {
WRITE_MEM32(pContext->VRAMAddr, Off + 0, Data0);
WRITE_MEM32(pContext->VRAMAddr, Off + 1, Data1);
WRITE_MEM32(pContext->VRAMAddr, Off + 2, Data2);
Off += 3;
} while ((RemItems -= 4) >= 4);
}
Off0 = Off;
RemPixels -= (RemPixels >> 2) << 2;
}
//
// Last triple DWORD
//
if (RemPixels) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data &= 0xFF000000;
Data |= ColorIndex;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
continue;
}
Data &= 0x00FFFFFF;
Data |= ColorIndex << 24;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data &= 0xFFFF0000;
Data |= ColorIndex >> 8;
RemItems--;
if (!RemItems) {
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
continue;
}
Data &= 0x0000FFFF;
Data |= ColorIndex << 16;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
Off++;
Data = READ_MEM32(pContext->VRAMAddr, Off);
Data &= 0xFFFFFF00;
Data |= ColorIndex >> 16;
WRITE_MEM32(pContext->VRAMAddr, Off, Data);
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,140 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin_Opt_32.h
Purpose : Optimized routines, included by GUIDRV_Lin_..._32.c
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _FillRectOpt32
*
* Purpose:
* Optimized filling routine for 32 bpp
*/
static void _FillRectOpt32(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
DRIVER_CONTEXT * pContext;
register LCD_PIXELINDEX ColorIndex;
U32 * pDest;
U32 * pDest0;
U32 Off, Off0, RemPixels, NumLines, RemLines, OffLine, RemItems;
LCD_PIXELINDEX IndexMask;
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
RemPixels = x1 - x0 + 1;
NumLines = y1 - y0 + 1;
OffLine = pContext->vxSizePhys;
pDest = NULL;
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
IndexMask = pDevice->pColorConvAPI->pfGetIndexMask();
Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0);
if (RemPixels) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
Off = Off0 + OffLine * (RemLines - 1);
do {
ColorIndex = READ_MEM32(pContext->VRAMAddr, Off);
ColorIndex ^= IndexMask;
WRITE_MEM32(pContext->VRAMAddr, Off, ColorIndex);
Off++;
} while (--RemItems);
}
}
} else {
Off = XY2OFF32(pContext->vxSizePhys, x0, y0);
pDest0 = OFF2PTR32(pContext->VRAMAddr, Off);
ColorIndex = LCD__GetColorIndex();
if (RemPixels >= 16) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = pDest0 + OffLine * (RemLines - 1);
do {
WRITE_MEM32P(pDest , ColorIndex);
WRITE_MEM32P(pDest + 1, ColorIndex);
WRITE_MEM32P(pDest + 2, ColorIndex);
WRITE_MEM32P(pDest + 3, ColorIndex);
WRITE_MEM32P(pDest + 4, ColorIndex);
WRITE_MEM32P(pDest + 5, ColorIndex);
WRITE_MEM32P(pDest + 6, ColorIndex);
WRITE_MEM32P(pDest + 7, ColorIndex);
WRITE_MEM32P(pDest + 8, ColorIndex);
WRITE_MEM32P(pDest + 9, ColorIndex);
WRITE_MEM32P(pDest + 10, ColorIndex);
WRITE_MEM32P(pDest + 11, ColorIndex);
WRITE_MEM32P(pDest + 12, ColorIndex);
WRITE_MEM32P(pDest + 13, ColorIndex);
WRITE_MEM32P(pDest + 14, ColorIndex);
WRITE_MEM32P(pDest + 15, ColorIndex);
pDest += 16;
RemItems -= 16;
} while (RemItems >= 16);
}
pDest0 = pDest;
RemPixels -= (RemPixels >> 4) << 4;
}
if (RemPixels) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = pDest0 + OffLine * (RemLines - 1);
do {
WRITE_MEM32P(pDest, ColorIndex);
pDest++;
} while (--RemItems);
}
}
}
}
/*************************** End of file ****************************/

View File

@@ -0,0 +1,210 @@
/*********************************************************************
* Portions COPYRIGHT 2016 STMicroelectronics *
* Portions SEGGER Microcontroller GmbH & Co. KG *
* Solutions for real time microcontroller applications *
**********************************************************************
* *
* (c) 1996 - 2015 SEGGER Microcontroller GmbH & Co. KG *
* *
* Internet: www.segger.com Support: support@segger.com *
* *
**********************************************************************
** emWin V5.32 - Graphical user interface for embedded applications **
All Intellectual Property rights in the Software belongs to SEGGER.
emWin is protected by international copyright laws. Knowledge of the
source code may not be used to write a similar product. This file may
only be used in accordance with the following terms:
The software has been licensed to STMicroelectronics International
N.V. a Dutch company with a Swiss branch and its headquarters in Plan-
les-Ouates, Geneva, 39 Chemin du Champ des Filles, Switzerland for the
purposes of creating libraries for ARM Cortex-M-based 32-bit microcon_
troller products commercialized by Licensee only, sublicensed and dis_
tributed under the terms and conditions of the End User License Agree_
ment supplied by STMicroelectronics International N.V.
Full source code is available at: www.segger.com
We appreciate your understanding and fairness.
----------------------------------------------------------------------
File : GUIDRV_Lin_Opt_8.h
Purpose : Optimized routines, included by GUIDRV_Lin_..._8.c
---------------------------END-OF-HEADER------------------------------
*/
/**
******************************************************************************
* @attention
*
* Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
* You may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* http://www.st.com/software_license_agreement_liberty_v2
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
******************************************************************************
*/
/*********************************************************************
*
* Static functions
*
**********************************************************************
*/
/*********************************************************************
*
* _FillRectOpt8
*
* Purpose:
* Optimized filling routine for 8 bpp
*/
static void _FillRectOpt8(GUI_DEVICE * pDevice, int x0, int y0, int x1, int y1) {
DRIVER_CONTEXT * pContext;
U32 Data, ColorMask, AndMask, Off0, OffLine;
int NumPixel_0, NumPixel_1, RemPixels, NumLines, RemLines, RemItems;
LCD_PIXELINDEX ColorIndex;
U32 * pDest;
pContext = (DRIVER_CONTEXT *)pDevice->u.pContext;
ColorIndex = LCD__GetColorIndex();
Off0 = XY2OFF32(pContext->vxSizePhys, x0, y0);
RemPixels = x1 - x0 + 1;
NumLines = y1 - y0 + 1;
OffLine = pContext->vxSizePhys >> 2;
NumPixel_0 = x0 & 3;
NumPixel_1 = x1 & 3;
if (GUI_pContext->DrawMode & LCD_DRAWMODE_XOR) {
//
// First DWORD
//
if (NumPixel_0) {
for (RemLines = NumLines; RemLines; RemLines--) {
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
AndMask = ~(0xFFFFFFFF << (8 * NumPixel_0));
if ((RemPixels < 3) && (NumPixel_1)) {
AndMask |= ~(0xFFFFFFFF >> (8 * (3 - NumPixel_1)));
}
#if (LCD_ENDIAN_BIG == 1)
MIRROR(AndMask);
#endif
Data = READ_MEM32P(pDest);
Data ^= ~AndMask;
WRITE_MEM32P(pDest, Data);
}
Off0++;
RemPixels -= (4 - NumPixel_0);
}
//
// Complete DWORDS
//
if (RemPixels >= 4) {
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
while (RemItems >= 4) {
Data = READ_MEM32P(pDest);
Data ^= 0xFFFFFFFF;
WRITE_MEM32P(pDest, Data);
pDest++;
RemItems -= 4;
}
}
Off0 += (RemPixels >> 2);
RemPixels -= (RemPixels >> 2) << 2;
}
//
// Last DWORD
//
if (RemPixels > 0) {
for (RemLines = NumLines; RemLines; RemLines--) {
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
AndMask = 0xFFFFFF00 << (8 * NumPixel_1);
#if (LCD_ENDIAN_BIG == 1)
MIRROR(AndMask);
#endif
Data = READ_MEM32P(pDest);
Data ^= ~AndMask;
WRITE_MEM32P(pDest, Data);
}
}
} else {
//
// First DWORD
//
if (NumPixel_0) {
for (RemLines = NumLines; RemLines; RemLines--) {
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
AndMask = ~(0xFFFFFFFF << (8 * NumPixel_0));
if ((RemPixels < 3) && (NumPixel_1)) {
AndMask |= ~(0xFFFFFFFF >> (8 * (3 - NumPixel_1)));
}
ColorMask = (ColorIndex * 0x01010101) & ~AndMask;
#if (LCD_ENDIAN_BIG == 1)
MIRROR(AndMask);
MIRROR(ColorMask);
#endif
Data = READ_MEM32P(pDest);
Data &= AndMask;
Data |= ColorMask;
WRITE_MEM32P(pDest, Data);
}
Off0++;
RemPixels -= (4 - NumPixel_0);
}
//
// Complete DWORDS
//
if (RemPixels >= 4) {
ColorMask = ColorIndex * 0x01010101;
for (RemLines = NumLines; RemLines; RemLines--) {
RemItems = RemPixels;
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
while (RemItems >= 32) {
WRITE_MEM32P(pDest , ColorMask);
WRITE_MEM32P(pDest + 1, ColorMask);
WRITE_MEM32P(pDest + 2, ColorMask);
WRITE_MEM32P(pDest + 3, ColorMask);
WRITE_MEM32P(pDest + 4, ColorMask);
WRITE_MEM32P(pDest + 5, ColorMask);
WRITE_MEM32P(pDest + 6, ColorMask);
WRITE_MEM32P(pDest + 7, ColorMask);
pDest += 8;
RemItems -= 32;
}
while (RemItems >= 4) {
WRITE_MEM32P(pDest, ColorMask);
pDest++;
RemItems -= 4;
}
}
Off0 += (RemPixels >> 2);
RemPixels -= (RemPixels >> 2) << 2;
}
//
// Last DWORD
//
if (RemPixels > 0) {
for (RemLines = NumLines; RemLines; RemLines--) {
pDest = ((U32 *)pContext->VRAMAddr) + Off0 + OffLine * (RemLines - 1);
AndMask = 0xFFFFFF00 << (8 * NumPixel_1);
ColorMask = (ColorIndex * 0x01010101) & ~AndMask;
#if (LCD_ENDIAN_BIG == 1)
MIRROR(AndMask);
MIRROR(ColorMask);
#endif
Data = READ_MEM32P(pDest);
Data &= AndMask;
Data |= ColorMask;
WRITE_MEM32P(pDest, Data);
}
}
}
}
/*************************** End of file ****************************/

Some files were not shown because too many files have changed in this diff Show More