* 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: Configure CAN Bus block
+Name: CAN Setup
Category: CAN
Header: rpp/can.h
Mnemonic: CANC
Outputs:
Parameters:
- - name: Baud rate for CAN bus port 1 [1-10000000]
- type: uint32
- - name: Baud rate for CAN bus port 2 [1-10000000]
- type: uint32
- - name: Baud rate for CAN bus port 3 [1-10000000]
- type: uint32
+ - { 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 configures the CAN bus. Just one block CAN Setup must be in the model if any of
- the CAN Receive or CAN Transmit block is used.
+Help: *desc
-Status:
- Tested:
- - Configuring CAN1, CAN2 and CAN3
- Untested:
- Not working:
+Status: Stable
RPP API functions used:
- rpp_can_init()
#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"
}
rppSetStandardOptions(S);
- void CAN_Common_MdlInitSizes(SimStruct *S);
}