专家
公告
财富商城
电子网
旗下网站
首页
问题库
专栏
标签库
话题
专家
NEW
门户
发布
提问题
发文章
STM32
miniSTM32指针时钟画出指针后怎么让指针动起来
2019-08-19 18:17
发布
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
站内问答
/
STM32/STM8
12833
14
1496
求教过说是设置清屏,具体源代码有谁可以提供下么,小白求助
友情提示:
此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
14条回答
fanghuiopenedv
2019-08-20 15:12
#ifndef __LCD_H_
#define __LCD_H_
#include "stm32f10x_conf.h"
/* LCD显示相关参数 */
#define HDP 799 //Horizontal Display 
eriod
#define HT 1000 //Horizontal Total
#define HPS 51 //LLINE 
ulse Start 
osition
#define LPS 3 // Horizontal Display 
eriod Start 
osition
#define HPW 8 // LLINE 
ulse Width
#define VDP 479 //Vertical Display 
eriod
#define VT 530 //Vertical Total
#define VPS 24 //LFRAME 
ulse Start 
osition
#define FPS 23 //Vertical Display 
eriod Start Positio
#define VPW 3 //LFRAME Pulse Width
/* 定义LCD的尺寸 */
#define LCD_W 800
#define LCD_H 480
/*Private define-------------------------*/
#define POINT_COLOR RED
#define BACK_COLOR 0xFFFF
/*--------16位颜 {MOD}值---------------*/
//#define WHITE 0xFFFF
//#define BLACK 0x0000
//#define BLUE 0x001F
//#define RED 0xF800
//#define MAGENTA 0xF81F
//#define GREEN 0x07E0
//#define CYAN 0x7FFF
//#define YELLOW 0xFFE0
//#define BROWN 0XBC40 //棕 {MOD}
//#define BRRED 0XFC07 //棕红 {MOD}
//#define GRAY 0X8430 //灰 {MOD}
//#define LGRAY 0XC618 //浅灰 {MOD}
#define PI 3.14159
#define CLOCK_BK_COLOR GUI_BLUE //定义背景 {MOD}
#define CLOCK_COLOR GUI_BLACK //定义画笔颜 {MOD}
#define CLOCK_CENTER_X 200//95 //时钟圆心横坐标
#define CLOCK_CENTER_Y 280//110 //时钟圆心纵坐标
#define CLOCK_RADIUS 150//90 //时钟半径
#define CLOCK_RADIUS_W 4 //定义时钟外部轮廓厚度
#define CLOCK_RADIUS_M 3 //时钟中心小圆的半径
#define SCALL_OFFSET_B 12// 6 //定义整点时间点坐标偏移量
#define SCALL_OFFSET_S 8// 4 //非整点坐标偏移量
#define NUMBER_OFFSET 28//14 //数字显示的偏移量
#define SEC_PTR_OFFSET 45//25 //定义秒针的偏移量
#define MIN_PTR_OFFSET 60//35 //定义分针的偏移量
#define HOUR_PTR_OFFSET 80//50 //定义时针的偏移量
//--------------------------------------------------------------
#define Bank1_LCD_D ((uint32_t)0x6C000001) // Data ADDR
#define Bank1_LCD_C ((uint32_t)0x6C000000) // Reg ADDR
//#define LCD_bk_light PDout(3)
//#define LCD_Reset PGout(15)
//#define LCD_Width 320 //LCD 宽度
//#define LCD_Height 240 //LCD 高度
/*****************常用颜 {MOD}定义*****************************/
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40 //棕 {MOD}
#define BRRED 0XFC07 //棕红 {MOD}
#define GRAY 0X8430 //灰 {MOD}
//GUI颜 {MOD}
#define DARKBLUE 0X01CF //深蓝 {MOD}
#define LIGHTBLUE 0X7D7C //浅蓝 {MOD}
#define GRAYBLUE 0X5458 //灰蓝 {MOD}
//以上三 {MOD}为PANEL的颜 {MOD}
#define LIGHTGREEN 0X841F //浅绿 {MOD}
#define LIGHTGRAY 0XEF5B //浅灰 {MOD}(PANNEL)
#define LGRAY 0XC618 //浅灰 {MOD}(PANNEL),窗体背景 {MOD}
#define LGRAYBLUE 0XA651 //浅灰蓝 {MOD}(中间层颜 {MOD})
#define LBBLUE 0X2B12 //浅棕蓝 {MOD}(选择条目的反 {MOD})
/*----------函数声明------------*/
void LCD_FSMCConfiguration(void);
void LCD_Configuration(void);
void LCD_Init(void);
void LCD_WR_REG(uint16_t LCD_Reg);
void LCD_WR_DATA(uint16_t LCD_Data);
u16 LCD_ReadReg(uint16_t LCD_Reg);
void LCD_WriteReg(uint16_t LCD_Reg ,uint16_t LCD_RegValue);
void LCD_WR_DATA_Prepare(void);
void LCD_SetCursor(u16 Xpos, u16 Ypos);
u16 LCD_ReadPoint(u16 x,u16 y);
void LCD_Clear(uint16_t Color);
void LCD_Draw_Pixel(uint16_t xsta, uint16_t ysta, uint16_t color);
void LCD_WindowMax (unsigned int xsta,unsigned int ysta,unsigned int xend,unsigned int yend);
void LCD_Fill_color(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t colour);
void LCD_Draw_Line(u16 x1, u16 y1, u16 x2, u16 y2,u16 color);
void LCD_Draw_Circle(u16 x0,u16 y0,u8 r,u16 color);
void LCD_Fill_Circle(u16 x0,u16 y0,u8 r,u16 color);
void LCD_Draw_Rectangle(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color);
void WriteOneChar(u16 x, u16 y, u8 num, u16 PenColor, u16 BackColor);
u32 mypow(u8 m,u8 n);
void LCD_ShowNum(uint16_t x,uint16_t y,u32 num,u8 len, u16 PenColor, u16 BackColor);
u16 findHzIndex(u8 *hz);
u8 WriteOneHz(u16 x0, u16 y0, u8 *pucMsk, u16 PenColor, u16 BackColor);
void LCD_ShowString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
u16 LCD_RGBtoBGR(u16 Color);
void LCD_Draw_Picture(u16 Xpos,u16 Ypos,u16 Height,u16 Width,u8 *pic);
void Draw_big_line(u16 x1, u16 y1, u16 x2, u16 y2,u8 num,u16 color);
//---------------------------------------------------------------------------------------------
//画时分秒指针
//void DrawClockPointer(u8 hour, u8 min, u8 sec,u16 color);
void DrawClockPointer(u8 hour, u8 min, u8 sec,u16 hour_color,u16 min_color,u16 sec_color);
//清时分秒指针
void ClearClockPointer(u8 hour, u8 min, u8 sec,u16 color);
//画时钟的边界
void DrawClockBorder(u16 color);
//---------------------------------------------------------------------------------------------
//24*12的字体2014-02-24添加
void LCD_Show24Char(u16 x, u16 y, u8 num, u16 PenColor, u16 BackColor);
void LCD_Show24Num(uint16_t x,uint16_t y,u32 num,u8 len, u16 PenColor, u16 BackColor);
void LCD_Show24Float(uint16_t x,uint16_t y,u32 num,u8 len_T,u8 len_int, u16 PenColor, u16 BackColor);
void LCD_Show24String(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
u16 find24HzIndex(u8 *hz);
void LCD_ShowOne24Hz(u16 x, u16 y, u8 *pucMsk, u16 PenColor, u16 BackColor);
void LCD_bmp_Picture(u16 xstr,u16 ystr,u16 xend,u16 yend,u8 *pic,u16 PenColor, u16 BackColor);
//void LCD_bmp_Picture_2(u16 xstr,u16 ystr,u16 xend,u16 yend,u8 *pic,u16 PenColor, u16 BackColor);
void LCD_bmp_Full_Picture(u8 *pic,u16 PenColor, u16 BackColor);
//-------------------------------------------------------------------------
//别处复制的
//void sLCD_WR_REG(unsigned int index);
//__INLINE void sLCD_WR_Data(unsigned int val);
//u16 sLCD_Read_Data(void);
//void sLCD_OpenWindow(u32 x1, u32 y1, u32 x2, u32 y2);
//void LCD_SetPoint(u16 x,u16 y,u16 c);
//u16 LCD_GetPoint(u16 x, u16 y);
#endif
加载中...
查看其它14个回答
一周热门
更多
>
相关问题
STM32F4上I2C(在PROTEUS中模拟)调试不通的问题
6 个回答
芯片供应紧张,准备换个MCU,MM32L系列替换STM32L系列的怎么样?
7 个回答
STM32同时使用两个串口进行数据收发时数据丢包的问题
5 个回答
STM32F103串口通信死机问题
4 个回答
STM32WLE5CC连接SX1268在LoRa模式下能与 SX1278互通吗?
2 个回答
相关文章
ST公司第一款无线低功耗单片机模块有效提高物联网设计生产效率
0个评论
如何实现对单片机寄存器的访问
0个评论
通过USB用STM32片内自带Bootloader下载程序及注意事项
0个评论
欲练此功必先自宫之STM32汇编启动,放慢是为了更好的前行
0个评论
×
关闭
采纳回答
向帮助了您的知道网友说句感谢的话吧!
非常感谢!
确 认
×
关闭
编辑标签
最多设置5个标签!
STM32
保存
关闭
×
关闭
举报内容
检举类型
检举内容
检举用户
检举原因
广告推广
恶意灌水
回答内容与提问无关
抄袭答案
其他
检举说明(必填)
提交
关闭
×
打开微信“扫一扫”,打开网页后点击屏幕右上角分享按钮
×
付费偷看金额在0.1-10元之间
确定
×
关闭
您已邀请
0
人回答
查看邀请
擅长该话题的人
回答过该话题的人
我关注的人
#define __LCD_H_
#include "stm32f10x_conf.h"
/* LCD显示相关参数 */
#define HDP 799 //Horizontal Display eriod
#define HT 1000 //Horizontal Total
#define HPS 51 //LLINE ulse Start osition
#define LPS 3 // Horizontal Display eriod Start osition
#define HPW 8 // LLINE ulse Width
#define VDP 479 //Vertical Display eriod
#define VT 530 //Vertical Total
#define VPS 24 //LFRAME ulse Start osition
#define FPS 23 //Vertical Display eriod Start Positio
#define VPW 3 //LFRAME Pulse Width
/* 定义LCD的尺寸 */
#define LCD_W 800
#define LCD_H 480
/*Private define-------------------------*/
#define POINT_COLOR RED
#define BACK_COLOR 0xFFFF
/*--------16位颜 {MOD}值---------------*/
//#define WHITE 0xFFFF
//#define BLACK 0x0000
//#define BLUE 0x001F
//#define RED 0xF800
//#define MAGENTA 0xF81F
//#define GREEN 0x07E0
//#define CYAN 0x7FFF
//#define YELLOW 0xFFE0
//#define BROWN 0XBC40 //棕 {MOD}
//#define BRRED 0XFC07 //棕红 {MOD}
//#define GRAY 0X8430 //灰 {MOD}
//#define LGRAY 0XC618 //浅灰 {MOD}
#define PI 3.14159
#define CLOCK_BK_COLOR GUI_BLUE //定义背景 {MOD}
#define CLOCK_COLOR GUI_BLACK //定义画笔颜 {MOD}
#define CLOCK_CENTER_X 200//95 //时钟圆心横坐标
#define CLOCK_CENTER_Y 280//110 //时钟圆心纵坐标
#define CLOCK_RADIUS 150//90 //时钟半径
#define CLOCK_RADIUS_W 4 //定义时钟外部轮廓厚度
#define CLOCK_RADIUS_M 3 //时钟中心小圆的半径
#define SCALL_OFFSET_B 12// 6 //定义整点时间点坐标偏移量
#define SCALL_OFFSET_S 8// 4 //非整点坐标偏移量
#define NUMBER_OFFSET 28//14 //数字显示的偏移量
#define SEC_PTR_OFFSET 45//25 //定义秒针的偏移量
#define MIN_PTR_OFFSET 60//35 //定义分针的偏移量
#define HOUR_PTR_OFFSET 80//50 //定义时针的偏移量
//--------------------------------------------------------------
#define Bank1_LCD_D ((uint32_t)0x6C000001) // Data ADDR
#define Bank1_LCD_C ((uint32_t)0x6C000000) // Reg ADDR
//#define LCD_bk_light PDout(3)
//#define LCD_Reset PGout(15)
//#define LCD_Width 320 //LCD 宽度
//#define LCD_Height 240 //LCD 高度
/*****************常用颜 {MOD}定义*****************************/
#define WHITE 0xFFFF
#define BLACK 0x0000
#define BLUE 0x001F
#define BRED 0XF81F
#define GRED 0XFFE0
#define GBLUE 0X07FF
#define RED 0xF800
#define MAGENTA 0xF81F
#define GREEN 0x07E0
#define CYAN 0x7FFF
#define YELLOW 0xFFE0
#define BROWN 0XBC40 //棕 {MOD}
#define BRRED 0XFC07 //棕红 {MOD}
#define GRAY 0X8430 //灰 {MOD}
//GUI颜 {MOD}
#define DARKBLUE 0X01CF //深蓝 {MOD}
#define LIGHTBLUE 0X7D7C //浅蓝 {MOD}
#define GRAYBLUE 0X5458 //灰蓝 {MOD}
//以上三 {MOD}为PANEL的颜 {MOD}
#define LIGHTGREEN 0X841F //浅绿 {MOD}
#define LIGHTGRAY 0XEF5B //浅灰 {MOD}(PANNEL)
#define LGRAY 0XC618 //浅灰 {MOD}(PANNEL),窗体背景 {MOD}
#define LGRAYBLUE 0XA651 //浅灰蓝 {MOD}(中间层颜 {MOD})
#define LBBLUE 0X2B12 //浅棕蓝 {MOD}(选择条目的反 {MOD})
/*----------函数声明------------*/
void LCD_FSMCConfiguration(void);
void LCD_Configuration(void);
void LCD_Init(void);
void LCD_WR_REG(uint16_t LCD_Reg);
void LCD_WR_DATA(uint16_t LCD_Data);
u16 LCD_ReadReg(uint16_t LCD_Reg);
void LCD_WriteReg(uint16_t LCD_Reg ,uint16_t LCD_RegValue);
void LCD_WR_DATA_Prepare(void);
void LCD_SetCursor(u16 Xpos, u16 Ypos);
u16 LCD_ReadPoint(u16 x,u16 y);
void LCD_Clear(uint16_t Color);
void LCD_Draw_Pixel(uint16_t xsta, uint16_t ysta, uint16_t color);
void LCD_WindowMax (unsigned int xsta,unsigned int ysta,unsigned int xend,unsigned int yend);
void LCD_Fill_color(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t colour);
void LCD_Draw_Line(u16 x1, u16 y1, u16 x2, u16 y2,u16 color);
void LCD_Draw_Circle(u16 x0,u16 y0,u8 r,u16 color);
void LCD_Fill_Circle(u16 x0,u16 y0,u8 r,u16 color);
void LCD_Draw_Rectangle(uint16_t xsta, uint16_t ysta, uint16_t xend, uint16_t yend, uint16_t color);
void WriteOneChar(u16 x, u16 y, u8 num, u16 PenColor, u16 BackColor);
u32 mypow(u8 m,u8 n);
void LCD_ShowNum(uint16_t x,uint16_t y,u32 num,u8 len, u16 PenColor, u16 BackColor);
u16 findHzIndex(u8 *hz);
u8 WriteOneHz(u16 x0, u16 y0, u8 *pucMsk, u16 PenColor, u16 BackColor);
void LCD_ShowString(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
u16 LCD_RGBtoBGR(u16 Color);
void LCD_Draw_Picture(u16 Xpos,u16 Ypos,u16 Height,u16 Width,u8 *pic);
void Draw_big_line(u16 x1, u16 y1, u16 x2, u16 y2,u8 num,u16 color);
//---------------------------------------------------------------------------------------------
//画时分秒指针
//void DrawClockPointer(u8 hour, u8 min, u8 sec,u16 color);
void DrawClockPointer(u8 hour, u8 min, u8 sec,u16 hour_color,u16 min_color,u16 sec_color);
//清时分秒指针
void ClearClockPointer(u8 hour, u8 min, u8 sec,u16 color);
//画时钟的边界
void DrawClockBorder(u16 color);
//---------------------------------------------------------------------------------------------
//24*12的字体2014-02-24添加
void LCD_Show24Char(u16 x, u16 y, u8 num, u16 PenColor, u16 BackColor);
void LCD_Show24Num(uint16_t x,uint16_t y,u32 num,u8 len, u16 PenColor, u16 BackColor);
void LCD_Show24Float(uint16_t x,uint16_t y,u32 num,u8 len_T,u8 len_int, u16 PenColor, u16 BackColor);
void LCD_Show24String(u16 x0, u16 y0, u8 *pcStr, u16 PenColor, u16 BackColor);
u16 find24HzIndex(u8 *hz);
void LCD_ShowOne24Hz(u16 x, u16 y, u8 *pucMsk, u16 PenColor, u16 BackColor);
void LCD_bmp_Picture(u16 xstr,u16 ystr,u16 xend,u16 yend,u8 *pic,u16 PenColor, u16 BackColor);
//void LCD_bmp_Picture_2(u16 xstr,u16 ystr,u16 xend,u16 yend,u8 *pic,u16 PenColor, u16 BackColor);
void LCD_bmp_Full_Picture(u8 *pic,u16 PenColor, u16 BackColor);
//-------------------------------------------------------------------------
//别处复制的
//void sLCD_WR_REG(unsigned int index);
//__INLINE void sLCD_WR_Data(unsigned int val);
//u16 sLCD_Read_Data(void);
//void sLCD_OpenWindow(u32 x1, u32 y1, u32 x2, u32 y2);
//void LCD_SetPoint(u16 x,u16 y,u16 c);
//u16 LCD_GetPoint(u16 x, u16 y);
#endif
一周热门 更多>