A Roboteq controller c++ interface to allow a Brushless motor control on a CAN bus. Used for a FBL2360 reference.

Dependencies:   CAN_FIFO_Triporteur

Revision:
4:1ee0a235c997
Parent:
3:a03c91082856
Child:
6:f9c4795448c1
diff -r a03c91082856 -r 1ee0a235c997 RoboteqController.h
--- a/RoboteqController.h	Fri May 18 09:32:45 2018 +0000
+++ b/RoboteqController.h	Tue May 29 15:41:49 2018 +0000
@@ -54,7 +54,9 @@
      * @param Id Id of the concerned data structure
      * @param msg CANMessage instance containing the new data
      */
-    void update(const unsigned short& Id, const CANMessage& msg);
+    virtual void update(const unsigned short& Id, const CANMessage& msg);
+    
+    void sendCommand(uint32_t cmd);
     
     protected:
     
@@ -63,7 +65,7 @@
     typedef struct {
         uint8_t css;
         uint8_t n;
-        uint16_t index;
+        uint16_t idx;
         uint8_t subindex;
         uint8_t data[4];
     } SDOMessage;
@@ -128,7 +130,7 @@
      * @param user_var1 The first signed 32-bit integer to be read (the first 4 bytes)
      * @param user_var2 The second signed 32-bit integer to be read (the last 4 bytes)
      */
-    void TPDO_parse(const CANMessage& CANmsg, int32_t &user_var1, int32_t &user_var2);
+    void TPDO_parse(const CANMessage& CANmsg, int32_t* p_user_var1, int32_t* p_user_var2);
     
     /** Receive TPDO frames from the controller. If TPDO are used, this virtual
      * method must be redefined in a class that inherits from this one.
@@ -166,8 +168,8 @@
     int8_t temp_ch2;                // channel 2 temperature
     int32_t vars[16];               // Integer user variables
     bool booleans[16];              // Boolean user variables
-    int16_t speed;                  // Rotor speed       
-    
+    int16_t speed;                  // Rotor speed
+        
     /* CAN Identifiers */  
     unsigned short Id_CSS_REQ;      // CAN ID : CSS request (query or command)
     unsigned short Id_CSS_ANS;      // CAN ID : CSS answer (from query or command)