📄 circle.h
字号:
void POINTER_SetCurrentPointer( unsigned char width, unsigned char height, unsigned char *bmp);
enum POINTER_state POINTER_GetState(void);
void POINTER_Draw (u8 Line, u8 Column, u8 Width, u8 Height, u8 *Bmp);
void POINTER_SetRect ( s16 x, s16 y, s16 width, s16 height ); //Restrict the move of the pointer to a rectangle
void POINTER_SetRectScreen ( void ); //Remove any space restriction for the pointer moves.
void POINTER_Save (u8 Line, u8 Column, u8 Width, u8 Height);
void POINTER_Restore (u8 Line, u8 Column, u8 Width, u8 Height);
u16 POINTER_GetPos(void); //Return the poistion of the cursor (x=lower byte, y = upperbyte)
void POINTER_SetPos ( u16 x, u16 y );
typedef void (*tAppPtrMgr) ( int , int );
void POINTER_SetApplication_Pointer_Mgr( tAppPtrMgr mgr );
tPointer_Info* POINTER_GetInfo ( void );
u16 POINTER_GetColor ( void ) ;
void POINTER_SetColor ( u16 color );
enum POINTER_mode POINTER_GetMode( void );
void POINTER_SetCurrentAreaStore ( u8 *ptr );
void LCD_SetRotateScreen ( u8 RotateScreen);
u8 LCD_GetRotateScreen ();
void LCD_SetScreenOrientation (Rotate_H12_V_Match_TypeDef ScreenOrientation);
Rotate_H12_V_Match_TypeDef LCD_GetScreenOrientation ();
//---------------------------------- LCD -----------------------------------
/* Exported defines ----------------------------------------------------------*/
//RGB is 16-bit coded as G2G1G0B4 B3B2B1B0 R4R3R2R1 R0G5G4G3
#define RGB_MAKE(xR,xG,xB) ( ( (xG&0x07)<<13 ) + ( (xG)>>5 ) + \
( ((xB)>>3) << 8 ) + \
( ((xR)>>3) << 3 ) )
#define RGB_RED 0x00F8
#define RGB_BLACK 0x0000
#define RGB_WHITE 0xffff
#define RGB_BLUE 0x1F00
#define RGB_GREEN 0xE007
#define RGB_YELLOW (RGB_GREEN|RGB_RED)
#define RGB_MAGENTA (RGB_BLUE|RGB_RED)
#define RGB_LIGHTBLUE (RGB_BLUE|RGB_GREEN)
#define RGB_ORANGE (RGB_RED | 0xE001) //green/2 + red
#define RGB_PINK (RGB_MAGENTA | 0xE001) //green/2 + magenta
// SCREEN Infos
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 128
#define CHIP_SCREEN_WIDTH 132
#define CHIP_SCREEN_HEIGHT 132
// Characters Infos
#define CHAR_WIDTH 7
#define CHAR_HEIGHT 14
// PWM rates.
#define BACKLIGHTMIN 0x1000 /*!< Minimal PWM rate. */
#define DEFAULT_CCR_BACKLIGHTSTART 0x8000 /*!< Default PWM rate. */
/* Exported vars -------------------------------------------------------------*/
extern Rotate_H12_V_Match_TypeDef Screen_Orientation;
extern int rotate_screen;
/* Exported functions --------------------------------------------------------*/
void LCD_Init(void);
void LCD_Handler(void);
void LCD_SetRect_For_Cmd( s16 x, s16 y, s16 width, s16 height );
u16 LCD_GetPixel( u8 x, u8 y );
void LCD_DrawPixel( u8 x, u8 y, u16 Pixel );
void LCD_SendLCDCmd( u8 Cmd );
void LCD_SendLCDData( u8 Data );
u32 LCD_ReadLCDData( void );
void LCD_FillRect( u16 x, u16 y, u16 width, u16 height, u16 color );
void LCD_DrawRect( u16 x, u16 y, u16 width, u16 height, u16 color );
void LCD_DisplayChar( u8 x, u8 y, u8 Ascii, u16 TextColor, u16 BGndColor, u16 CharMagniCoeff );
void LCD_RectRead( u16 x, u16 y, u16 width, u16 height, u8* bmp );
void LCD_SetBackLight (u32 newBacklightStart);
u32 LCD_GetBackLight ( void );
void LCD_SetBackLightOff( void );
void LCD_SetBackLightOn( void );
#include "lcd.h"
//---------------------------------- DRAW ----------------------------------
/* Exported functions --------------------------------------------------------*/
void DRAW_Init(void);
void DRAW_Clear(void);
void DRAW_Handler(void);
void DRAW_SetDefaultColor (void);
void DRAW_SetImage(const u16 *imageptr, u8 x, u8 y, u8 width, u8 height);
void DRAW_SetImageBW(const u8 *imageptr, u8 x, u8 y, u8 width, u8 height);
void DRAW_SetLogoBW(void);
void DRAW_DisplayVbat(u8 x, u8 y);
void DRAW_DisplayTime(u8 x, u8 y);
void DRAW_DisplayTemp(u8 x, u8 y);
void DRAW_DisplayString( u8 x, u8 y, const u8 *ptr, u8 len );
void DRAW_DisplayStringInverted( u8 x, u8 y, const u8 *ptr, u8 len );
u16 DRAW_GetCharMagniCoeff(void);
void DRAW_SetCharMagniCoeff(u16 Coeff);
u16 DRAW_GetTextColor(void);
void DRAW_SetTextColor(u16 Color);
u16 DRAW_GetBGndColor(void);
void DRAW_SetBGndColor(u16 Color);
void DRAW_Batt( void );
void DRAW_Line (s16 x1, s16 y1, s16 x2, s16 y2, u16 color );
/* Exported vars -------------------------------------------------------------*/
extern int fDisplayTime;
//-------------------------------- BUZZER -----------------------------------
/* Exported defines ----------------------------------------------------------*/
#define BUZZER_BEEP BUZZER_SHORTBEEP
/* Exported type def ---------------------------------------------------------*/
enum BUZZER_mode { BUZZER_UNDEF = -1, BUZZER_OFF = 0, BUZZER_ON = 1,
BUZZER_SHORTBEEP = 2, BUZZER_LONGBEEP = 3, BUZZER_PLAYMUSIC = 4 };
/* Exported type functions ---------------------------------------------------*/
void BUZZER_Init(void);
void BUZZER_Handler(void);
void BUZZER_SetMode( enum BUZZER_mode mode);
enum BUZZER_mode BUZZER_GetMode( void );
void BUZZER_PlayMusic (const u8 *melody );
//--------------------------------- MENU -----------------------------------
/* Exported defines ----------------------------------------------------------*/
#define MENU_MAXITEM 6
#define APP_VOID ((tMenuItem *)(-1))
#define MAX_APP_MENU_SIZE 10
#define MAXAPP 64
#define MAX_MENUAPP_SIZE 3
#define REMOVE_MENU 0x01
#define APP_MENU 0x02
enum MENU_code { MENU_LEAVE = 0, MENU_CONTINUE = 1, MENU_REFRESH = 2,
MENU_CHANGE = 3, MENU_CONTINUE_COMMAND = 4};
/* Exported type def ---------------------------------------------------------*/
typedef struct
{
const char *Text;
enum MENU_code (*Fct_Init) ( void );
enum MENU_code (*Fct_Manage)( void );
int fMenuFlag;
} tMenuItem;
typedef struct
{
unsigned fdispTitle : 1;
const char *Title;
int NbItems;
int LgMax;
int XPos, YPos;
int XSize, YSize;
unsigned int SelectedItem;
tMenuItem Items[MENU_MAXITEM];
} tMenu;
/* Exported vars -------------------------------------------------------------*/
extern tMenu MainMenu, *CurrentMenu;
extern tMenuItem *CurrentCommand;
extern int BGndColor_Menu;
extern int TextColor_Menu;
/* Exported type functions ---------------------------------------------------*/
enum MENU_code fColor ( void ) ;
void MENU_Set ( tMenu *mptr );
void MENU_Handler ( void ) ;
extern enum MENU_code MENU_Quit ( void );
void MENU_Remove ( void ) ;
void MENU_Question ( char *str, int *answer );
void MENU_Print ( char *str );
enum MENU_code MENU_SetLevel_Ini( void );
enum MENU_code MENU_SetLevel_Mgr( u32 *value, u32 value_range [] ) ;
void MENU_ClearCurrentCommand( void );
void MENU_SetLevelTitle(u8* title);
void MENU_SetTextColor ( int TextColor );
int MENU_GetTextColor ( void );
void MENU_SetBGndColor ( int BGndColor );
int MENU_GetBGndColor ( void );
extern enum MENU_code fQuit ( void ) ;
void MENU_ClearCurrentMenu(void);
//-------------------------------- BACKLIGHT --------------------------------
/* Exported type functions ---------------------------------------------------*/
void BackLight_Configuration (void);
void ManageBackLight (void);
void BackLight_Change (void);
//-------------------------------- RTC --------------------------------------
/* Exported type functions ---------------------------------------------------*/
void RTC_Init(void);
void RTC_SetTime (u32 THH, u32 TMM, u32 TSS);
void RTC_GetTime (u32 * THH, u32 * TMM, u32 * TSS);
void RTC_DisplayTime ( void );
//Backup registers
#define BKP_SYS1 1
#define BKP_SYS2 2
#define BKP_SYS3 3
#define BKP_SYS4 4
#define BKP_SYS5 5
#define BKP_SYS6 6
#define BKP_USER1 7
#define BKP_USER2 8
#define BKP_USER3 9
#define BKP_USER4 10
#define BKP_PLL (BKP_SYS2)
#define BKP_BKLIGHT (BKP_SYS3)
//--------------------------------- Application --------------------------------
void (*Application_Pointer_Mgr) ( int sposX, int sposY);
#endif /*__CIRCLE_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -