|
|
@@ -1,8 +1,8 @@
|
|
|
-/**************************************************************************//**
|
|
|
+/******************************************************************************
|
|
|
* @file cmsis_vio.h
|
|
|
* @brief CMSIS Virtual I/O header file
|
|
|
- * @version V1.4.0
|
|
|
- * @date 11. March 2020
|
|
|
+ * @version V0.1.0
|
|
|
+ * @date 18. March 2020
|
|
|
******************************************************************************/
|
|
|
/*
|
|
|
* Copyright (c) 2019-2020 Arm Limited. All rights reserved.
|
|
|
@@ -31,74 +31,72 @@
|
|
|
* Generic I/O mapping recommended for CMSIS-VIO
|
|
|
* Note: not every I/O must be physically available
|
|
|
*/
|
|
|
-
|
|
|
-// cvSetSignal: mask values
|
|
|
-#define cvLED0 (1U << 0) /// cvSetSignal mask LED 0 (for 3-color: red)
|
|
|
-#define cvLED1 (1U << 1) /// cvSetSignal mask LED 1 (for 3-color: green)
|
|
|
-#define cvLED2 (1U << 2) /// cvSetSignal mask LED 2 (for 3-color: blue)
|
|
|
-#define cvLED3 (1U << 3) /// cvSetSignal mask LED 3
|
|
|
-#define cvLED4 (1U << 4) /// cvSetSignal mask LED 4
|
|
|
-#define cvLED5 (1U << 5) /// cvSetSignal mask LED 5
|
|
|
-#define cvLED6 (1U << 6) /// cvSetSignal mask LED 6
|
|
|
-#define cvLED7 (1U << 7) /// cvSetSignal mask LED 7
|
|
|
+
|
|
|
+/// cvSetSignal: mask values
|
|
|
+#define cvLED0 (1U << 0) /// cvSetSignal mask LED 0 (for 3-color: red)
|
|
|
+#define cvLED1 (1U << 1) /// cvSetSignal mask LED 1 (for 3-color: green)
|
|
|
+#define cvLED2 (1U << 2) /// cvSetSignal mask LED 2 (for 3-color: blue)
|
|
|
+#define cvLED3 (1U << 3) /// cvSetSignal mask LED 3
|
|
|
+#define cvLED4 (1U << 4) /// cvSetSignal mask LED 4
|
|
|
+#define cvLED5 (1U << 5) /// cvSetSignal mask LED 5
|
|
|
+#define cvLED6 (1U << 6) /// cvSetSignal mask LED 6
|
|
|
+#define cvLED7 (1U << 7) /// cvSetSignal mask LED 7
|
|
|
|
|
|
/// cvSetSignal: signal values
|
|
|
-#define cvLEDon (0xFF) // pattern to turn any LED on
|
|
|
-#define cvLEDoff (0x00) // pattern to turn any LED off
|
|
|
+#define cvLEDon (0xFFU) /// pattern to turn any LED on
|
|
|
+#define cvLEDoff (0x00U) /// pattern to turn any LED off
|
|
|
|
|
|
|
|
|
/// cvGetSignal: mask values and return values
|
|
|
-#define cvBUTTON0 (1U << 0) ///< cvGetSignal mask Push button 0
|
|
|
-#define cvBUTTON1 (1U << 1) ///< cvGetSignal mask Push button 1
|
|
|
-#define cvBUTTON2 (1U << 2) ///< cvGetSignal mask Push button 2
|
|
|
-#define cvBUTTON3 (1U << 3) ///< cvGetSignal mask Push button 3
|
|
|
-#define cvJOYup (1U << 4) ///< cvGetSignal mask Joystick button: up
|
|
|
-#define cvJOYdown (1U << 5) ///< cvGetSignal mask Joystick button: down
|
|
|
-#define cvJOYleft (1U << 6) ///< cvGetSignal mask Joystick button: left
|
|
|
-#define cvJOYright (1U << 7) ///< cvGetSignal mask Joystick button: right
|
|
|
-#define cvJOYselect (1U << 8) ///< cvGetSignal mask Joystick button: select
|
|
|
+#define cvBUTTON0 (1U << 0) ///< cvGetSignal mask Push button 0
|
|
|
+#define cvBUTTON1 (1U << 1) ///< cvGetSignal mask Push button 1
|
|
|
+#define cvBUTTON2 (1U << 2) ///< cvGetSignal mask Push button 2
|
|
|
+#define cvBUTTON3 (1U << 3) ///< cvGetSignal mask Push button 3
|
|
|
+#define cvJOYup (1U << 4) ///< cvGetSignal mask Joystick button: up
|
|
|
+#define cvJOYdown (1U << 5) ///< cvGetSignal mask Joystick button: down
|
|
|
+#define cvJOYleft (1U << 6) ///< cvGetSignal mask Joystick button: left
|
|
|
+#define cvJOYright (1U << 7) ///< cvGetSignal mask Joystick button: right
|
|
|
+#define cvJOYselect (1U << 8) ///< cvGetSignal mask Joystick button: select
|
|
|
#define cvJOYall (cvJOYup | \
|
|
|
cvJOYdown | \
|
|
|
cvJOYleft | \
|
|
|
cvJOYright | \
|
|
|
- cvJOYselect | )
|
|
|
-
|
|
|
+ cvJOYselect | )
|
|
|
|
|
|
/// cvSetValue / cvGetValue: id values
|
|
|
-#define cvAIN0 (0U) ///< cvSetvalue / cvgetValue Analog input value 0
|
|
|
-#define cvAIN1 (1U) ///< cvSetvalue / cvgetValue Analog input value 1
|
|
|
-#define cvAIN2 (2U) ///< cvSetvalue / cvgetValue Analog input value 2
|
|
|
-#define cvAIN3 (3U) ///< cvSetvalue / cvgetValue Analog input value 3
|
|
|
-#define cvAOUT0 (3U) ///< cvSetvalue / cvgetValue Analog output value 0
|
|
|
+#define cvAIN0 (0U) ///< cvSetvalue / cvGetValue Analog input value 0
|
|
|
+#define cvAIN1 (1U) ///< cvSetvalue / cvGetValue Analog input value 1
|
|
|
+#define cvAIN2 (2U) ///< cvSetvalue / cvGetValue Analog input value 2
|
|
|
+#define cvAIN3 (3U) ///< cvSetvalue / cvGetValue Analog input value 3
|
|
|
+#define cvAOUT0 (3U) ///< cvSetvalue / cvGetValue Analog output value 0
|
|
|
|
|
|
|
|
|
/// cvSetXYZ / cvGetXZY: id values
|
|
|
-#define cvMotionGyro (0U) ///< cvSetXYZ / cvGetXYZ Gyroscope
|
|
|
-#define cvMotionAccelero (1U) ///< cvSetXYZ / cvGetXYZ Accelerometer
|
|
|
-#define cvMotionMagneto (2U) ///< cvSetXYZ / cvGetXYZ Magnetometer
|
|
|
-
|
|
|
+#define cvMotionGyro (0U) ///< cvSetXYZ / cvGetXYZ Gyroscope
|
|
|
+#define cvMotionAccelero (1U) ///< cvSetXYZ / cvGetXYZ Accelerometer
|
|
|
+#define cvMotionMagneto (2U) ///< cvSetXYZ / cvGetXYZ Magnetometer
|
|
|
|
|
|
/// cvPrint: levels
|
|
|
-#define cvLevelNone (0U) ///< cvPrint Level None
|
|
|
-#define cvLevelHeading (1U) ///< cvPrint Level Heading
|
|
|
-#define cvLevelMessage (2U) ///< cvPrint Level Message
|
|
|
-#define cvLevelError (3U) ///< cvPrint Level Error
|
|
|
+#define cvLevelNone (0U) ///< cvPrint Level None
|
|
|
+#define cvLevelHeading (1U) ///< cvPrint Level Heading
|
|
|
+#define cvLevelMessage (2U) ///< cvPrint Level Message
|
|
|
+#define cvLevelError (3U) ///< cvPrint Level Error
|
|
|
|
|
|
/// 3-D vector value
|
|
|
typedef struct cvValueXYZ {
|
|
|
- int32_t X; ///< X coordinate
|
|
|
- int32_t Y; ///< Y coordinate
|
|
|
- int32_t Z; ///< Z coordinate
|
|
|
+ int32_t X; ///< X coordinate
|
|
|
+ int32_t Y; ///< Y coordinate
|
|
|
+ int32_t Z; ///< Z coordinate
|
|
|
} cvValueXYZ_t;
|
|
|
|
|
|
/// IPv4 Internet Address
|
|
|
-typedef struct cvAddrIPv4 {
|
|
|
- uint8_t addr[4]; ///< IPv4 address value
|
|
|
+typedef struct {
|
|
|
+ uint8_t addr[4]; ///< IPv4 address value
|
|
|
} cvAddrIPv4_t;
|
|
|
|
|
|
/// IPv6 Internet Address
|
|
|
-typedef struct cvAddrIPv6 {
|
|
|
- uint8_t addr[16]; ///< IPv6 address value
|
|
|
+typedef struct {
|
|
|
+ uint8_t addr[16]; ///< IPv6 address value
|
|
|
} cvAddrIPv6_t;
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
@@ -107,7 +105,7 @@ extern "C"
|
|
|
#endif
|
|
|
|
|
|
/// Initialize test input, output.
|
|
|
-/// \return none
|
|
|
+/// \return none.
|
|
|
void cvInit (void);
|
|
|
|
|
|
/// Print formated string to test terminal.
|
|
|
@@ -123,19 +121,19 @@ int32_t cvGetChar (void);
|
|
|
|
|
|
/// Set signal output.
|
|
|
/// \param[in] mask bit mask of signals to set.
|
|
|
-/// \param[in] signal signal value to set (LEDs bit 0..15, Switches bit 16..31).
|
|
|
-/// \return none
|
|
|
+/// \param[in] signal signal value to set.
|
|
|
+/// \return none.
|
|
|
void cvSetSignal (uint32_t mask, uint32_t signal);
|
|
|
|
|
|
/// Get signal input.
|
|
|
/// \param[in] mask bit mask of signals to read.
|
|
|
-/// \return signal value or highest bit set in case of error.
|
|
|
+/// \return signal value.
|
|
|
uint32_t cvGetSignal (uint32_t mask);
|
|
|
|
|
|
/// Set value output.
|
|
|
/// \param[in] id output identifier.
|
|
|
/// \param[in] value value to set.
|
|
|
-/// \return none
|
|
|
+/// \return none.
|
|
|
void cvSetValue (uint32_t id, int32_t value);
|
|
|
|
|
|
/// Get value input.
|
|
|
@@ -146,7 +144,7 @@ int32_t cvGetValue (uint32_t id);
|
|
|
/// Set XYZ value output.
|
|
|
/// \param[in] id output identifier.
|
|
|
/// \param[in] valueXYZ XYZ data to set.
|
|
|
-/// \return none
|
|
|
+/// \return none.
|
|
|
void cvSetXYZ (uint32_t id, cvValueXYZ_t valueXYZ);
|
|
|
|
|
|
/// Get XYZ value input.
|
|
|
@@ -157,23 +155,23 @@ cvValueXYZ_t cvGetXYZ (uint32_t id);
|
|
|
/// Set IPv4 address output.
|
|
|
/// \param[in] id output identifier.
|
|
|
/// \param[in] addrIPv4 pointer to IPv4 address.
|
|
|
-/// \return none
|
|
|
+/// \return none.
|
|
|
void cvSetIPv4 (uint32_t id, cvAddrIPv4_t addrIPv4);
|
|
|
|
|
|
/// Get IPv4 address input.
|
|
|
/// \param[in] id input identifier.
|
|
|
-/// \return IPv4 address retrieved from peripheral
|
|
|
+/// \return IPv4 address retrieved from peripheral.
|
|
|
cvAddrIPv4_t cvGetIPv4 (uint32_t id);
|
|
|
|
|
|
/// Set IPv6 address output.
|
|
|
/// \param[in] id output identifier.
|
|
|
/// \param[in] addrIPv6 pointer to IPv6 address.
|
|
|
-/// \return none
|
|
|
+/// \return none.
|
|
|
void cvSetIPv6 (uint32_t id, cvAddrIPv6_t addrIPv6);
|
|
|
|
|
|
/// Get IPv6 address from peripheral.
|
|
|
/// \param[in] id input identifier.
|
|
|
-/// \return IPv6 address retrieved from peripheral
|
|
|
+/// \return IPv6 address retrieved from peripheral.
|
|
|
cvAddrIPv6_t cvGetIPv6 (uint32_t id);
|
|
|
|
|
|
#ifdef __cplusplus
|