Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions ugui.h → inc/ugui.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,24 @@
#ifndef __UGUI_H
#define __UGUI_H

#include "system.h"
#include <stdint.h>
#include "ugui_config.h"

typedef uint8_t UG_U8;
typedef int8_t UG_S8;
typedef uint16_t UG_U16;
typedef int16_t UG_S16;
typedef uint32_t UG_U32;
typedef int32_t UG_S32;

/* -------------------------------------------------------------------------------- */
/* -- µGUI FONTS -- */
/* -- Source: http://www.mikrocontroller.net/user/show/benedikt -- */
/* -------------------------------------------------------------------------------- */
typedef enum
{
FONT_TYPE_1BPP,
FONT_TYPE_8BPP
FONT_TYPE_1BPP,
FONT_TYPE_8BPP
} FONT_TYPE;

typedef struct
Expand Down Expand Up @@ -155,8 +161,8 @@ typedef UG_U16 UG_COLOR;
/* -------------------------------------------------------------------------------- */
/* -- FUNCTION RESULTS -- */
/* -------------------------------------------------------------------------------- */
#define UG_RESULT_FAIL -1
#define UG_RESULT_OK 0
#define UG_RESULT_FAIL (UG_U8)(-1)
#define UG_RESULT_OK (UG_U8)(0)

/* -------------------------------------------------------------------------------- */
/* -- UNIVERSAL STRUCTURES -- */
Expand Down Expand Up @@ -895,9 +901,9 @@ void UG_DrawCircle( UG_S16 x0, UG_S16 y0, UG_S16 r, UG_COLOR c );
void UG_FillCircle( UG_S16 x0, UG_S16 y0, UG_S16 r, UG_COLOR c );
void UG_DrawArc( UG_S16 x0, UG_S16 y0, UG_S16 r, UG_U8 s, UG_COLOR c );
void UG_DrawLine( UG_S16 x1, UG_S16 y1, UG_S16 x2, UG_S16 y2, UG_COLOR c );
void UG_PutString( UG_S16 x, UG_S16 y, char* str );
void UG_PutString( UG_S16 x, UG_S16 y, const char* str );
void UG_PutChar( char chr, UG_S16 x, UG_S16 y, UG_COLOR fc, UG_COLOR bc );
void UG_ConsolePutString( char* str );
void UG_ConsolePutString( const char* str );
void UG_ConsoleSetArea( UG_S16 xs, UG_S16 ys, UG_S16 xe, UG_S16 ye );
void UG_ConsoleSetForecolor( UG_COLOR c );
void UG_ConsoleSetBackcolor( UG_COLOR c );
Expand Down
131 changes: 68 additions & 63 deletions ugui_config.h → inc/ugui_config.h
Original file line number Diff line number Diff line change
@@ -1,63 +1,68 @@
#ifndef __UGUI_CONFIG_H
#define __UGUI_CONFIG_H

/* -------------------------------------------------------------------------------- */
/* -- CONFIG SECTION -- */
/* -------------------------------------------------------------------------------- */

//#define USE_MULTITASKING

/* Enable color mode */
#define USE_COLOR_RGB888 // RGB = 0xFF,0xFF,0xFF
//#define USE_COLOR_RGB565 // RGB = 0bRRRRRGGGGGGBBBBB

/* Enable needed fonts here */
//#define USE_FONT_4X6
//#define USE_FONT_5X8
//#define USE_FONT_5X12
//#define USE_FONT_6X8
//#define USE_FONT_6X10
//#define USE_FONT_7X12
//#define USE_FONT_8X8
//#define USE_FONT_8X12_CYRILLIC
//#define USE_FONT_8X12
//#define USE_FONT_8X12
//#define USE_FONT_8X14
//#define USE_FONT_10X16
//#define USE_FONT_12X16
//#define USE_FONT_12X20
//#define USE_FONT_16X26
//#define USE_FONT_22X36
//#define USE_FONT_24X40
//#define USE_FONT_32X53

/* Specify platform-dependent integer types here */

#define __UG_FONT_DATA const
typedef uint8_t UG_U8;
typedef int8_t UG_S8;
typedef uint16_t UG_U16;
typedef int16_t UG_S16;
typedef uint32_t UG_U32;
typedef int32_t UG_S32;


/* Example for dsPIC33
typedef unsigned char UG_U8;
typedef signed char UG_S8;
typedef unsigned int UG_U16;
typedef signed int UG_S16;
typedef unsigned long int UG_U32;
typedef signed long int UG_S32;
*/

/* -------------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------------- */


/* Feature enablers */
#define USE_PRERENDER_EVENT
#define USE_POSTRENDER_EVENT


#endif
#ifndef __UGUI_CONFIG_H
#define __UGUI_CONFIG_H

#include <stdint.h>

/* -------------------------------------------------------------------------------- */
/* -- CONFIG SECTION -- */
/* -------------------------------------------------------------------------------- */

//#define USE_MULTITASKING

/* Enable color mode */
#define USE_COLOR_RGB888 // RGB = 0xFF,0xFF,0xFF
//#define USE_COLOR_RGB565 // RGB = 0bRRRRRGGGGGGBBBBB

/* Enable needed fonts here */
//#define USE_FONT_4X6
//#define USE_FONT_5X8
//#define USE_FONT_5X12
//#define USE_FONT_6X8
//#define USE_FONT_6X10
//#define USE_FONT_7X12
//#define USE_FONT_8X8
//#define USE_FONT_8X12_CYRILLIC
//#define USE_FONT_8X12
//#define USE_FONT_8X12
//#define USE_FONT_8X14
//#define USE_FONT_10X16
//#define USE_FONT_12X16
//#define USE_FONT_12X20
//#define USE_FONT_16X26
//#define USE_FONT_22X36
//#define USE_FONT_24X40
//#define USE_FONT_32X53

/* Specify platform-dependent integer types here */

#define __UG_FONT_DATA const
/* Override if you store font data not in RAM/SRAM
* for example for pgm_read_byte w/ PROGMEM on AVR */
#define FONT_DATA_ACCESS(x) (x)
typedef uint8_t UG_U8;
typedef int8_t UG_S8;
typedef uint16_t UG_U16;
typedef int16_t UG_S16;
typedef uint32_t UG_U32;
typedef int32_t UG_S32;


/* Example for dsPIC33
typedef unsigned char UG_U8;
typedef signed char UG_S8;
typedef unsigned int UG_U16;
typedef signed int UG_S16;
typedef unsigned long int UG_U32;
typedef signed long int UG_S32;
*/

/* -------------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------------- */


/* Feature enablers */
#define USE_PRERENDER_EVENT
#define USE_POSTRENDER_EVENT


#endif
Loading