欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136
標題:
STM32F103C8T6最小系統配置測試程序
[打印本頁]
作者:
山海新龍門
時間:
2019-9-29 09:59
標題:
STM32F103C8T6最小系統配置測試程序
關于STM32F103C8T6最小系統配置測試
單片機源程序如下:
/#include "stm32f10x.h"
unsigned char *P_RXD;//接收數據指針
unsigned int Num_RXD=0;//要打印字節區位碼的字節數
unsigned char TxBuffer[64]={0,2,3,};//串口發送緩沖區
unsigned char RxBuffer[64]; //串口接收緩沖區
unsigned char Key0=0;
unsigned char Key0_Value=0;
unsigned char Key0_State=0;
unsigned char LED0_State=0;
unsigned char t;
unsigned char JG;//數據比較結果
void Key_Delay (void)
{
unsigned int i;
for(i=0;i<0xfff;i++);
}
void Time_Delay (void)
{
unsigned int i;
unsigned int j;
for(i=0;i<0xfff;i++)
{
for(j=0;j<0xFFFF;j++);
};
}
/** @addtogroup Template_Project
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
//void Delay(int nCount);
/**
* @brief Main program.
* @param None
* @retval : None
*/
int main(void)
{
/* Setup STM32 system (clock, PLL and Flash configuration) */
SystemInit();
RCC_Configuration();
NVIC_Configuration();
GPIO_Configuration();
SysTick_init(); //延時初始化
SPI2_Init(); //初始化SPI硬件口
P_RXD=RxBuffer;//接收指針指向接收緩沖區
USART_Configuration(); //USART1配置
TIM2_Config(); //定時器初始化
OLED_Init(); //初始化OLED
OLED_ShowString(1,0, "0.96' OLED TEST");
OLED_ShowString(1,16,"mcudev.taobao ");
OLED_ShowString(1,32,"2014-06-16");
OLED_ShowString(1,48,"ASCII: ");
OLED_ShowString(63,48,"CODE: ");
{
unsigned char i;
for(i=0;i<32;i++)TxBuffer[i]=i;
}
I2CWriteByte(0,TxBuffer,32); //寫入長度
I2CReadByte(0,RxBuffer,32);
JG=Compare_Mem (TxBuffer,RxBuffer,32);
if(JG==0)//對Eeprom進行讀寫判斷;
{
OLED_ShowString(1,32,"Eeprom--OK ");
}
else
{
OLED_ShowString(1,32,"Eeprom--Error ");
}
/* Infinite loop */
while (1)
{
OLED_ShowChar(48,48,t,16,1);// OLED_Refresh_Gram();
t++;
if(t>'~')t=' ';
OLED_ShowNum(103,48,t,3,16);//
if(Key0_State==0xff)
{
LED0_State=!LED0_State;
delay_ms(300);
Key0_State=0;
}
if(LED0_State==0)
{
LED0_ON();//LED亮
delay_ms(200);
LED0_OFF();//LED滅
delay_ms(200);
}
}
}
#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(uint8_t* file, uint32_t 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 2009 STMicroelectronics *****END OF FILE****/
復制代碼
所有資料51hei提供下載:
STM32_OLED(C8T6).7z
(177.42 KB, 下載次數: 26)
2019-9-29 16:13 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
作者:
yejingyuqin
時間:
2019-11-9 23:09
正需要這個,謝謝
作者:
yejingyuqin
時間:
2019-11-9 23:10
謝謝分享
作者:
yejingyuqin
時間:
2019-11-18 17:37
學習一下
歡迎光臨 (http://m.raoushi.com/bbs/)
Powered by Discuz! X3.1