/*****************************************************************************/ /* FILENAME : system.h */ /* */ /* DESCRIPTION : System Level API Handling for Application */ /* */ /* NOTES : Copyright Sathish Kumar P. All rights reserved. */ /* */ /* AUTHOR : Sathish Kumar */ /* sathishembeddedgeek@gmail.com */ /* */ /* START DATE : 9th Feb 2020 */ /* */ /* VERSION DATE WHO DETAIL */ /* 00.00.01 09FEB20 Sathish Kumar initial version */ /* */ /*****************************************************************************/ #ifndef __SYSTEM_H__ #define __SYSTEM_H__ /*****************************************************************************/ /* */ /* I N C L U D E S */ /* */ /*****************************************************************************/ #include #include #include #include #include "fes_common_lib_version.h" #include /*****************************************************************************/ /* */ /* D E F I N I T I O N S */ /* */ /*****************************************************************************/ #define RTOS_DELAY(ms) osDelay(ms) #define DELAY_MS(ms) HAL_Delay(ms) #define LITTLE_ENDIAN_CONV_U32_U8(u32_var,u8_arr) { \ u8_arr[0] = (uint8_t)(((uint32_t)u32_var&0xFF000000)>>24); \ u8_arr[1] = (uint8_t)(((uint32_t)u32_var&0x00FF0000)>>16); \ u8_arr[2] = (uint8_t)(((uint32_t)u32_var&0x0000FF00)>>8); \ u8_arr[3] = (uint8_t)((uint32_t)u32_var&0xFF); \ } #define LITTLE_ENDIAN_CONV_U8_U32(u8_arr,u32_var) { \ u32_var = (uint32_t)(u8_arr[0]<<24)|(u8_arr[1]<<16)|(u8_arr[2]<<8)|(u8_arr[3]); \ } /*** static assert helper macro */ #define STATIC_ASSERT(test) typedef char assertion_on_mystruct[( !!(test) )*2-1 ] /*****************************************************************************/ /* */ /* C O N S T A N T S & V A R I A B L E S */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* */ /* F U N C T I O N P R O T O T Y P E S */ /* */ /*****************************************************************************/ /*****************************************************************************/ /* */ /* E N D O F F I L E */ /* */ /*****************************************************************************/ #endif /* END OF __SYSTEM_H__ */