资源简介
基于STM32F103实现闹钟时间在一块2.4英寸的LCD上显示,并可以通过两个按键调整时间(分钟、小时),按一下第三个键,进入闹钟响起时间设置模式,在按那两个按键则是调整闹钟响起时间。
代码片段和文件信息
/******************** (C) COPYRIGHT 2007 STMicroelectronics ********************
* File Name : lcd.c
* Author : MCD Application Team
* Version : V1.0
* Date : 10/08/2007
* Description : This file includes the LCD driver for AM-240320LTNQW00H
* (LCD_HX8312) and AM-240320L8TNQW00H (LCD_ILI9320)
* Liquid Crystal Display Module of STM3210B-EVAL board.
********************************************************************************
* THE PRESENT SOFTWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH SOFTWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include “main.h“
#include “fonts.h“
#include “spi_flash.h“
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
#ifdef LCD_ILI9320
#define START_BYTE 0x70
#define SET_INDEX 0x00
#define READ_STATUS 0x01
#define WRITE_REG 0x02
#define READ_REG 0x03
#endif
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Global variables to set the written text color */
static vu16 TextColor = 0x0000 BackColor = 0xFFFF;
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/*******************************************************************************
* Function Name : STM3210B_LCD_Init
* Description : Initializes the LCD.
* Input : None
* Output : None
* Return : None
*******************************************************************************/
void STM3210B_LCD_Init(void)
{
/* Configure the LCD Control pins --------------------------------------------*/
LCD_CtrlLinesConfig();
/* Configure the SPI2 interface ----------------------------------------------*/
LCD_SPIConfig();
#ifdef LCD_ILI9320
Delay(5); // delay 50 ms
/* Start Initial Sequence ----------------------------------------------------*/
LCD_WriteReg(R229 0x8000); /* Set the internal vcore voltage */
LCD_WriteReg(R0 0x0001); /* Start internal OSC. */
LCD_WriteReg(R1 0x0100); /* set SS and SM bit */
LCD_WriteReg(R2 0x0700); /* set 1 line inversion */
LCD_WriteReg(R3 0x1030); /* set GRAM write direct
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 26712 2010-08-29 14:44 (已调-20) RTC+LCD+Key+Speaker\fonts.h
文件 40593 2010-10-15 09:53 (已调-20) RTC+LCD+Key+Speaker\lcd.c
文件 7188 2010-07-18 10:56 (已调-20) RTC+LCD+Key+Speaker\lcd.h
文件 27308 2010-11-01 17:03 (已调-20) RTC+LCD+Key+Speaker\main.c
文件 1680 2010-07-18 10:56 (已调-20) RTC+LCD+Key+Speaker\main.h
文件 2308 2010-07-18 10:56 (已调-20) RTC+LCD+Key+Speaker\readme.txt
文件 9403 2010-07-18 10:56 (已调-20) RTC+LCD+Key+Speaker\RVMDK\cortexm3_macro.s
文件 961 2010-07-18 10:56 (已调-20) RTC+LCD+Key+Speaker\RVMDK\FLASH.ini
文件 153766 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\List\BOOT_FLASH.map
文件 23741 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\List\cortexm3_macro.lst
文件 28450 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\List\stm32f10x_vector.lst
文件 152448 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.axf
文件 59377 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.htm
文件 900 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.lnp
文件 208 2010-11-02 10:36 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.plg
文件 479 2010-08-27 22:03 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.sct
文件 2931 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\BOOT_FLASH.tra
文件 2392 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\cortexm3_macro.o
文件 19 2010-11-01 17:04 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\ExtDll.iex
文件 1241 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\lcd.d
文件 176824 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\lcd.o
文件 1267 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\main.d
文件 158944 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\main.o
文件 1325 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\spi_flash.d
文件 138216 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\spi_flash.o
文件 405 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\stm32f10x_adc.d
文件 89532 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\stm32f10x_adc.o
文件 405 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\stm32f10x_bkp.d
文件 47336 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\stm32f10x_bkp.o
文件 405 2010-11-01 17:00 (已调-20) RTC+LCD+Key+Speaker\RVMDK\Obj\stm32f10x_can.d
............此处省略63个文件信息
- 上一篇:qgs格式的中国地图
- 下一篇:I2C代码 Verilog
评论
共有 条评论