LCD部分: #include "periph_lcd.h" lcd_code_item_t LCD_CODE_TAB[]= { [LCD_CHAR_0] ={.COM0_L=1,.COM0_H=0,.COM1_L=1,.COM1_H=1,.COM2_L=0,.COM2_H=1,.COM3_L=1,.COM3_H=1,}, [LCD_CHAR_1] ={.COM0_L=0,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=0,.COM2_H=1,.COM3_L=0,.COM3_H=0,}, [LCD_CHAR_2] ={.COM0_L=1,.COM0_H=0,.COM1_L=1,.COM1_H=0,.COM2_L=1,.COM2_H=1,.COM3_L=0,.COM3_H=1,}, [LCD_CHAR_3] ={.COM0_L=1,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=1,.COM2_H=1,.COM3_L=0,.COM3_H=1,}, [LCD_CHAR_4] ={.COM0_L=0,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=1,.COM2_H=1,.COM3_L=1,.COM3_H=0,}, [LCD_CHAR_5] ={.COM0_L=1,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=1,.COM2_H=0,.COM3_L=1,.COM3_H=1,}, [LCD_CHAR_6] ={.COM0_L=1,.COM0_H=0,.COM1_L=1,.COM1_H=1,.COM2_L=1,.COM2_H=0,.COM3_L=1,.COM3_H=1,}, [LCD_CHAR_7] ={.COM0_L=0,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=0,.COM2_H=1,.COM3_L=0,.COM3_H=1,}, [LCD_CHAR_8] ={.COM0_L=1,.COM0_H=0,.COM1_L=1,.COM1_H=1,.COM2_L=1,.COM2_H=1,.COM3_L=1,.COM3_H=1,}, [LCD_CHAR_9] ={.COM0_L=1,.COM0_H=0,.COM1_L=0,.COM1_H=1,.COM2_L=1,.COM2_H=1,.COM3_L=1,.COM3_H=1,}, [LCD_CHAR_OFF]={.COM0_L=0,.COM0_H=0,.COM1_L=0,.COM1_H=0,.COM2_L=0,.COM2_H=0,.COM3_L=0,.COM3_H=0,}, }; void LCD_Open(void) { CLK_PeripheralClockConfig(CLK_Peripheral_LCD,ENABLE); CLK_RTCClockConfig(CLK_RTCCLKSource_HSI,CLK_RTCCLKDiv_64); LCD_Init(LCD_Prescaler_8 ,LCD_Divider_18,LCD_Duty_1_4,LCD_Bias_1_3,LCD_VoltageSource_External); LCD_PortMaskConfig(LCD_PortMaskRegister_0, 0xff); LCD_PortMaskConfig(LCD_PortMaskRegister_1, 0x03); LCD_ContrastConfig(LCD_Contrast_3V0); LCD_DeadTimeConfig(LCD_DeadTime_0); LCD_PulseOnDurationConfig(LCD_PulseOnDuration_7); LCD_Cmd(ENABLE); } void LCD_DispCharOnIndex(uint8 ch, uint8 index) { if(index>=LCD_INDEX_MAX_COUNT) { return ; } uint8 lcd_code=LCD_CODE_TAB[ch].Byte; if(lcd_code & BIT_MAST_COM0_L) { bit_arry_set_bit((void *)LCD->RAM,28*0+index*2); } else { bit_arry_clr_bit((void *)LCD->RAM,28*0+index*2); } if(lcd_code & BIT_MAST_COM0_H) { bit_arry_set_bit((void *)LCD->RAM,28*0+index*2+1); } else { bit_arry_clr_bit((void *)LCD->RAM,28*0+index*2+1); } if(lcd_code & BIT_MAST_COM1_L) { bit_arry_set_bit((void *)LCD->RAM,28*1+index*2); } else { bit_arry_clr_bit((void *)LCD->RAM,28*1+index*2); } if(lcd_code & BIT_MAST_COM1_H) { bit_arry_set_bit((void *)LCD->RAM,28*1+index*2+1); } else { bit_arry_clr_bit((void *)LCD->RAM,28*1+index*2+1); } if(lcd_code & BIT_MAST_COM2_L) { bit_arry_set_bit((void *)LCD->RAM,28*2+index*2); } else { bit_arry_clr_bit((void *)LCD->RAM,28*2+index*2); } if(lcd_code & BIT_MAST_COM2_H) { bit_arry_set_bit((void *)LCD->RAM,28*2+index*2+1); } else { bit_arry_clr_bit((void *)LCD->RAM,28*2+index*2+1); } if(lcd_code & BIT_MAST_COM3_L) { bit_arry_set_bit((void *)LCD->RAM,28*3+index*2); } else { bit_arry_clr_bit((void *)LCD->RAM,28*3+index*2); } if(lcd_code & BIT_MAST_COM3_H) { bit_arry_set_bit((void *)LCD->RAM,28*3+index*2+1); } else { bit_arry_clr_bit((void *)LCD->RAM,28*3+index*2+1); } } void LCD_DispOffOnIndex(uint8 index) { LCD_DispCharOnIndex(LCD_CHAR_OFF,index); } void LCD_DispOffOnAllIndex(void) { for(uint8 i=0;i |
stm8l15x_io.rar
下载944.82 KB, 下载次数: 143, 下载积分: ST金币 -1
针对STM8的开发环境
STM8S-Discovery
【6】STM8S开发入门
STM8L 开发工具cxstm8 32K版
STM8 连接NRF24L01遇到问题 求助各位大侠
【转帖】网上买的STM8L152板子到手,先上量程序(IO口操作与EEPROM操作)
[活动]ST论坛"技术互助,消灭难题“公益行动开始!赢取STM8L探索套件!
STM8L-DISCOVERY带的SWIM接口可以对stm8s或stm32芯片进行调试或下载吗?谢谢
寻求STM8L-Discovery开发板 可交换
"技术互助,消灭难题“公益活动赢取的STM8L-Discovery 小板收到啦!
回复:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
回复:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
回复:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
回复:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
回复:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)
RE:网上买的STM8L152板子到手,来点程序(IO,EEP,LCD)