91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 8KB
    文件類型: .zip
    金幣: 2
    下載: 0 次
    發(fā)布日期: 2021-06-18
  • 語言: 其他
  • 標簽: CC2530??

資源簡介

基于CC2530的OLED開發(fā),包含了相應的源文件,移植只需要修改少許地方即可。。。。。。。。。。。。。。。

資源截圖

代碼片段和文件信息

#include?“XMF_OLED1306.h“
#include?“XMF_OLED_Font.h“
#include?“XMF_OLED_BMP.h“

/*==========================延時函數(shù)==========================*/
void?Delay_oled(unsigned?char?time)
{
??while(time--);
}

/*==========================寫單字節(jié)==========================*/
void?OLED_Write_Byte(unsigned?char?dat?unsigned?char?cmd)
{
??unsigned?char?i; ??
??if(cmd)
????OLED_DC?=?1;
??else?
????OLED_DC?=?0;
??
??for(i?=?0;?i???{ ??
????OLED_SCK?=?0;
????if(dat?&?0x80)
??????OLED_DD?=?1;
????else
??????OLED_DD?=?0;
????
????OLED_SCK?=?1;
????dat<<=1;???
??} ? ??
??OLED_DC?=?1;
}

/*==========================設置坐標==========================*/
void?OLED_Set_Pos(unsigned?char?x?unsigned?char?y)?
{?
??OLED_Write_Byte(0xb0+y?OLED_CMD);
??OLED_Write_Byte(((x&0xf0)>>4)|0x10?OLED_CMD);
??OLED_Write_Byte((x&0x0f)|0x01?OLED_CMD);?
}?

/*==========================顯示字符===========================
*?在指定位置顯示一個字符包括部分字符
*?x:??0~127
*?y:??0~63
*?mode:??0--反白顯示;??1--正常顯示 ?
*?size:??選擇字體?16/12?
=============================================================*/
void?OLED_Show_Char(unsigned?char?x?unsigned?char?y?unsigned?char?chr)
{??????
??unsigned?char?c=0i=0;
??c?=?chr-‘?‘;????????????//得到偏移后的值
??if(x?>?Max_Column-1)
??{
????x?=?0;
????y=?y?+?2;
??}
??if(SIZE?==16)
??{
????OLED_Set_Pos(x?y);
????for(i?=?0;?i???????OLED_Write_Byte(F8X16[c*16+i]?OLED_DATA);
????OLED_Set_Pos(x?y+1);
????for(i?=?0;?i???????OLED_Write_Byte(F8X16[c*16+i+8]OLED_DATA);
??}
??else?{
????OLED_Set_Pos(x?y+1);
????for(i?=?0;?i???????OLED_Write_Byte(F6x8[c][i]?OLED_DATA);
??}
}

/*========================顯示字符串==========================*/
void?OLED_Show_Str(unsigned?char?x?unsigned?char?y?unsigned?char?*chr)
{
??unsigned?char?j?=?0;
??while?(chr[j]!=‘\0‘)
??{
????OLED_Show_Char(x?y?chr[j]);
????x?+=?8;
????if(x?>?120)
????{
??????x=0;
??????y+=2;
????}
????j++;
??}
}

/*==========================計算m^n===========================*/
unsigned?int?OLED_pow(unsigned?char?m?unsigned?char?n)
{
??unsigned?int?result?=?1; ?
??while(n--)
????result?*=?m;????
??return?result;
} ??
//顯示2個數(shù)字
//xy?:起點坐標 ?
//len?:數(shù)字的位數(shù)
//size:字體大小
//mode:模式 0填充模式;1疊加模式
//num:數(shù)值(0~4294967295);
/*========================顯示多位整數(shù)========================
*?顯示多位數(shù)字
*?起始點坐標(xy)
*?num:??顯示的整數(shù)
*?len?:數(shù)字的位數(shù)
*?size2:?字體大小,建議用16 ?
=============================================================*/
void?OLED_Show_Int(unsigned?char?x?unsigned?char?y?unsigned?int?num?unsigned?char?len?unsigned?char?size2)
{?????????
??unsigned?char?itemp;
??unsigned?char?enshow=0; ???
??for(i?=?0;?i???{
????temp=(num/OLED_pow(10len-i-1))%10;
????if(enshow==0&&i<(len-1))
????{
??????if(temp==0)
??????{
????????OLED_Show_Char(x+(size2/2)*iy‘?‘);
????????continue;
??????}
??????else?
????????enshow=1;?
? ?
????}
????OLED_Show_Char(x+(size2/2)*i

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????1793??2018-02-01?12:50??XMF_OLED1306.h
?????文件???????10718??2018-01-31?15:29??XMF_OLED_BMP.h
?????文件???????15207??2018-01-31?13:40??XMF_OLED_Font.h
?????文件????????7768??2018-01-31?15:57??XMF_OLED1306.c

評論

共有 條評論