aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/core/analogio.h2
-rwxr-xr-xsrc/core/arithmetical.h49
-rwxr-xr-xsrc/core/libmary.h12
3 files changed, 56 insertions, 7 deletions
diff --git a/src/core/analogio.h b/src/core/analogio.h
index 62d357f..9055ea2 100755
--- a/src/core/analogio.h
+++ b/src/core/analogio.h
@@ -1,7 +1,7 @@
#ifndef ANALOGIO_H_
#define ANALOGIO_H_
/**************************************************************************//**
- * @file libmary.h
+ * @file analogio.h
* @brief Arduino-like library for eXodusino(LPC1114)
* @version v.0.50
* @date 3. May 2012.
diff --git a/src/core/arithmetical.h b/src/core/arithmetical.h
new file mode 100755
index 0000000..bae4440
--- /dev/null
+++ b/src/core/arithmetical.h
@@ -0,0 +1,49 @@
+#ifndef ARITHMETICAL_H_
+#define ARITHMETICAL_H_
+/**************************************************************************//**
+ * @file arithmetical.h
+ * @brief Arduino-like library for eXodusino(LPC1114)
+ * @version v.0.50
+ * @date 3. May 2012.
+ * @author @@lynxeyed_atsu
+ * @note Copyright (c) 2011 Lynx-EyED's Klavier and Craft-works. <BR>
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions: <BR>
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.<BR>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ ******************************************************************************/
+#ifdef abs
+#undef abs
+#endif
+
+#define abs(x) ((x)>0?(x):-(x))
+#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
+#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
+#define radians(deg) ((deg)*DEG_TO_RAD)
+#define degrees(rad) ((rad)*RAD_TO_DEG)
+#define sq(x) ((x)*(x))
+
+#define lowByte(w) ((uint8_t) ((w) & 0xff))
+#define highByte(w) ((uint8_t) ((w) >> 8))
+
+#define bitRead(value, bit) (((value) >> (bit)) & 0x01)
+#define bitSet(value, bit) ((value) |= (1UL << (bit)))
+#define bitClear(value, bit) ((value) &= ~(1UL << (bit)))
+#define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
+#define bit(b) (1UL << (b))
+#define map(x,in_min,in_max,out_min,out_max) \
+(((x) - (in_min)) * ((out_max) - (out_min)) / ((in_max) - (in_min)) + (out_min))
+
+
+#endif /* ARITHMETICAL_H_ */
diff --git a/src/core/libmary.h b/src/core/libmary.h
index b49a339..eab0289 100755
--- a/src/core/libmary.h
+++ b/src/core/libmary.h
@@ -2,15 +2,13 @@
#define LIBMARY_H_
/**
- @mainpage MARY-DUINO (Beta)
+ @mainpage eXodusino
@section abstruct 概要
- MARY-DUINOはNXP製LPC1114を搭載したMARY基板でArduinoライクな開発が出来ることを目指すC++ライブラリです
+ eXodusinoはCortex-M0でArduinoライクな開発が出来ることを目指すC++ライブラリです
@section intro 始めに
- CQ出版発行・圓山宗智氏によるトランジスタ技術増刊「2枚入り!組み合わせ自在!超小型ARMマイコン基板」に付属している基板をArduinoライクな環境で開発する為の
- ライブラリです。
+ eXodusinoはARM Cortex-M0環境でもArduinoライクな環境を構築する為のライブラリです。
@section motivation 背景
- 「2枚入り!組み合わせ自在!超小型ARMマイコン基板」に付属している基板の開発において、よく整備されているライブラリが圓山氏により準備されており、
- とても使いやすい環境が提供されています。このライブラリではよりお手軽に開発する事を目的としてC++ライブラリをフルスクラッチで作成しており、Arduinoライクな
+ このライブラリではお手軽に開発する事を目的としてC++ライブラリを作成しており、Arduinoライクな
開発環境を提供しています。今後ここに新たなライブラリを追加し、より使いやすい環境を随時追加してゆきます
@section environmen 環境
arm-none-eabi-gcc-4.5.0以上またはarm-elf-gcc-4.5.0以上
@@ -18,6 +16,7 @@
- Mac OSXではSnow Leopard(10.6.1以上)ではXcode 3.4以上がインストール、Lion(10.7)ではXCode 4.1以上がインストールされており、arm-elf-gcc-4.5.0以上がインストールされている事
@section history 履歴
- 2011/07/15 初版作成
+ - 2012/05/27 Arduino,Wiring算術マクロを移植
*/
/**************************************************************************//**
@@ -51,6 +50,7 @@
#include "gpio.h"
#include "uart.h"
#include "analogio.h"
+#include "arithmetical.h"
// init for arduino-like settings