This will become a hardware abstraction layer for my mbed projects. It will make it easier to port sketches from Arduino to mbed

Dependents:   Potentiometer

Files at this revision

API Documentation at this revision

Comitter:
rbohne
Date:
Sat Jun 04 20:16:04 2011 +0000
Parent:
3:d0f535da303e
Commit message:

Changed in this revision

wiring.h Show annotated file Show diff for this revision Revisions of this file
wiring_private.h Show annotated file Show diff for this revision Revisions of this file
diff -r d0f535da303e -r 40396527a068 wiring.h
--- a/wiring.h	Sat Jun 04 20:03:00 2011 +0000
+++ b/wiring.h	Sat Jun 04 20:16:04 2011 +0000
@@ -25,13 +25,12 @@
 #ifndef Wiring_h
 #define Wiring_h
 
-//#include <avr/io.h>
-//#include <stdlib.h>
 #include "binary.h"
 
-#ifdef __cplusplus
-extern "C"{
-#endif
+
+#define uint8_t int
+#define boolean int
+#define byte int
 
 #define HIGH 0x1
 #define LOW  0x0
@@ -58,15 +57,6 @@
 #define FALLING 2
 #define RISING 3
 
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
-#define INTERNAL1V1 2
-#define INTERNAL2V56 3
-#else
-#define INTERNAL 3
-#endif
-#define DEFAULT 1
-#define EXTERNAL 0
-
 // undefine stdlib's abs if encountered
 #ifdef abs
 #undef abs
@@ -97,14 +87,9 @@
 #define bitWrite(value, bit, bitvalue) (bitvalue ? bitSet(value, bit) : bitClear(value, bit))
 
 
-typedef unsigned int word;
-
 #define bit(b) (1UL << (b))
 
-#define uint8_t int
 
-typedef uint8_t boolean;
-typedef uint8_t byte;
 
 void init(void);
 
@@ -130,8 +115,5 @@
 void setup(void);
 void loop(void);
 
-#ifdef __cplusplus
-} // extern "C"
-#endif
 
 #endif
diff -r d0f535da303e -r 40396527a068 wiring_private.h
--- a/wiring_private.h	Sat Jun 04 20:03:00 2011 +0000
+++ b/wiring_private.h	Sat Jun 04 20:16:04 2011 +0000
@@ -25,15 +25,8 @@
 #ifndef WiringPrivate_h
 #define WiringPrivate_h
 
-#include <stdio.h>
-#include <stdarg.h>
-
 #include "wiring.h"
 
-#ifdef __cplusplus
-extern "C"{
-#endif
-
 #ifndef cbi
 #define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))
 #endif
@@ -41,25 +34,5 @@
 #define sbi(sfr, bit) (_SFR_BYTE(sfr) |= _BV(bit))
 #endif
 
-#define EXTERNAL_INT_0 0
-#define EXTERNAL_INT_1 1
-#define EXTERNAL_INT_2 2
-#define EXTERNAL_INT_3 3
-#define EXTERNAL_INT_4 4
-#define EXTERNAL_INT_5 5
-#define EXTERNAL_INT_6 6
-#define EXTERNAL_INT_7 7
-
-#if defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
-#define EXTERNAL_NUM_INTERRUPTS 8
-#else
-#define EXTERNAL_NUM_INTERRUPTS 2
-#endif
-
-typedef void (*voidFuncPtr)(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
 
 #endif