今天移植了一下中景园的OLED代码,发现代码是可用的,所以给大家展示出来,东西倒是简单,航顺的库倒是和STM32的库兼容性很好,直接考代码就行,简单的修改了引脚配置就可以了,这里不多说,把代码发出来吧。大家看看。
复制
//
//本程序只供学习使用,未经作者许可,不得用于其它任何用途
//中景园电子
//店铺地址:http://shop73023976.taobao.com/?spm=2013.1.0.0.M4PqC2
//
// 文 件 名 : main.c
// 版 本 号 : v2.0
// 作 者 : HuangKai
// 生成日期 : 2018-03-29
// 最近修改 :
// 功能描述 : OLED I2C接口演示例程(STM32F0系列)
// 说明:
// ----------------------------------------------------------------
// GND 电源地
// VCC 接3.3v电源
// D0 接PA0(SCL)
// D1 接PA1(SDA)
// RES PA2(SPI模块改成IIC模块需要接此引脚,IIC模块用户请忽略)
// 修改历史 :
// 日 期 :
// 作 者 : HuangKai
// 修改内容 : 创建文件
//版权所有,盗版必究。
//Copyright(C) 中景园电子2018/3/16
//All rights reserved
//******************************************************************************/
/*===============================================================================
==------------------------------说明---------------------------------------------
== 1:本文引用中景园电子代码,仅供参考
== 2:该代码仅供学习使用。
== 3:欢迎大家多提点意见--
=================================================================================
*/
#include "hk32f0xx.h"
#include "delay.h"
#include "oled.h"
#include "bmp.h"
int main(void)
{
u8 t=' ';
delay_init();
OLED_Init();
LED_ON;
while (1)
{
OLED_ShowPicture(0,0,128,64,BMP1,1);
OLED_Refresh();
delay_ms(500);
OLED_Clear();
OLED_ShowChinese(0 ,0,0,16,1);//中
OLED_ShowChinese(18 ,0,1,16,1);//景
OLED_ShowChinese(36 ,0,2,16,1);//园
OLED_ShowChinese(54 ,0,3,16,1);//电
OLED_ShowChinese(72 ,0,4,16,1);//子
OLED_ShowChinese(90 ,0,5,16,1);//技
OLED_ShowChinese(108,0,6,16,1);//术
OLED_ShowString(8,16,"ZHONGJINGYUAN",16,1);
OLED_ShowString(20,32,"2014/05/01",16,1);
OLED_ShowString(0,48,"ASCII:",16,1);
OLED_ShowString(63,48,"CODE:",16,1);
OLED_ShowChar(48,48,t,16,1);//显示ASCII字符
t++;
if(t>'~')t=' ';
OLED_ShowNum(103,48,t,3,16,1);
OLED_Refresh();
delay_ms(500);
OLED_Clear();
OLED_ShowChinese(0,0,0,16,1); //16*16 中
OLED_ShowChinese(16,0,0,24,1); //24*24 中
OLED_ShowChinese(24,20,0,32,1);//32*32 中
OLED_ShowChinese(64,0,0,64,1); //64*64 中
OLED_Refresh();
delay_ms(500);
OLED_Clear();
OLED_ShowString(0,0,"ABC",8,1);//6*8 “ABC”
OLED_ShowString(0,8,"ABC",12,1);//6*12 “ABC”
OLED_ShowString(0,20,"ABC",16,1);//8*16 “ABC”
OLED_ShowString(0,36,"ABC",24,1);//12*24 “ABC”
OLED_Refresh();
delay_ms(500);
OLED_ScrollDisplay(11,4,1);
}
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
航顺芯片MCU型号选型表,料号
HK32F030MF4U6,HK32F030MD4P6,HK32F030MJ4M6,HK32F030MG6U6A,HK32F030MF4U6A,HK32F030MD4P6A,HK32F030MJ4M6A,HK32F0301MF4U6,HK32F0301MD4P6,HK32F0301MJ4M6,HK32F0301MG6U6A,HK32F0301MF4U6A,HK32F0301MD4P6A,HK32F0301MJ4M6A,HK32E032R4T5,HK32F04AR8T6,HK32F04AC8T6,HK32F04AC6T6,HK32F04AC4T6,HK32F04AK8T6,HK32F04AK6T6,HK32F04AK4T6,HK32F04AK8U6,HK32F04AK6U6,HK32F04AK4U6,HK32F04AG8U6,HK32F04AG6U6,HK32F04AG4U6,HK32F04AF8P6,HK32F04AF6P6,HK32F04ARBT6A,HK32F04AR8T6A,HK32F04ACBT6A,HK32F04AC8T6A,HK32F04AC6T6A,HK32F04AC4T6A,HK32F04AKBT6A,HK32F04AK8T6A,HK32F04AK6T6A,HK32F04AK4T6A,HK32F04AKBU6A,HK32F04AK8U6A,HK32F04AK6U6A,HK32F04AK4U6A,HK32F04AGBU6A,HK32F04AG8U6A,HK32F04AG6U6A,HK32F04AG4U6A,
HK32F04AFBP6A,HK32F04AF8P6A,HK32F04AF6P6A,HK32F04AF4P6A,HK32ASPIN010RBT6,HK32ASPIN010CBT6,HK32ASPIN010KBT6,HK32ASPIN010KBU6,HK32ASPIN010GBU6,HK32ASPIN010FBP6,HK32ASPIN010RBT6A,HK32ASPIN010CBT6A,HK32ASPIN010KBT6A,
HK32ASPIN010KBU6A,HK32ASPIN010GBU6A,HK32ASPIN010FBP6A,HK32ASAFE010RBT6,HK32ASAFE010CBT6,HK32ASAFE010KBT6,HK32ASAFE010KBU6,HK32ASAFE010GBU6,HK32ASAFE010FBP6,HK32U3019VET6,HK32U3019VDT6,HK32U3019VCT6,HK32U3019RET6,HK32U3019RDT6,HK32U3019RCT6,HK32H3009VET6,HK32H3009VDT6,HK32H3009VCT6,HK32H3009RET6,HK32H3009RDT6,HK32H3009RCT6,HK32T088RBT6,HK32T088C8T6,HK32HA030RBT6,HK32HA030C8T6,HK32HP103RET6,HK32HP103RCT6,HK32HP103CET6,
航顺芯片MCU型号选型表,替代ST料号,全兼容
HK32F030MF4P6替代STM8S003,HK32F0301MF4P6替代STM8S003,HK32F030MG6T6A 替代STM8S003,
HK32F030MF4P6A 替代STM8S003,HK32F0301MG6T6A替代STM8S003,HK32F0301MF4P6A替代STM8S003,
HK32F030R8T6替代STM32F030R8T6,HK32F030C8T6替代STM32F030C8T6,HK32F030C6T6替代STM32F030C6T6,
HK32F030K6T6替代STM32F030K6T6,HK32F030F4P6替代STM32F030F4P6,HK32F030R8T6A替代STM32F030R8T6,
HK32F030C8T6A替代STM32F030C8T6,HK32F030C6T6A替代STM32F030C6T6,HK32F030K6T6A替代STM32F030K6T6,
HK32F030F4P6A替代STM32F030F4P6,HK32F031C6T6替代STM32F031C6T6,HK32F031C4T6替代STM32F031C4T6,
HK32F031K6T6替代STM32F031K6T6,HK32F031K4T6替代STM32F031K4T6,HK32F031K6U6替代STM32F031K6U6,
HK32F031K4U6替代STM32F031K4U6,HK32F031G6U6替代STM32F031G6U6,HK32F031G4U6替代STM32F031G4U6,
HK32F031F6P6替代STM32F031F6P6,HK32F031F4P6替代STM32F031F4P6,HK32F031C6T6A替代STM32F031C6T6,
HK32F031C4T6A替代STM32F031C4T6,HK32F031K6T6A替代STM32F031K6T6,HK32F031K4T6A替代STM32F031K4T6,
HK32F031K6U6A替代STM32F031K6U6,HK32F031K4U6A替代STM32F031K4U6,HK32F031G6U6A替代STM32F031G6U6,
HK32F031G4U6A替代STM32F031G4U6,HK32F031F6P6A替代STM32F031F6P6,HK32F031F4P6A替代STM32F031F4P6,
HK32F042RBT6替代STM32F042RBT6,HK32F042R8T6替代STM32F042R8T6,HK32F042CBT6替代STM32F042C8T6,
HK32F042C8T6替代STM32F042C8T6,HK32F042CBU6替代STM32F042C8T6,HK32F042C8U6替代STM32F042C8T6,
HK32F051RBT6替代STM32F051RBT6,HK32F051R8T6替代STM32F051R8T6,HK32F051CBT6替代STM32F051C8T6,
HK32F051C8T6替代STM32F051C8T6,HK32F051CBU6替代STM32F051C8T6,HK32F051C8U6替代STM32F051C8T6,
HK32F072RBT6替代STM32F072RBT6,HK32F072R8T6替代STM32F072R8T6,HK32F072CBT6替代STM32F072C8T6,
HK32F072C8T6替代STM32F072C8T6,HK32F072CBU6替代STM32F072C8T6,HK32F072C8U6替代STM32F072C8T6,
HK32F072RBT6A替代STM32F072RBT6,HK32F072R8T6A替代STM32F072R8T6,HK32F072CBT6A替代STM32F072C8T6,
HK32F072C8T6A替代STM32F072C8T6,HK32F072CBU6A替代STM32F072C8T6,HK32F072C8U6A替代STM32F072C8T6,HK32F103RBT6替代STM32F103RBT6,HK32F103R8T6替代STM32F103R8T6,HK32F103CBT6替代STM32F103CBT6,HK32F103C8T6替代STM32F103C8T6,HK32F103VBT6A替代STM32F103VBT6,HK32F103V8T6A替代STM32F103V8T6,
HK32F103RBT6A替代STM32F103RBT6,HK32F103R8T6A替代STM32F103R8T6,HK32F103CBT6A替代STM32F103CBT6,HK32F103C8T6A替代STM32F103C8T6,HK32F103VET6替代STM32F103VET6,HK32F103VDT6替代STM32F103VDT6,
HK32F103VCT6替代STM32F103VCT6HK32F103RET6替代STM32F103RET6,HK32F103RDT6替代STM32F103RDT6,
HK32F103RCT6替代STM32F103RCT6,HK32W030CEU6替代NRF52832,HK32U1009VET6替代HK32F103VET6,
HK32U1009VDT6替代HK32F103VDT6,HK32U1009VCT6替代HK32F103VCT6,HK32U1009RET6替代HK32F103RET6,
HK32U1009RDT6替代HK32F103RDT6,HK32U1009RCT6替代HK32F103RCT6,