137 lines
3.8 KiB
C
137 lines
3.8 KiB
C
![]() |
//////////////////////////////////////////////////////////////////////////////////
|
|||
|
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֻ<EFBFBD><D6BB>ѧϰʹ<CFB0>ã<EFBFBD>δ<EFBFBD><CEB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɣ<EFBFBD><C9A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD><CEBA><EFBFBD>;
|
|||
|
//<2F>о<EFBFBD><EFBFBD><D4B0><EFBFBD><EFBFBD>
|
|||
|
//<2F><><EFBFBD>̵<EFBFBD>ַ<EFBFBD><D6B7>http://shop73023976.taobao.com/?spm=2013.1.0.0.M4PqC2
|
|||
|
//
|
|||
|
// <20><> <20><> <20><> : main.c
|
|||
|
// <20><> <20><> <20><> : v2.0
|
|||
|
// <20><> <20><> : HuangKai
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : 2011-11-07
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> :
|
|||
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> : OLED 4<>ӿ<EFBFBD><D3BF><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>(STM8L051F3)
|
|||
|
// ˵<><CBB5>:
|
|||
|
// ----------------------------------------------------------------
|
|||
|
// GND <20><>Դ<EFBFBD><D4B4>
|
|||
|
// VCC <20><>3.3v<EFBFBD><EFBFBD>Դ
|
|||
|
// D0 PC1
|
|||
|
// D1 PC0
|
|||
|
// RES PB6
|
|||
|
// DC PB5
|
|||
|
// CS PB4
|
|||
|
// ----------------------------------------------------------------
|
|||
|
// <20><EFBFBD><DEB8><EFBFBD>ʷ :
|
|||
|
// <20><> <20><> :
|
|||
|
// <20><> <20><> : HuangKai
|
|||
|
// <20><EFBFBD><DEB8><EFBFBD><EFBFBD><EFBFBD> : <20><><EFBFBD><EFBFBD><EFBFBD>ļ<EFBFBD>
|
|||
|
//<2F><>Ȩ<EFBFBD><C8A8><EFBFBD>У<EFBFBD><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
|||
|
//Copyright(C) <20>о<EFBFBD><EFBFBD><D4B0><EFBFBD><EFBFBD>2014/3/16
|
|||
|
//All rights reserved
|
|||
|
//******************************************************************************/
|
|||
|
#include "stm8l15x.h"//STM8L051/151<35><31>ϵ<EFBFBD>й<EFBFBD><D0B9>ÿ⺯<C3BF><E2BAAF>
|
|||
|
#include "oled.h"
|
|||
|
#include "bmp.h"
|
|||
|
/* Private defines -----------------------------------------------------------*/
|
|||
|
/* Private function prototypes -----------------------------------------------*/
|
|||
|
/* Private functions ---------------------------------------------------------*/
|
|||
|
|
|||
|
|
|||
|
void Delay(uint16_t nCount)
|
|||
|
{
|
|||
|
/* Decrement nCount value */
|
|||
|
while (nCount != 0)
|
|||
|
{
|
|||
|
nCount--;
|
|||
|
}
|
|||
|
}
|
|||
|
void main(void)
|
|||
|
{ u8 t;
|
|||
|
LED_Clr();
|
|||
|
//delay_init(); //?<3F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>o<EFBFBD><6F><EFBFBD><EFBFBD>y3?<3F><>??<3F><>
|
|||
|
// NVIC_Configuration(); //<2F><><EFBFBD><EFBFBD>??NVIC?D??<3F><>?<3F><><EFBFBD><EFBFBD>2:2???<3F><>??<3F><>??<3F><>??<3F><>?2???<3F><><EFBFBD><EFBFBD>|<7C><>??<3F><>?? LED_Init(); //LED???<3F><>3?<3F><>??<3F><>
|
|||
|
OLED_Init(); //3?<3F><>??<3F><>OLED
|
|||
|
OLED_Clear() ;
|
|||
|
|
|||
|
OLED_ShowString(30,0,"OLED TEST");
|
|||
|
OLED_ShowString(8,2,"ZHONGJINGYUAN");
|
|||
|
OLED_ShowString(20,4,"2014/05/01");
|
|||
|
OLED_ShowString(0,6,"ASCII:");
|
|||
|
OLED_ShowString(63,6,"CODE:");
|
|||
|
t=' ';
|
|||
|
OLED_ShowCHinese(0,0,0);//?D
|
|||
|
OLED_ShowCHinese(18,0,1);//?<3F><>
|
|||
|
OLED_ShowCHinese(36,0,2);//?<3F><>
|
|||
|
OLED_ShowCHinese(54,0,3);//<2F><>?
|
|||
|
OLED_ShowCHinese(72,0,4);//<2F><><EFBFBD><EFBFBD>
|
|||
|
OLED_ShowCHinese(90,0,5);//??
|
|||
|
OLED_ShowCHinese(108,0,6);//??
|
|||
|
|
|||
|
delay_ms(50);
|
|||
|
|
|||
|
OLED_Clear();
|
|||
|
delay_ms(50);
|
|||
|
|
|||
|
|
|||
|
t=' ';
|
|||
|
while(1)
|
|||
|
{ LED_Clr();
|
|||
|
//OLED_Clr() ;
|
|||
|
OLED_Clear();
|
|||
|
|
|||
|
OLED_ShowCHinese(0,0,0);//?D
|
|||
|
OLED_ShowCHinese(18,0,1);//?<3F><>
|
|||
|
OLED_ShowCHinese(36,0,2);//?<3F><>
|
|||
|
OLED_ShowCHinese(54,0,3);//<2F><>?
|
|||
|
OLED_ShowCHinese(72,0,4);//<2F><><EFBFBD><EFBFBD>
|
|||
|
OLED_ShowCHinese(90,0,5);//??
|
|||
|
OLED_ShowCHinese(108,0,6);//??
|
|||
|
|
|||
|
OLED_ShowString(0,2,"0.96' OLED TEST");
|
|||
|
// OLED_ShowString(8,2,"ZHONGJINGYUAN");
|
|||
|
OLED_ShowString(20,4,"2014/05/01");
|
|||
|
OLED_ShowString(0,6,"ASCII:");
|
|||
|
OLED_ShowString(63,6,"CODE:");
|
|||
|
OLED_ShowChar(48,6,t);//??<3F><>?ASCII<49><49>?<3F><>?
|
|||
|
t++;
|
|||
|
if(t>'~')t=' ';
|
|||
|
OLED_ShowNum(103,6,t,3,16);//??<3F><>?ASCII<49><49>?<3F><>?<3F><>????<3F><>
|
|||
|
|
|||
|
|
|||
|
delay_ms(80);
|
|||
|
LED_Set();
|
|||
|
delay_ms(80);
|
|||
|
|
|||
|
|
|||
|
|
|||
|
OLED_Clear();
|
|||
|
delay_ms(50);
|
|||
|
//OLED_DrawBMP(0,0,128,8,BMP1); //<2F><>?????<3F><>?(<28><>?????<3F><>?<3F><><EFBFBD>¨<EFBFBD>?<3F><>?<3F><><EFBFBD><EFBFBD>3<EFBFBD><33><EFBFBD><EFBFBD>?<3F><>?<3F><><EFBFBD><EFBFBD>??<3F>䨮<EFBFBD><E4A8AE>??<3F><>??<3F><>????<3F><>????<3F><>?FLASH????8K<38><4B>???<3F><><EFBFBD>¨<EFBFBD>?)
|
|||
|
//delay_ms(500);
|
|||
|
//OLED_DrawBMP(0,0,128,8,BMP2);
|
|||
|
//delay_ms(500);
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
#ifdef USE_FULL_ASSERT
|
|||
|
|
|||
|
/**
|
|||
|
* @brief Reports the name of the source file and the source line number
|
|||
|
* where the assert_param error has occurred.
|
|||
|
* @param file: pointer to the source file name
|
|||
|
* @param line: assert_param error line source number
|
|||
|
* @retval : None
|
|||
|
*/
|
|||
|
void assert_failed(u8* file, u32 line)
|
|||
|
{
|
|||
|
/* User can add his own implementation to report the file name and line number,
|
|||
|
ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */
|
|||
|
|
|||
|
/* Infinite loop */
|
|||
|
while (1)
|
|||
|
{
|
|||
|
}
|
|||
|
}
|
|||
|
#endif
|
|||
|
|
|||
|
/******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
|