Maniacbug's nRF24L01+ arduino library ported to mbed. Functional with minor issues.

Revision:
2:a483f426d380
Parent:
1:d061e50ccc5d
Child:
3:b13cafed7ee5
diff -r d061e50ccc5d -r a483f426d380 nRF24L01P_Maniacbug.h
--- a/nRF24L01P_Maniacbug.h	Thu Apr 04 11:49:28 2013 +0000
+++ b/nRF24L01P_Maniacbug.h	Fri Apr 05 10:18:40 2013 +0000
@@ -1,24 +1,24 @@
 /*
     Copyright (c) 2007 Stefan Engelke <mbox@stefanengelke.de>
 
-    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
+    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:
 
-    The above copyright notice and this permission notice shall be
+    The above copyright notice and this permission notice shall be 
     included in all copies or substantial portions of the Software.
 
-    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
+    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.
 */
 
@@ -124,14 +124,9 @@
 #define RF_PWR_LOW  1
 #define RF_PWR_HIGH 2
 
+#define HIGH        1
 #define LOW         0
-#define HIGH        1
-#define _NRF24L01P_SPI_MAX_DATA_RATE     10000000
-#define _NRF24L01P_TIMING_Tundef2pd_us     100000   // 100mS
-#define _NRF24L01P_TIMING_Tpece2csn_us          4
-
-
-
+#define _BV(n) (1 << n)
 
 /*
  Copyright (C) 2011 J. Coliz <maniacbug@ymail.com>
@@ -150,8 +145,7 @@
 #ifndef __RF24_H__
 #define __RF24_H__
 
-#include "mbed.h"
-
+#include <mbed.h>
 
 /**
  * Power Amplifier level.
@@ -373,7 +367,7 @@
    * @param _cepin The pin attached to Chip Enable on the RF module
    * @param _cspin The pin attached to Chip Select
    */
-  RF24(PinName, PinName, PinName, PinName, PinName); //mosi miso sck ce cs
+  RF24(PinName mosi, PinName miso, PinName sck, PinName _csnpin, PinName _cepin);
 
   /**
    * Begin operation of the chip
@@ -775,9 +769,9 @@
    */
   bool testRPD(void) ;
   
-  int min(int, int);
-
+  uint8_t min(uint8_t, uint8_t);
 };
 
 
-#endif // __RF24_H__
\ No newline at end of file
+#endif // __RF24_H__
+// vim:ai:cin:sts=2 sw=2 ft=cpp