KETCube
|
KETCube common definitions. More...
#include "stm32l0xx_hal.h"
#include "stm32l0xx_hal_gpio.h"
#include "stdlib.h"
#include "stdbool.h"
#include "ketCube_projectCommon.h"
Go to the source code of this file.
Macros | |
#define | TRUE 1 |
boolean TRUE More... | |
#define | FALSE 0 |
boolean FALSE More... | |
#define | KETCUBE_COMMON_BUFFER_LEN 256 |
Typedefs | |
typedef uint8_t | byte |
Functions | |
void | KETCube_ErrorHandler (void) |
char * | ketCube_common_bytes2Str (uint8_t *byteArr, uint8_t len) |
static void | ketCube_common_Byte2hex (uint8_t byte, char *str) |
Convert a single Byte to HEX string (two bytes) More... | |
static void | ketCube_common_Int2dec (int32_t number, char *str, int len) |
Convert an integer to DEC string (with defined length, counting zero terminator) More... | |
static bool | ketCube_common_IsHexString (const char *str, uint8_t len) |
Test if the string is valid HEX string. More... | |
static bool | ketCube_common_IsDecString (const char *str, uint8_t len) |
Test if the string is valid DEC string. More... | |
static uint8_t | ketCube_common_Hex2Val (const char c) |
Convert HEX char to Int (Byte) More... | |
static void | ketCube_common_Hex2Bytes (uint8_t *bytes, const char *str, uint8_t len) |
Convert HEX string to Byte array. More... | |
static void | ketCube_common_Dec2int (int32_t *output, const char *str, uint8_t len) |
Convert DEC string to 4 byte signed integer. More... | |
static uint8_t | ketCube_common_Min (uint8_t a, uint8_t b) |
Return minimum of two bytes. More... | |
static uint8_t | ketCube_common_Max (uint8_t a, uint8_t b) |
Return maximum of two bytes. More... | |
static uint16_t | ketCube_common_Med (uint16_t *values, uint16_t size) |
Return median from an array of shorts. More... | |
static uint32_t | ketCube_common_Med32 (uint32_t *values, uint32_t size) |
Return median from an array of shorts. More... | |
static uint32_t | ketCube_common_Max32 (uint32_t *values, uint32_t size) |
Return max from an array of ints. More... | |
static uint32_t | ketCube_common_Min32 (uint32_t *values, uint32_t size) |
Return max from an array of ints. More... | |
static uint16_t | ketCube_common_Avg (uint16_t *values, uint16_t size) |
Return median from an array of shorts. More... | |
static uint16_t | ketCube_common_swapW (uint16_t n) |
Swap word (16-bit) values. More... | |
static void | ketCube_common_BasicErrorHandler () |
Basic Error Handler. More... | |
Variables | |
char | ketCube_common_buffer [] |
KETCube common definitions.
Developed by: The SmartCampus Team Department of Technologies and Measurement www.smartcampus.cz | www.zcu.cz
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal with the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.