📄 demo.c
字号:
/****************************************Copyright (c)**************************************************
** Guangzhou ZHIYUAN electronics Co.,LTD.
**
** http://www.embedtools.com
**
**--------------File Info-------------------------------------------------------------------------------
** File Name: demo.c
** Last modified 2008.03.12
** Last Version: v1.0
** Description: Bootloader 测试程序
**
**------------------------------------------------------------------------------------------------------
** Created By: Liao maogang
** Created date: 2008.03.12
** Version: v1.0
** Descriptions:
**
**------------------------------------------------------------------------------------------------------
** Modified by:
** Modified date:
** Version:
** Description:
**
********************************************************************************************************/
#include "hw_ints.h"
#include "hw_memmap.h"
#include "hw_types.h"
#include "gpio.h"
#include "sysctl.h"
#define PINS GPIO_PIN_6
void delay(int d)
{
for ( ; d; --d);
}
int main(void)
{
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_6MHZ);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOB);
GPIOPadConfigSet(GPIO_PORTB_BASE, PINS, GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD); /* 设置管脚为上拉驱动 */
GPIODirModeSet(GPIO_PORTB_BASE, PINS, GPIO_DIR_MODE_OUT);
while(1) {
GPIOPinWrite(GPIO_PORTB_BASE, PINS, PINS);
delay(200000);
GPIOPinWrite(GPIO_PORTB_BASE, PINS, ~PINS);
delay(200000);
}
}
/*********************************************************************************************************
END FILE
*********************************************************************************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -