Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of d7a_1x by
d7a_common.h
00001 #ifndef _D7A_COMMON_H_ 00002 #define _D7A_COMMON_H_ 00003 00004 #define TYPEDEF_STRUCT_PACKED typedef struct __attribute__((packed)) 00005 00006 /* 00007 typedef uint8_t u8; 00008 typedef uint16_t u16; 00009 typedef uint32_t u32; 00010 typedef int8_t s8; 00011 typedef int16_t s16; 00012 typedef int32_t s32; 00013 */ 00014 00015 #define HAL_U16_B0(a) ((uint8_t)(((uint16_t)(a) >> 0) & 0xFF)) 00016 #define HAL_U16_B1(a) ((uint8_t)(((uint16_t)(a) >> 8) & 0xFF)) 00017 #define HAL_U16_LO(a) ((uint8_t)((a) >> 0)) 00018 #define HAL_U16_HI(a) ((uint8_t)((a) >> 8)) 00019 #define HAL_TO_U16(a,b) ((uint16_t)((uint16_t)(a) << 8)|(uint16_t)(b)) 00020 #define HAL_TO_U32(a,b,c,d) ((uint32_t)((uint32_t)(a) <<24)|((uint32_t)(b) <<16)|((uint32_t)(c) << 8)|(uint32_t)(d)) 00021 #define HAL_U32_LO(a) ((uint16_t)((a) >> 0)) 00022 #define HAL_U32_HI(a) ((uint16_t)((a) >> 16)) 00023 #define HAL_U32_B0(a) ((uint8_t)(((uint32_t)(a) >> 0) & 0xFF)) 00024 #define HAL_U32_B1(a) ((uint8_t)(((uint32_t)(a) >> 8) & 0xFF)) 00025 #define HAL_U32_B2(a) ((uint8_t)(((uint32_t)(a) >> 16) & 0xFF)) 00026 #define HAL_U32_B3(a) ((uint8_t)(((uint32_t)(a) >> 24) & 0xFF)) 00027 // This should generate a REV instruction 00028 #define HAL_U32_BYTE_SWAP(a) ( (((a) & 0x000000ff) << 24) | \ 00029 (((a) & 0x0000ff00) << 8) | \ 00030 (((a) & 0x00ff0000) >> 8) | \ 00031 (((a) & 0xff000000) >> 24)) 00032 00033 00034 #endif
Generated on Sun Jul 17 2022 09:41:51 by
1.7.2
