Modular Electronics  0.1
 All Classes Namespaces Functions Variables Pages
Functions
interface_utils Namespace Reference

Functions

uint8_t query_serial (String cmd[])
 
uint8_t string_to_int_array (String string_in, uint8_t array_out[])
 
void shift_array_left (String array_in[], uint8_t array_in_size, String array_out[], uint8_t n_shift)
 

Detailed Description

Utilites for interface

Author
Carlos Kometter
Version
0.1
Date
2018

Function Documentation

uint8_t interface_utils::query_serial ( String  cmd[])
inline

Reads and parses a serial message until the until '\r' and stores the command to cmd[]. A ',' or ':' indicates a new element. For example, the message "DAC:SET,0,1.3\r", will be parsed as {"DAC", "SET", "0", "1.3"}.

Parameters
[out]cmd[]The array to store the message.
void interface_utils::shift_array_left ( String  array_in[],
uint8_t  array_in_size,
String  array_out[],
uint8_t  n_shift 
)
inline

Shifts array to the left.

Parameters
[in]array_in[]The array to be shifted.
[in]array_in_sizeThe size of array_in[].
[out]array_out[]Array to store shifted array.
[in]n_shiftThe number of places to shift.
uint8_t interface_utils::string_to_int_array ( String  string_in,
uint8_t  array_out[] 
)
inline

Separates String characters into an array of unsigned intergers. The String characters must be numbers.

Parameters
[in]string_inThe String to be separate.
[out]array_outThe array to store the String characters.
Returns
The size of string_in.