/**
******************************************************************************
* @file stm8l1528_eval_glass_lcd.c
* @author MCD Application Team
* @version V2.1.3
* @date 28-June-2013
* @brief This file includes driver for the glass LCD Module mounted on
* Big-Falco EVAL board.
******************************************************************************
*
* 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 "stm8l1528_eval_glass_lcd.h"
/** @addtogroup Utilities
* @{
*/
/** @defgroup STM8L1528_EVAL_GLASS_LCD
* @brief This file includes the LCD Glass driver for Pacific Display
* (Custom LCD 8x40) Module of Big-Falco-EVAL board.
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/**
@verbatim
================================================================================
GLASS LCD MAPPING
================================================================================
A
_ ----------
P|_| |\ |H /|
F| G | I |B
| \ | / |
--M-- --N--
| /| \ |
E| L | J |C
_ | / |K \|
Q|_| -----------
D
A LCD character coding is based on the following matrix:
COM0 COM1 COM4 COM5 COM6 COM7
SEG(n) { 0 , 0 , I , B , C , J }
SEG(n+1) { D , K , A , H , M , N }
SEG(n+2) { Q , L , G , F , P , E }
The character A for example is:
-----------------------------------------------------------
COM0 COM1 COM4 COM5 COM6 COM7
SEG(n) { 0 , 0 , 0 , 1 , 1 , 0 }
SEG(n+1) { 0 , 0 , 1 , 0 , 1 , 1 }
SEG(n+2) { 0 , 0 , 0 , 1 , 0 , 1 }
--------------------------------------------------------
= 0 0 2 5 3 6 hex
=> 'A' = 0x002536
@endverbatim
*/
/**
* @brief LETTERS AND NUMBERS MAPPING DEFINITION
*/
uint16_t i;
CONST uint32_t mask [] =
{
0xF00000, 0x0F0000, 0x00F000, 0x000F00, 0x0000F0, 0x00000F
};
CONST uint8_t shift[6] =
{
20, 16, 12, 8, 4, 0
};
uint8_t digit[6]; /* Digit frame buffer */
/* Letters and number map of the custom LCD 8x40(Big-Falco Evaluation boad) */
CONST uint32_t LetterMap[26] =
{
/* A B C D E F G H I */
0x002536, 0x202536, 0x202404, 0x222310, 0x202426, 0x002426, 0x202416, 0x000536, 0x222200,
/* J K L M N O P Q R */
0x200114, 0x001425, 0x200404, 0x005514, 0x004515, 0x202514, 0x002526, 0x002532, 0x002527,
/* S T U V W X Y Z */
0x202432, 0x022200, 0x200514, 0x041404, 0x050515, 0x045001, 0x025000, 0x243000
};
CONST uint32_t NumberMap[10] =
{
/* 0 1 2 3 4 */
0x202514, 0x000110, 0x202126, 0x202132, 0x000532,
/* 5 6 7 8 9 */
0x202432, 0x202436, 0x002110, 0x202536, 0x202532
};
__IO uint8_t str[7] = "";
/* Private function prototypes -----------------------------------------------*/
static void Convert(uint8_t* c, Point_Typedef Point, DoublePoint_Typedef DoublePoint);
static void delay(__IO uint32_t nCount);
/* Private functions ---------------------------------------------------------*/
/** @defgroup STM8L1528_EVAL_GLASS_LCD_Private_Functions
* @{
*/
/* * @brief Configures the LCD GLASS GPIO port IOs and LCD peripheral.
* @param None
* @retval None
*/
void LCD_GLASS_Init(void)
{
/*
The LCD is configured as follow:
- clock source = LSE (32.768 KHz)
- Voltage source = Internal
- Prescaler = 2
- Divider = 18 (16 + 2)
- Mode = 1/8 Duty, 1/4 Bias
- LCD frequency = (clock source * Duty) / (Prescaler * Divider)
= 114 Hz ==> Frame frequency = 28,5 Hz*/
/* Enable LCD clock */
CLK_PeripheralClockConfig(CLK_Peripheral_LCD, ENABLE);
CLK_RTCClockConfig(CLK_RTCCLKSource_LSE, CLK_RTCCLKDiv_1);
/* Initialize the LCD */
LCD_Init(LCD_Prescaler_2, LCD_Divider_18, LCD_Duty_1_8,
LCD_Bias_1_4, LCD_VoltageSource_Internal);
/* Mask register*/
LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_2, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_3, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_4, 0xFF);
LCD_PortMaskConfig(LCD_PortMaskRegister_5, 0x0F);
LCD_ContrastConfig(LCD_Contrast_Level_7);
LCD_PulseOnDurationConfig(LCD_PulseOnDuration_7);
LCD_Cmd(ENABLE); /*!< Enable LCD peripheral */
}
/**
* @brief This function writes a char on the LCD Glass.
* @param ch: the character to dispaly.
* @param point: a point to add in front of char
* This parameter can be: POINT_OFF or POINT_ON
* @param DoublePoint: flag indicating if a double point has to be added in front
* of the displayed character.
* This parameter can be: DOUBLEPOINT_OFF or DOUBLEPOINT_ON.
* @param position: position in the LCD of the character to write [0:6]
* @retval None
*/
void LCD_GLASS_WriteChar(uint8_t* ch, Point_Typedef Point,
DoublePoint_Typedef DoublePoint, uint8_t Position)
{
Convert(ch, Point, DoublePoint);
/* Enable the write access on the LCD RAM first banck */
LCD->CR4 &= (uint8_t)~LCD_CR4_PAGECOM;
switch (Position)
{
/* Position 0 on LCD (Digit1)*/
case 0:
/* Enable the write access on the LCD RAM First banck */
LCD->CR4 &= (uint8_t)~LCD_CR4_PAGECOM;
/*Write Digit 0 on COM0 */
LCD->RAM[LCD_RAMRegister_1] &= (uint8_t)0xFB;
LCD->RAM[LCD_RAMRegister_1] |= (uint8_t)(digit[0] << (uint8_t)0x01);
/*Write Digit 1 on COM1 */
LCD->RAM[LCD_RAMRegister_4] &= (uint8_t)0x3F;
LCD->RAM[LCD_RAMRegister_4] |= (uint8_t)(digit[1] << (uint8_t)0x05);
/* Enable the write access on the LCD RAM second banck */
LCD->CR4 |= LCD_CR4_PAGECOM;
/*Write Digit 2 on COM4 */
LCD->RAM[LCD_RAMRegister_1] &= (uint8_t)0xF1;
LCD->RAM[LCD_RAMRegister_1] |= (uint8_t)(digit[2] << (uint8_t)0x01);
/*Write Digit 3 on COM5 */
LCD->RAM[LCD_RAMRegister_4] &= (uint8_t)0x1F;
LCD->RAM[LCD_RAMRegister_4] |= (uint8_t)(digit[3] << (uint8_t)0x05);
/*Write Digit 4 on COM6 */
LCD->RAM[LCD_RAMRegister_8] &= (uint8_t)0xF9;
LCD->RAM[LCD_RAMRegister_8] |= (uint8_t)(digit[4] << (uint8_t)0x01);
/*Write Digit 5 on COM7 */
LCD->RAM[LCD_RAMRegister_11] &= (uint8_t)0x1F;
LCD->RAM[
没有合适的资源?快使用搜索试试~ 我知道了~
STM8L051F3单片机DEMO基础例程源码(16例)+官方STM8L15x-16x-05x-AL31标准外设库.zip
共2228个文件
h:728个
c:695个
xcl:158个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 6 下载量 29 浏览量
2022-04-18
06:07:26
上传
评论
收藏 55.04MB ZIP 举报
温馨提示
STM8L051F3单片机DEMO基础例程源码(16例)+官方STM8L15x-16x-05x-AL31标准外设库: 一、开发说明 1、开发环境: IAR For STM8 V3.10.1 2、标准外设库: V1.6.2 3、硬件: STM8L051F3核心板 & ST-LINK/V2下载调试器 STM8L051F3_01_LED STM8L051F3_02_EXTI STM8L051F3_03_CLK STM8L051F3_04_PWR STM8L051F3_05_BEEP STM8L051F3_06_TIM2 STM8L051F3_07_TIM4 STM8L051F3_08_UART STM8L051F3_09_IIC STM8L051F3_10_FLASH STM8L051F3_11_ADC STM8L051F3_12_DMA STM8L051F3_13_SPI STM8L051F3_14_RTC STM8L051F3_15_IWDG STM8L051F3_16_WWDG 官方标准外设库
资源推荐
资源详情
资源评论
收起资源包目录
STM8L051F3单片机DEMO基础例程源码(16例)+官方STM8L15x-16x-05x-AL31标准外设库.zip (2228个子文件)
stm8l15x_ob.asm 514B
Data_Program.Debug.cspy.bat 2KB
WWDG.Debug.cspy.bat 2KB
TIM2.Debug.cspy.bat 2KB
EXTI.Debug.cspy.bat 2KB
BEEP.Debug.cspy.bat 2KB
UART.Debug.cspy.bat 2KB
TIM4.Debug.cspy.bat 2KB
IWDG.Debug.cspy.bat 2KB
WFI.Debug.cspy.bat 2KB
RTC.Debug.cspy.bat 2KB
IIC.Debug.cspy.bat 2KB
DMA.Debug.cspy.bat 2KB
SPI.Debug.cspy.bat 2KB
ADC.Debug.cspy.bat 2KB
CLK.Debug.cspy.bat 2KB
LED.Debug.cspy.bat 2KB
Demo.Debug.cspy.bat 2KB
stm8_devices.bmp 995KB
logo.bmp 7KB
EXTI.pbd.browse 993KB
LED.pbd.browse 978KB
RTC.pbd.browse 925KB
DMA.pbd.browse 891KB
UART.pbd.browse 866KB
TIM2.pbd.browse 865KB
TIM4.pbd.browse 818KB
WFI.pbd.browse 801KB
Demo.pbd.browse 783KB
ADC.pbd.browse 675KB
IIC.pbd.browse 658KB
SPI.pbd.browse 646KB
IWDG.pbd.browse 634KB
Data_Program.pbd.browse 632KB
CLK.pbd.browse 630KB
BEEP.pbd.browse 620KB
WWDG.pbd.browse 616KB
stm8l1528_eval_glass_lcd.c 146KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim1.c 102KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
stm8l15x_tim5.c 76KB
stm8l15x_tim3.c 76KB
stm8l15x_tim2.c 76KB
共 2228 条
- 1
- 2
- 3
- 4
- 5
- 6
- 23
探索者我有我路向
- 粉丝: 333
- 资源: 2100
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
前往页