PIN

概要

PINは、デジタルピンの入出力を行うためのレジスタです。PINBとPINC、PINDの3種類あります。

ソースコード

PINBとPINC、PINDは、hardware/tools/avr/avr/include/avr/iom328p.h に定義されています。以下に全ソースコードを示します。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#define PINB _SFR_IO8(0x03)
#define PINB0 0
#define PINB1 1
#define PINB2 2
#define PINB3 3
#define PINB4 4
#define PINB5 5
#define PINB6 6
#define PINB7 7

#define PINC _SFR_IO8(0x06)
#define PINC0 0
#define PINC1 1
#define PINC2 2
#define PINC3 3
#define PINC4 4
#define PINC5 5
#define PINC6 6

#define PIND _SFR_IO8(0x09)
#define PIND0 0
#define PIND1 1
#define PIND2 2
#define PIND3 3
#define PIND4 4
#define PIND5 5
#define PIND6 6
#define PIND7 7

0x03、0x06、0x09は、それぞれ、PINB、PINC、PINDが存在するI/Oアドレスです。_SFR_IO8()を呼び出すマクロです。

バージョン

7.3.0-atmel3.6.1-arduino7

最終更新日

May 15, 2021

inserted by FC2 system