47#define BCD_TO_DEC(BCD) (((BCD) >> 4) * 10 + ((BCD) & 0x0F))
54#define DEC_TO_BCD(DEC) (((DEC / 10) << 4) | (DEC % 10))
67 uint32_t delay_start_time = systick_get_ms(); \
68 while ((systick_get_ms() - delay_start_time) < (ms)) { \
170void double_to_str(
double num,
char *str, int8_t frac_digits);
196void str_set(
char *target_str,
char const *host_str, uint32_t host_str_len, uint32_t pos);
206int32_t
get_pow(int32_t base, int32_t exponent);
228bool str_cmp(
const char *str1,
const char *str2);
259int str_tokenize(
char *str,
const char *separator, uint16_t max_tokens,
char **tokens, uint16_t *num_tokens);
289int str_cpy(
char *str_to,
const char *str_from, uint32_t len);
304int txt_cpy(
char *txt_to,
const char *txt_from, uint32_t len);
329uint32_t
extract_bits(
const uint8_t *data, uint16_t start_bit, uint8_t num_bits);
bool str_cmp(const char *str1, const char *str2)
Compares two null-terminated strings for equality.
int str_to_int(const char *str)
Converts a decimal string to an integer.
int str_cpy(char *str_to, const char *str_from, uint32_t len)
Copies a null-terminated string into a destination buffer.
uint32_t extract_bits(const uint8_t *data, uint16_t start_bit, uint8_t num_bits)
Extracts a range of bits from a big-endian byte array.
void hex_byte_to_str(uint8_t byte, char *str)
Converts a single byte to a two-character uppercase hexadecimal string.
void str_set(char *target_str, char const *host_str, uint32_t host_str_len, uint32_t pos)
Overwrites a region of a target string with the contents of a source string.
uint8_t ascii_hex_to_byte(char high, char low)
Converts two ASCII hex characters into a single byte value.
uint32_t get_str_len(char const *str)
Returns the length of a string, excluding the null terminator.
void double_to_str(double num, char *str, int8_t frac_digits)
Converts a double to a decimal string with a fixed number of fractional digits.
bool str_to_bool(char const *str)
Converts a string representation of a boolean to a bool value.
bool is_pow(uint32_t num)
Checks whether a number is a power of two.
int str_tokenize(char *str, const char *separator, uint16_t max_tokens, char **tokens, uint16_t *num_tokens)
Splits a string into tokens separated by a given delimiter.
int txt_cpy(char *txt_to, const char *txt_from, uint32_t len)
Copies a fixed-length block of text into a destination buffer.
void int_to_str(int num, char *str)
Converts an integer to its decimal string representation.
int32_t get_pow(int32_t base, int32_t exponent)
Computes an integer power.
void arr_cmprs(char *arr, uint8_t len)
Compresses an array by removing null bytes and shifting remaining elements left.
PIN_STATUS_te
Represents the logical level of a GPIO pin.
VERTICAL_DIR_te
Represents a vertical movement direction.
EN_STATUS_te
Represents an enabled or disabled state.