RXduino  1.20a
RXduinoマニュアル 最終更新日 平成26年6月29日
tkdn_hal.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_TKDN_HAL
18 #define __H_TKDN_HAL
19 
20 /**************************************************************************/
25 // オブジェクトコードを節約したい場合は以下のマクロを有効にしてライブラリを再ビルドすること
26 // ※ 下記の2つをコメントアウトすると約6kB節約できる
27 //#define DISABLE_USBVCOM // USB仮想COMポートを使わない場合
28 //#define DISABLE_ETHER // イーサネットコントローラを使わない場合
29 
30 
31 // これ以降、ユーザがカスタマイズする場所はない
32 
33 #define TKDN_HAL
34 #define TKDN_HAL_VERSION 0x01200000 // Version 1.20
35 #define TKDN_HAL_TIME 1399922836 // 2014/05/13 04:27:16
36 
37 #ifdef __GNUC__
38  #define __INTTERUPT_FUNC __attribute__ ((interrupt))
39 #endif
40 #ifdef __RENESAS__
41  #define __INTTERUPT_FUNC
42 #endif
43 
44 #ifdef __GNUC__
45 #define __WEAK_FUNC __attribute__((weak))
46 #endif
47 #ifdef __RENESAS__
48 #define __WEAK_FUNC
49 #endif
50 
51 #ifndef TRUE
52  #ifdef __cplsuplus
53  #define TRUE true
54  #else
55  #define TRUE 1
56  #endif
57 #endif
58 
59 #ifndef FALSE
60  #ifdef __cplsuplus
61  #define FALSE false
62  #else
63  #define FALSE 0
64  #endif
65 #endif
66 
67 #ifndef NULL
68  #ifdef __cplsuplus
69  #define NULL __null
70  #else
71  #define NULL ((void*)0)
72  #endif
73 #endif
74 
76 // 以下の番号は特殊電子回路㈱によって割り当てられる
77 // 勝手に変更してはならない
78 #define RX62N 0x00000062
79 #define RX63N 0x00000063
80 #define BOARD_ULT62N0_SDRAM 0x56280001
81 #define BOARD_ULT62N0_MMC 0x56280002
82 #define BOARD_ULT62N 0x56280003
83 #define BOARD_RXMEGA 0x56280004
84 #define BOARD_RAXINO 0x56280005
85 #define BOARD_FRKRX62N 0x56270006
86 #define BOARD_YRDKRX62N 0x56280007
87 #define BOARD_GRSAKURA 0x56310531
88 #define BOARD_RAXINOI 0x56310541
89 #define BOARD_NP1055 0x56310551
90 #define BOARD_YRDKRX63N 0x56380008
91 #define BOARD_AKIRX62 0x5621000a
92 #define BOARD_BBRX62 0x5628000b
93 
95 #define _PINDEF(port,bit) ((port) << 8 | (bit))
96 
97 #define _PORT0 0
98 #define _PORT1 1
99 #define _PORT2 2
100 #define _PORT3 3
101 #define _PORT4 4
102 #define _PORT5 5
103 #define _PORT6 6
104 #define _PORT7 7
105 #define _PORT8 8
106 #define _PORT9 9
107 #define _PORTA 10
108 #define _PORTB 11
109 #define _PORTC 12
110 #define _PORTD 13
111 #define _PORTE 14
112 #define _PORTF 15
113 #define _PORTG 16
114 #define _PORTJ 18
115 #define _PORTX 255
116 
117 #define _BIT0 (1 << 0)
118 #define _BIT1 (1 << 1)
119 #define _BIT2 (1 << 2)
120 #define _BIT3 (1 << 3)
121 #define _BIT4 (1 << 4)
122 #define _BIT5 (1 << 5)
123 #define _BIT6 (1 << 6)
124 #define _BIT7 (1 << 7)
125 #define _BITX 0x00
126 
127 #include "boarddef.h" // ボード番号定義を読み込み
128 #include "tkdn_sci.h"
129 #include "tkdn_spi.h"
130 #include "tkdn_i2c.h"
131 #include "tkdn_dac.h"
132 #include "tkdn_adc.h"
133 #include "tkdn_gpio.h"
134 #include "tkdn_rtc.h"
135 #include "tkdn_timer.h"
136 #include "tkdn_ether.h"
137 #include "tkdn_version.h"
138 
139 #ifdef __cplusplus
140  extern "C" {
141 #endif
142 
143 #define REBOOT_USERAPP 0
144 #define REBOOT_FIRMWARE 1
145 
146 /*********************************************************************/
155 void system_reboot(int mode);
156 
157 #ifdef __cplusplus
158  }
159 #endif
160 
161 #endif // __H_TKDN_HAL
162 
RXマイコンの内蔵RSPIモジュールを利用して、SPI機能を実現する
RXマイコンの内蔵時計機能を使うためのルーチン
RX62N/RX63NのGPIOを操作するための低レベルなルーチン
RXマイコンのシリアル通信を扱う
RXマイコンに、I2Cの周辺デバイスを接続してアクセスするためのルーチン
内蔵ADCを使用するためのルーチン
内蔵データフラッシュを使用するためのルーチン
バージョン情報を管理する
void system_reboot(int mode)
ソフトリセットを行い、システムをリブートする
RXマイコンの内蔵タイマーを利用して、経過時間を計測したり、waitを行うためのライブラリ
内蔵DACを使用するためのルーチン