]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blobdiff - rpp/blocks/sfunction_cansetup.c
Change license to MIT
[jenkicar/rpp-simulink.git] / rpp / blocks / sfunction_cansetup.c
index 796ed28df5ebcaf8287e7741c249d9c32d5beab9..bee00a8a82d897a6950f5d5b07cb9a6cd3266f4d 100644 (file)
@@ -3,10 +3,26 @@
  * Authors:
  *     - Michal Horn <hornmich@fel.cvut.cz>
  *
- * This document contains proprietary information belonging to Czech
- * Technical University in Prague. Passing on and copying of this
- * document, and communication of its contents is not permitted
- * without prior written authorization.
+ * 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
+ * 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 DEALINGS IN THE SOFTWARE.
  *
  * File : sfunction_cansetup.c
  * Abstract:
 /*
 %YAML 1.2
 ---
-Name: xxx
-Category: Xxxx
-Header: xxx.h
-Mnemonic: XXX
+Name: CAN Setup
+Category: CAN
+Header: rpp/can.h
+Mnemonic: CANC
 
 Inputs:
 
 Outputs:
 
 Parameters:
+  - { name: "CAN1 baud rate in bps", type: "uint32", range: "1 – 10000000" }
+  - { name: "CAN2 baud rate in bps", type: "uint32", range: "1 – 10000000" }
+  - { name: "CAN3 baud rate in bps", type: "uint32", range: "1 – 10000000" }
+
+# Description and Help is in Markdown mark-up
+Description: &desc |
 
-# Description is in Markdown mark-up
-Description: >
+  This block configures the CAN bus controllers. Exactly one CAN bus
+  configuration block must be in the model if any of the CAN Receive
+  or CAN Transmit block is used.
 
-  This block ...
+Help: *desc
 
-Status:
-  Tested:
-  Untested:
-  Not working:
+Status: Stable
 
 RPP API functions used:
+    - rpp_can_init()
 
 Relevant demos:
+    - cantransmit
+    - can_demo
 ...
 */
 
@@ -56,7 +79,7 @@ Relevant demos:
 #include <stdio.h> 
 
 #define BAUDRATE_MIN   1
-#define BAUDRATE_MAX   10000000
+#define BAUDRATE_MAX   1000000
 
 #define BAUDRATE_CAN1_PARAM_NAME       "baudrate_can1"
 #define BAUDRATE_CAN2_PARAM_NAME       "baudrate_can2"
@@ -87,7 +110,6 @@ static void mdlInitializeSizes(SimStruct *S)
     }
  
     rppSetStandardOptions(S);
-    void CAN_Common_MdlInitSizes(SimStruct *S);
 }