Andrew Reed / Mbed OS CITY1082-i2c_master_wifi_mqtt
Embed: (wiki syntax)

« Back to documentation index

cy_string_utils.c File Reference

cy_string_utils.c File Reference

String utilities. More...

Go to the source code of this file.

Functions

static char cy_hexchar_to_nibble (char hexchar, uint8_t *nibble)
 Convert an ASCII hex character into a nibble.
uint32_t cy_generic_string_to_unsigned (const char *str)
uint8_t cy_string_to_signed (const char *string, uint16_t str_length, int32_t *value_out, uint8_t is_hex)
 Converts a decimal/hexidecimal string (with optional sign) to a signed long int Better than strtol or atol or atoi because the return value indicates if an error occurred.
uint8_t cy_string_to_unsigned (const char *string, uint8_t str_length, uint32_t *value_out, uint8_t is_hex)
 Converts a decimal/hexidecimal string to an unsigned long int Better than strtol or atol or atoi because the return value indicates if an error occurred.

Detailed Description

String utilities.

Definition in file cy_string_utils.c.


Function Documentation

static char cy_hexchar_to_nibble ( char  hexchar,
uint8_t *  nibble 
) [static]

Convert an ASCII hex character into a nibble.

Parameters:
[in]char: The single hex character to convert to a nibble
[out]nibble: Pointer to store The value of the nibble in the lower 4 bits
Returns:
0 = SUCCESS -1 = not a hex character

Definition at line 90 of file cy_string_utils.c.