RT-USB-9AXIS-00
総合概要
モジュール
データ構造
ファイル
ファイル一覧
大域各種
io.c
1
/* ------------------------------------------------------------ *
2
File io.c
3
4
IOポートの設定
5
* ------------------------------------------------------------ */
6
#include "io.h"
7
#include "LPC13xx.h"
8
#include "
core_cm3.h
"
9
#include "type.h"
10
11
/* ------------------------------------------------------------ *
12
Input void
13
Output void
14
15
IOポートの設定.
16
SW1,LED1に繋がっているIOピンを設定
17
* ------------------------------------------------------------ */
18
void
initIO (
void
)
19
{
20
21
//SW1
22
LPC_IOCON->PIO0_1 = 0x0010;
//IOConfig PIO0_1
23
LPC_GPIO0->DIR &= 0xfffd;
//Data Direction(1 output , 0 input) [1bit] SW1
24
25
//LED0
26
LPC_IOCON->R_PIO1_1 = 0x0001;
//IOConfig PIO1_1
27
LPC_GPIO1->DIR |= 0x0002;
//Data Direction(1 output , 0 input) [1bit] LED0
28
29
//LED1
30
LPC_IOCON->R_PIO1_2 = 0x0001;
//IOConfig PIO1_2
31
LPC_GPIO1->DIR |= 0x0004;
//Data Direction(1 output , 0 input) [2bit] LED1
32
33
34
35
};
36
/******************************************************************************
37
** End Of File
38
******************************************************************************/
core_cm3.h
CMSIS Cortex-M3 Core Peripheral Access Layer Header File.
RT-USB-9AXIS-sample
src
PERIPHERAL
io.c
構築:
1.8.10