/*********************************************************************** * * Copyright Diality, Inc. 2019-2020. All Rights Reserved. * 181 Technology, Ste. 150 * Irvine, CA 92618 * * Project Denali * * @file Common.h * * @brief Header file for common definitions and types. * * @date 19-Sep-2019 * *************************************************************************/ #ifndef __COMMON_H__ #define __COMMON_H__ #include "hal_stdtypes.h" // ********** public definitions ********** // *** Types *** typedef float F32; typedef double F64; typedef unsigned long int U32; typedef long int S32; typedef unsigned short U16; typedef short S16; typedef unsigned char U08; typedef unsigned long int BOOL; typedef unsigned char BYTE; typedef enum Pin_Signal_States { PIN_SIGNAL_LOW = 0, PIN_SIGNAL_HIGH, NUM_OF_PIN_SIGNAL_STATES } PIN_SIGNAL_STATE_T; // *** Common Definitions *** #define NEARLY_ZERO 0.00001 #define CAP(v,u) ((v) > (u) ? (u) : (v)) #define RANGE(v,l,u) ((v) > (u) ? (u) : ((v) < (l) ? (l) : (v))) #define MAX(a,b) ((a) < (b) ? (b) : (a)) #define MIN(a,b) ((a) > (b) ? (b) : (a)) #endif