CMSIS-Driver  
Peripheral Interface for Middleware and Application Code
 
Loading...
Searching...
No Matches
Defines and Structs

Documents the defines and structs of the VIO API. More...

Content

 Signals
 Signal related defines.
 
 Values
 Value related defines.
 

Functions

void vioInit (void)
 Initialize test input, output.
 
int32_t vioPrint (uint32_t level, const char *format,...)
 Print formated string to test terminal.
 
void vioSetSignal (uint32_t mask, uint32_t signal)
 Set signal output.
 
uint32_t vioGetSignal (uint32_t mask)
 Get signal input.
 
void vioSetValue (uint32_t id, int32_t value)
 Set value output.
 
int32_t vioGetValue (uint32_t id)
 Get value input.
 
void vioSetXYZ (uint32_t id, vioValueXYZ_t valueXYZ)
 Set XYZ value output.
 
vioValueXYZ_t vioGetXYZ (uint32_t id)
 Get XYZ value input.
 
void vioSetIPv4 (uint32_t id, vioAddrIPv4_t addrIPv4)
 Set IPv4 address output.
 
vioAddrIPv4_t vioGetIPv4 (uint32_t id)
 Get IPv4 address input.
 
void vioSetIPv6 (uint32_t id, vioAddrIPv6_t addrIPv6)
 Set IPv6 address output.
 
vioAddrIPv6_t vioGetIPv6 (uint32_t id)
 Get IPv6 address from peripheral.
 

Description

Documents the defines and structs of the VIO API.

Test.

Function Documentation

◆ vioInit()

void vioInit ( void  )

Initialize test input, output.

Returns
none.

The function vioInit initializes the VIO interface. Use it to initialize any connected hardware that is used to map VIO signals.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
// System Initialization
SystemCoreClockUpdate();
// ...
}
void vioInit(void)
Initialize test input, output.
Definition: VIO.txt:221

◆ vioPrint()

int32_t vioPrint ( uint32_t  level,
const char *  format,
  ... 
)

Print formated string to test terminal.

Parameters
[in]levellevel (vioLevel...).
[in]formatformated string to print.
[in]...optional arguments (depending on format string).
Returns
number of characters written or -1 in case of error.

The function vioPrint prints a formatted string to a test terminal. Formatting of the output follows the rules of standard C language printf().

Refer to Print Levels for information about the possible levels.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
int x = 3;
vioPrint(vioLevelNone, "Test [None]");
vioPrint(vioLevelHeading, "Test [Heading] = Network Connector Message");
vioPrint(vioLevelMessage, "Test [Message] = Connection failed");
vioPrint(vioLevelError, "Test [Error] = %d", x);
}
#define vioLevelNone
vioPrint level parameter: None
Definition: cmsis_vio.h:78
int32_t vioPrint(uint32_t level, const char *format,...)
Print formated string to test terminal.
Definition: VIO.txt:243
#define vioLevelHeading
vioPrint level parameter: Heading
#define vioLevelMessage
vioPrint level parameter: Message
#define vioLevelError
vioPrint level parameter: Error

◆ vioSetSignal()

void vioSetSignal ( uint32_t  mask,
uint32_t  signal 
)

Set signal output.

Parameters
[in]maskbit mask of signals to set.
[in]signalsignal value to set.
Returns
none.

The function vioSetSignal set a signal to an output specified by mask. Use this function to map VIOs to actual hardware for displaying signals on a target board.

Refer to Signals for information about the possible mask and signal values.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
// ...
}
void vioSetSignal(uint32_t mask, uint32_t signal)
Set signal output.
Definition: VIO.txt:270
#define vioLED0
vioSetSignal mask parameter: LED 0 (for 3-color: red)
#define vioLEDoff
vioSetSignal signal parameter: pattern to turn any LED off
#define vioLEDon
vioSetSignal signal parameter: pattern to turn any LED on

◆ vioGetSignal()

uint32_t vioGetSignal ( uint32_t  mask)

Get signal input.

Parameters
[in]maskbit mask of signals to read.
Returns
signal value.

The function vioGetSignal retrieves a signal from an input identified by mask. Use this function to read data from any input that is provided.

Refer to Signals for information about the possible mask values.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
uint32_t state;
uint32_t last = 0U;
for (;;) {
state = (vioGetSignal (vioBUTTON0)); // Get pressed button state
if (state != last){
if (state == vioBUTTON0){
// do something
}
}
last = state;
}
}
#define vioBUTTON0
vioGetSignal mask parameter: Push button 0
Definition: cmsis_vio.h:50
uint32_t vioGetSignal(uint32_t mask)
Get signal input.
Definition: VIO.txt:293

◆ vioSetValue()

void vioSetValue ( uint32_t  id,
int32_t  value 
)

Set value output.

Parameters
[in]idoutput identifier.
[in]valuevalue to set.
Returns
none.

The function vioSetValue set the value to the output identified by id. Use this function to set states of I/Os for example.

Refer to Values for information about value and IDs for id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
}
void vioSetValue(uint32_t id, int32_t value)
Set value output.
Definition: VIO.txt:326
#define vioAOUT0
vioSetValue / vioGetValue id parameter: Analog output value 0

◆ vioGetValue()

int32_t vioGetValue ( uint32_t  id)

Get value input.

Parameters
[in]idinput identifier.
Returns
value retrieved from input.

The function vioGetValue retrieves a value from the input identified by id. Use this function to read data from inputs.

Refer to IDs for information about id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
uint32_t button;
}
int32_t vioGetValue(uint32_t id)
Get value input.
Definition: VIO.txt:347

◆ vioSetXYZ()

void vioSetXYZ ( uint32_t  id,
vioValueXYZ_t  valueXYZ 
)

Set XYZ value output.

Parameters
[in]idoutput identifier.
[in]valueXYZXYZ data to set.
Returns
none.

The function vioSetXYZ sets a three-dimensional value valueXYZ to the output identified by id. Use this function to apply a 3d value to an output.

Refer to Values for information about the valueXYZ and IDs for id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
vioValueXYZ_t xyz = {123, 456, 789};
vioSetXYZ(0, xyz);
}
void vioSetXYZ(uint32_t id, vioValueXYZ_t valueXYZ)
Set XYZ value output.
Definition: VIO.txt:370
3-D vector value
Definition: cmsis_vio.h:84

◆ vioGetXYZ()

vioValueXYZ_t vioGetXYZ ( uint32_t  id)

Get XYZ value input.

Parameters
[in]idinput identifier.
Returns
XYZ data retrieved from XYZ peripheral.

The function vioGetXYZ retrieves a three-dimensional value from the input identified by id. Use this function to get a 3d value.

Refer to IDs for information about id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
volatile vioValueXYZ_t xyz;
}
#define vioMotionGyro
vioSetXYZ / vioGetXYZ id parameter: for Gyroscope
Definition: cmsis_vio.h:73
vioValueXYZ_t vioGetXYZ(uint32_t id)
Get XYZ value input.
Definition: VIO.txt:394

◆ vioSetIPv4()

void vioSetIPv4 ( uint32_t  id,
vioAddrIPv4_t  addrIPv4 
)

Set IPv4 address output.

Parameters
[in]idoutput identifier.
[in]addrIPv4pointer to IPv4 address.
Returns
none.

The function vioSetIPv4 sets an IPv4 address specified by addrIPv4 to an interface identified by id. Use this function to assign an IPv4 address to an interface.

Refer to IDs for information about id and IP Addresses for addrIPv4.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
vioAddrIPv4_t addrIPv4 = {192U, 168U, 111U, 123U};
vioSetIPv4 (0, addrIPv4);
}
void vioSetIPv4(uint32_t id, vioAddrIPv4_t addrIPv4)
Set IPv4 address output.
Definition: VIO.txt:418
IPv4 Internet Address.
Definition: cmsis_vio.h:91

◆ vioGetIPv4()

vioAddrIPv4_t vioGetIPv4 ( uint32_t  id)

Get IPv4 address input.

Parameters
[in]idinput identifier.
Returns
IPv4 address retrieved from peripheral.

The function vioGetIPv4 retrieves the IPv4 addrIPv4 from an interface identified by id. Use this function to read an IPv4 address.

Refer to IDs for information about id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
vioAddrIPv4_t addrIPv4;
addrIPv4 = vioGetIPv4(0);
}
vioAddrIPv4_t vioGetIPv4(uint32_t id)
Get IPv4 address input.
Definition: VIO.txt:440

◆ vioSetIPv6()

void vioSetIPv6 ( uint32_t  id,
vioAddrIPv6_t  addrIPv6 
)

Set IPv6 address output.

Parameters
[in]idoutput identifier.
[in]addrIPv6pointer to IPv6 address.
Returns
none.

The function vioSetIPv6 sets an IPv6 address specified by addrIPv6 to an interface identified by id. Use this function to assign an IPv6 address to an interface.

Refer to IDs for information about id and IP Addresses for addrIPv6.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
vioAddrIPv6_t addrIPv6 = {1U, 2U, 3U, 4U, 5U, 6U, 7U, 8U,
9U, 10U, 11U, 12U, 13U, 14U, 15U, 16U};
vioSetIPv6 (0, addrIPv6);
}
void vioSetIPv6(uint32_t id, vioAddrIPv6_t addrIPv6)
Set IPv6 address output.
Definition: VIO.txt:464
IPv6 Internet Address.
Definition: cmsis_vio.h:96

◆ vioGetIPv6()

vioAddrIPv6_t vioGetIPv6 ( uint32_t  id)

Get IPv6 address from peripheral.

Parameters
[in]idinput identifier.
Returns
IPv6 address retrieved from peripheral.

The function vioGetIPv6 retrieves the IPv6 addrIPv6 from an interface identified by id. Use this function to read an IPv6 address.

Refer to IDs for information about id.

Code Example:

#include "cmsis_vio.h" // ::CMSIS Driver:VIO
int main (void) {
vioAddrIPv6_t addrIPv6;
addrIPv6 = vioGetIPv6(0);
}
vioAddrIPv6_t vioGetIPv6(uint32_t id)
Get IPv6 address from peripheral.
Definition: VIO.txt:487