RXduino  1.20a
RXduinoマニュアル 最終更新日 平成26年6月29日
rxduino.h
説明を見る。
1 /*******************************************************************************
2 * RXduinoライブラリ & 特電HAL
3 *
4 * このソフトウェアは特殊電子回路株式会社によって開発されたものです。
5 * 当社Webサイトを通じてダウンロードすることによって使用許諾されます。
6 * このファイルを第三者へ開示・再配布・貸与・譲渡することはできません。
7 * このソフトウェアはあるがままの状態で提供され、内容および動作についての保障はあ
8 * りません。弊社はファイルの内容および実行結果についていかなる責任も負いません。
9 * お客様は、お客様の製品開発のために当ソフトウェアのソースコードを自由に参照し、
10 * 引用していただくことができます。
11 * コンパイル・リンク後のオブジェクトファイル(ELF ファイルまたはMOT,SRECファイル)
12 * であって、デバッグ情報が削除されている場合は第三者に再配布することができます。
13 * (C) Copyright 2011-2014 TokushuDenshiKairo Inc. 特殊電子回路株式会社
14 * http://rx.tokudenkairo.co.jp/
15 *******************************************************************************/
16 
17 #ifndef __H_RXDUINO
18 #define __H_RXDUINO
19 
20 /**************************************************************************/
24 #define RXDUINO_API
25 
26 #include <stdio.h>
27 #include <stdlib.h>
28 #include <string.h>
29 #include <math.h>
30 
31 #ifdef __GNUC__
32  #include "../tkdnhal/tkdn_hal.h"
33 #else
34  #include "..\tkdnhal\tkdn_hal.h"
35 #endif
36 
37 #ifdef __cplusplus
38  extern "C" {
39 #endif
40 
41 // 型の定義
42 typedef bool boolean;
43 typedef unsigned char byte;
44 typedef unsigned short word;
45 typedef unsigned char uint8_t;
46 typedef unsigned short uint16_t;
47 typedef long unsigned int uint32_t;
48 typedef unsigned long long uint64_t;
49 typedef signed char int8_t;
50 typedef short int16_t;
51 typedef long int int32_t;
52 typedef long long int64_t;
53 
54 // 定数の定義
55 #define F_CPU 96000000UL
56 
57 // A某互換の定数
58 #define LOW 0
59 #define HIGH 1
60 #define INPUT 0
61 #define OUTPUT 1
62 #define INPUT_PULLUP 2
63 #define OUTPUT_HIGH 3
64 
65 #define LSBFIRST 0
66 #define MSBFIRST 1
67 
68 #define CHANGE 1
69 #define FALLING 2
70 #define RISING 3
71 
72 #define DEFAULT 0
73 #define EXTERNAL 1
74 #define INTERNAL 2
75 #define RAW12BIT 3
76 
77 #define IO_DDR0 (*(volatile unsigned char *)0x0008C000)
78 #define IO_DDR1 (*(volatile unsigned char *)0x0008C001)
79 #define IO_DDR2 (*(volatile unsigned char *)0x0008C002)
80 #define IO_DDR3 (*(volatile unsigned char *)0x0008C003)
81 #define IO_DDR4 (*(volatile unsigned char *)0x0008C004)
82 #define IO_DDR5 (*(volatile unsigned char *)0x0008C005)
83 #define IO_DDR6 (*(volatile unsigned char *)0x0008C006)
84 #define IO_DDR7 (*(volatile unsigned char *)0x0008C007)
85 #define IO_DDR8 (*(volatile unsigned char *)0x0008C008)
86 #define IO_DDR9 (*(volatile unsigned char *)0x0008C009)
87 #define IO_DDRA (*(volatile unsigned char *)0x0008C00a)
88 #define IO_DDRB (*(volatile unsigned char *)0x0008C00b)
89 #define IO_DDRC (*(volatile unsigned char *)0x0008C00c)
90 #define IO_DDRD (*(volatile unsigned char *)0x0008C00d)
91 #define IO_DDRE (*(volatile unsigned char *)0x0008C00e)
92 #define IO_DDRF (*(volatile unsigned char *)0x0008C00f)
93 
94 #define IO_PORT0 (*(volatile unsigned char *)0x0008C020)
95 #define IO_PORT1 (*(volatile unsigned char *)0x0008C021)
96 #define IO_PORT2 (*(volatile unsigned char *)0x0008C022)
97 #define IO_PORT3 (*(volatile unsigned char *)0x0008C023)
98 #define IO_PORT4 (*(volatile unsigned char *)0x0008C024)
99 #define IO_PORT5 (*(volatile unsigned char *)0x0008C025)
100 #define IO_PORT6 (*(volatile unsigned char *)0x0008C026)
101 #define IO_PORT7 (*(volatile unsigned char *)0x0008C027)
102 #define IO_PORT8 (*(volatile unsigned char *)0x0008C028)
103 #define IO_PORT9 (*(volatile unsigned char *)0x0008C029)
104 #define IO_PORTA (*(volatile unsigned char *)0x0008C02A)
105 #define IO_PORTB (*(volatile unsigned char *)0x0008C02B)
106 #define IO_PORTC (*(volatile unsigned char *)0x0008C02C)
107 #define IO_PORTD (*(volatile unsigned char *)0x0008C02D)
108 #define IO_PORTE (*(volatile unsigned char *)0x0008C02E)
109 #define IO_PORTF (*(volatile unsigned char *)0x0008C02F)
110 
111 #define IO_PIN0 (*(volatile unsigned char *)0x0008C040)
112 #define IO_PIN1 (*(volatile unsigned char *)0x0008C041)
113 #define IO_PIN2 (*(volatile unsigned char *)0x0008C042)
114 #define IO_PIN3 (*(volatile unsigned char *)0x0008C043)
115 #define IO_PIN4 (*(volatile unsigned char *)0x0008C044)
116 #define IO_PIN5 (*(volatile unsigned char *)0x0008C045)
117 #define IO_PIN6 (*(volatile unsigned char *)0x0008C046)
118 #define IO_PIN7 (*(volatile unsigned char *)0x0008C047)
119 #define IO_PIN8 (*(volatile unsigned char *)0x0008C048)
120 #define IO_PIN9 (*(volatile unsigned char *)0x0008C049)
121 #define IO_PINA (*(volatile unsigned char *)0x0008C04A)
122 #define IO_PINB (*(volatile unsigned char *)0x0008C04B)
123 #define IO_PINC (*(volatile unsigned char *)0x0008C04C)
124 #define IO_PIND (*(volatile unsigned char *)0x0008C04D)
125 #define IO_PINE (*(volatile unsigned char *)0x0008C04E)
126 #define IO_PINF (*(volatile unsigned char *)0x0008C04F)
127 
128 static const int BIN = 2;
129 static const int OCT = 8;
130 static const int DEC = 10;
131 static const int HEX = 16;
132 static const int BYTE = 256;
133 
134 // 次の2つの関数はユーザが作るもの
140 extern void setup(void);
141 
150 extern void loop(void);
151 
152 /*********************************************************************/
161 void Reboot(bool run_userapp);
162 
163 // イーサネット用の受信処理関数を登録するための型
164 typedef void (*FUNCTYPE_ETHER_HANDLER)(void);
165 
166 // イーサネット用の受信処理関数を登録する
167 void registEthernetHandler(FUNCTYPE_ETHER_HANDLER func);
168 
169 #define RXDUINO_VERSION 0x01200000 // Version 1.20
170 
171 const char RXDUINO_COPYRIGHT[] = "(C)Copyright 2012-2014 Tokushu Denshi Kairo Inc.";
172 
173 #ifdef __cplusplus
174  }
175 #endif
176 
177 #include "serial.h"
178 #include "digitalio.h"
179 #include "delay.h"
180 #include "analogio.h"
181 #include "tone.h"
182 #include "shiftout.h"
183 #include "wiring.h"
184 #include "progmem.h"
185 #include "interrupt.h"
186 #include "random.h"
187 #include "binary.h"
188 #include "rxstring.h"
189 
190 #endif // __H_RXDUINO
191 
long int int32_t
32bitの符号付き数値(-2147483648~2147483647)を表わす
Definition: rxduino.h:51
算術演算、数学演算、論理演算など細かなルーチン
内蔵ADC、内蔵DAC、PWMに関するライブラリ
bool boolean
真(true)か偽(false)を表す型
Definition: rxduino.h:42
unsigned long long uint64_t
64bitの符号無し数値(0~18446744073709551615)を表わす
Definition: rxduino.h:48
short int16_t
16bitの符号付き数値(-32768~32767)を表わす
Definition: rxduino.h:50
文字列を使いやすくするためのライブラリ
void setup(void)
ユーザが作る関数。システム起動時に1回だけ呼び出される。
unsigned short word
16bitの符号無し数値(0~65535)を表わす
Definition: rxduino.h:44
unsigned short uint16_t
16bitの符号無し数値(0~65535)を表わす
Definition: rxduino.h:46
long unsigned int uint32_t
32bitの符号無し数値(0~4294967295)を表わす
Definition: rxduino.h:47
unsigned char uint8_t
8bitの符号無し数値(0~255)を表わす
Definition: rxduino.h:45
単純なシリアル・パラレル変換
UARTやUSB仮想COMポートを使うためのライブラリ
void Reboot(bool run_userapp)
ソフトリセットを行い、システムをリブートする
unsigned char byte
8bitの符号無し数値(0~255)を表わす
Definition: rxduino.h:43
コード領域にデータを格納するためのマクロ定義
矩形波を発生させ、圧電ブザーから音を鳴らす
タイマーと遅延に関するライブラリ
割り込みに関するライブラリ
GPIOの操作に関するライブラリ
signed char int8_t
8bitの符号付き数値(-128~127)を表わす
Definition: rxduino.h:49
乱数生成ライブラリ
void loop(void)
ユーザが作る関数。システム起動後に繰り返し呼び出される。
long long int64_t
64bitの符号付き数値(-9223372036854775808~9223372036854775807)を表わす
Definition: rxduino.h:52