📄 pio.c
字号:
/*************************************************************************
*
* Used with ICCARM and AARM.
*
* (c) Copyright IAR Systems 2007
*
* File name : pio.c
* Description : Main file
*
* History :
* 1. Date : August 2, 2007
* Author : Stanimir Bonev
* Description : Create
*
* This example project shows how to use the IAR Embedded Workbench for ARM
* to develop code for the Samsung-S3F4A0K evaluation board. It shows
* basic use of PIO.
* The example flashing LED DS4 (P1.9)
*
* Jumpers:
* J5 P1.9 - filled
* All other jumpers are in default position regarding board's manual
*
* $Revision: 18083 $
**************************************************************************/
#include <samsung\ios3f4a0k.h>
#include "arm_comm.h"
#include "board.h"
/*************************************************************************
* Function Name: main
* Parameters: none
* Return: none
*
* Description: Main
*
*************************************************************************/
void main (void)
{
// Enable PIO block
PIO1_ECR = 1;
// PIO Software Reset
PIO1_CR = 1;
// P1.9 is PIO
PIO1_PER = 1 << 9;
// Enable Push-pull
PIO1_MDDR = 1 << 9;
// Set P1.9 to output
PIO1_OER = 1 << 9;
// Clear output (LED off)
PIO1_CODR = 1 << 9;
while(1)
{
for(volatile Int32U i = 1000000; i; i--);
// LED On
PIO1_SODR = 1 << 9;
for(volatile Int32U i = 1000000; i; i--);
// LED Off
PIO1_CODR = 1 << 9;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -