LLAP Library for Ciseco wireless products.

Dependents:   Ciseco_LLAP_Test Ciseco_SRF_Shield

Library for Ciseco wireless modules http://shop.ciseco.co.uk/rf-module-range/

Tested with Nucleo F401RE and http://shop.ciseco.co.uk/srf-shield-wireless-transciever-for-all-arduino-type-boards/

Files at this revision

API Documentation at this revision

Comitter:
SomeRandomBloke
Date:
Wed Apr 16 20:28:18 2014 +0000
Parent:
5:ec6fbf70d110
Child:
7:51c8887d6822
Commit message:

Changed in this revision

LLAPSerial.cpp Show annotated file Show diff for this revision Revisions of this file
LLAPSerial.h Show annotated file Show diff for this revision Revisions of this file
--- a/LLAPSerial.cpp	Wed Apr 16 19:41:30 2014 +0000
+++ b/LLAPSerial.cpp	Wed Apr 16 20:28:18 2014 +0000
@@ -45,16 +45,20 @@
 #include "mbed.h"
 #include "LLAPSerial.h"
 
-
-// Constructors to pass in Tx/Rx pins and optional ID, default is -- as defined in LLAPSerial.h
-LLAPSerial::LLAPSerial(PinName txPin, PinName rxPin, bool checkDevIDin, char *dID) : srf(txPin, rxPin)
+// Constructors to pass in Tx/Rx, enable pins and optional ID, default is -- as defined in LLAPSerial.h
+LLAPSerial::LLAPSerial(PinName txPin, PinName rxPin, PinName enableSRF, bool checkDevIDin, char *dID) : srf(txPin, rxPin), srfEnable( enableSRF )
 {
     srf.baud(115200);
+    
     bMsgReceived = false;
     setDeviceId(dID);
     cMessage[12]=0;     // ensure terminated
     inPtr = cMessage;
     checkDevID = checkDevIDin;
+    
+    // Enable the SRF
+    srfEnable = 1;
+
     // Attach the receive interrupt handler
     srf.attach( this,&LLAPSerial::SerialEvent );
 }
--- a/LLAPSerial.h	Wed Apr 16 19:41:30 2014 +0000
+++ b/LLAPSerial.h	Wed Apr 16 20:28:18 2014 +0000
@@ -64,14 +64,19 @@
     */
     Serial srf;
     
+    /** Pin for SRF enable/disable
+    */
+    DigitalOut srfEnable;
+    
  public:
      /** Default Constructor
      * @param txPin Pin name for UART TX
      * @param rxPin Pin name for UART RX
+     * @param enableSRF Pin name for the SRF enable
      * @param checkNodeID Check the incoming Device ID and ignore if it doesnt match
      * @param dID ID for device, used in sending messages and if checkNodeID is true then only messages for this ID are accepted
      */
-    LLAPSerial(PinName txPin, PinName rxPin, bool checkDevIDin = false, char *dID = "--" );
+    LLAPSerial(PinName txPin, PinName rxPin, PinName enableSRF, bool checkDevIDin = false, char *dID = "--" );
 
     /** Send a message
     * @param sToSend Character pointer to message to send, will be padded with - to full length or truncated if too long