資源簡介
此文件為stm8l庫文件的例程,使用IAR環(huán)境編譯的,把他解壓到盤文件必須是英文路徑才能用IAR打開。庫文件兼容stm8l051和stm8l151系列。
代碼片段和文件信息
/*******************************************************************************
**?版權(quán): 利爾達(dá)科技有限公司
**?文件名:? mian.c
**?版本:??
**?工作環(huán)境:? IAR?STM8-1.30
**?作者:????????DJL
**?生成日期:? 2012-11-07
**?功能:????????GPIOLED?閃燈測試程序,程序下到stm8L_Discovery全速跑LED3和LED4輪流閃爍
**?相關(guān)文件:
**?修改日志:
**?版權(quán)所有???(C)2011-2012?利爾達(dá)科技有限公司
*******************************************************************************/
/*?包含頭文件?*****************************************************************/
#include?“stm8l15x.h“
#define?ADC1_DR_ADDRESS????????((uint16_t)0x5344)
#define?BUFFER_SIZE????????????((uint8_t)?0x02)
#define?BUFFER_ADDRESS?????????((uint16_t)(&Buffer))
#define?ASCII_NUM_0????????????((uint8_t)???48)
/*?類型聲明?------------------------------------------------------------------*/
/*?宏?------------------------------------------------------------------------*/
#define?LED3_GPIO_PORT????GPIOE
#define?LED3_GPIO_PIN?????GPIO_Pin_7
#define?LED4_GPIO_PORT????GPIOC
#define?LED4_GPIO_PIN?????GPIO_Pin_7
/*?變量?----------------------------------------------------------------------*/
//const?unsigned?char?DeviceNO?@0x8800?=?5;??
//const?char?RELEASEDATE[16]?@?0x00001010?=?__DATE__?;
//unsigned?char?temp_A?@0x100;
//Eeprom
/*?函數(shù)聲明?------------------------------------------------------------------*/
void?Delay_Ms(uint16_t?nCount);
void?LED_Config(void);
void?IWDG_Config(void);
void?Delay_Cycles(unsigned?long?cnt);
int?a?=?100;
int?b?=?120;
int?c;
int?d;
uint16_t?kk;
/*?函數(shù)功能?------------------------------------------------------------------*/
/*******************************************************************************
??*?@函數(shù)名稱 main
??*?@函數(shù)說明???主函數(shù)
??*?@輸入?yún)?shù)???無
??*?@返回參數(shù)???無
*******************************************************************************/
void?main(void)
{
??CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1);
??
??LED_Config();
??
??//IWDG_ReloadCounter();//默認(rèn)38K/4/266=26.94ms
??//IWDG_Config();?
?//?kk?=?0x1234;
//??c?=?a?*?b;//53
//??d?=?c/a;//25
????/*--內(nèi)部時(shí)鐘HSI輸出部分--*/
??GPIO_Init(GPIOC?GPIO_Pin_4?GPIO_Mode_Out_PP_Low_Fast);
??CLK_CCOConfig(CLK_CCOSource_LSI?CLK_CCODiv_1);//PC4??HSI時(shí)鐘輸出16/8=2MHZ
??
??while?(1)
??{
????/*-------------LED3和LED4輪流閃爍----------*/
????//GPIO_ToggleBits(LED3_GPIO_PORT?LED3_GPIO_PIN);
????//Delay_Ms(100);
???//?Delay_Cycles(258);??
????Delay_Ms(200);
????//IWDG_ReloadCounter();//默認(rèn)38K/4/266=26.94ms
????GPIO_ToggleBits(LED4_GPIO_PORT?LED4_GPIO_PIN);
????GPIO_ToggleBits(LED3_GPIO_PORT?LED3_GPIO_PIN);
??}
}
void?Delay_Cycles(unsigned?long?cnt)
{
??while(cnt--);
}
/*******************************************************************************
??*?@函數(shù)名稱 LED_Config
??*?@函數(shù)說明???LED?管腳初始化
??*?@輸入?yún)?shù)???
??*?@輸出參數(shù)???無
??*?@返回參數(shù)???無
*******************************************************************************/
void?LED_Config(void)
{
??GPIO_Init(LED3_GPIO_PORT?LED3_GPIO_PIN?GPIO_Mode_Out_PP_Low_Fast);
??GPIO_Init(LED4_GPIO_PORT?LED4_GPIO_PIN?GPIO_Mode_Ou
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2013-07-06?13:56??1(1)-GPIO_LED\
?????目錄???????????0??2013-05-27?20:34??1(1)-GPIO_LED\Debug\
?????目錄???????????0??2013-07-06?13:56??1(1)-GPIO_LED\Debug\Exe\
?????文件?????????714??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Exe\GPIO.bin
?????文件????????2008??2013-07-06?13:56??1(1)-GPIO_LED\Debug\Exe\GPIO.hex
?????文件???????88828??2013-07-06?13:56??1(1)-GPIO_LED\Debug\Exe\GPIO.out
?????目錄???????????0??2013-07-06?14:02??1(1)-GPIO_LED\Debug\List\
?????目錄???????????0??2013-07-06?13:58??1(1)-GPIO_LED\Debug\Obj\
?????文件????????3089??2013-07-06?13:56??1(1)-GPIO_LED\Debug\Obj\GPIO.pbd
?????文件???????14476??2013-07-06?13:56??1(1)-GPIO_LED\Debug\Obj\main.o
?????文件???????42844??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_adc.o
?????文件???????24599??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_aes.o
?????文件???????11492??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_beep.o
?????文件???????51539??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_clk.o
?????文件???????28934??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_comp.o
?????文件???????38918??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_dac.o
?????文件???????29571??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_dma.o
?????文件???????23243??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_exti.o
?????文件???????42347??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_flash.o
?????文件???????23912??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_gpio.o
?????文件???????66970??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_i2c.o
?????文件???????10328??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_irtim.o
?????文件???????46564??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_it.o
?????文件???????14989??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_itc.o
?????文件???????10465??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_iwdg.o
?????文件???????33264??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_lcd.o
?????文件???????19409??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_pwr.o
?????文件????????7456??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_rst.o
?????文件???????91664??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_rtc.o
?????文件???????35873??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_spi.o
?????文件???????22836??2013-06-07?10:22??1(1)-GPIO_LED\Debug\Obj\stm8l15x_syscfg.o
............此處省略3194個(gè)文件信息
- 上一篇:現(xiàn)代控制理論_俞立_PPT
- 下一篇:paopao.rar
評(píng)論
共有 條評(píng)論