我是靠谱客的博主 靓丽煎饼,最近开发中收集的这篇文章主要介绍type.h,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

#ifndef _TYPEFEF_H
#define _TYPEFEF_H

#include <config.h>
#include <inttypes.h>

typedef char S8; /* signed 8-bit integer /
typedef short S16; /
signed 16-bit integer /
typedef long S32; /
signed 32-bit integer /
typedef unsigned char U8; /
unsigned 8-bit integer /
typedef unsigned short U16; /
unsigned 16-bit integer /
typedef unsigned long U32; /
unsigned 32-bit integer */

typedef char s8; /* signed 8-bit integer /
typedef short s16; /
signed 16-bit integer /
typedef long s32; /
signed 32-bit integer /
typedef uint8_t u8; /
unsigned 8-bit integer /
typedef uint16_t u16; /
unsigned 16-bit integer /
typedef uint32_t u32; /
unsigned 32-bit integer /
typedef uint64_t u64; /
unsigned 32-bit integer */

typedef volatile U32 * RP;
typedef volatile U16 * RP16;
typedef volatile U8 * RP8;

#define __STATIC_INLINE static inline

#define write_reg(reg, data)
*(RP)(reg) = data
#define read_reg(reg)
*(RP)(reg)

#define write_byte(reg, data)
*(RP8)(reg) = data

#define read_byte(reg)
*(RP8)(reg)

#define write_halfword(reg, data)
*(RP16)(reg) = data
#define read_halfword(reg)
*(RP16)(reg)

#ifdef __cplusplus
#define __I volatile /*!< Defines ‘read only’ permissions /
#else
#define __I volatile const /
!< Defines ‘read only’ permissions /
#endif
#define __O volatile /
!< Defines ‘write only’ permissions /
#define __IO volatile /
!< Defines ‘read / write’ permissions */

/* following defines should be used for structure members /
#define __IM volatile const /
! Defines ‘read only’ structure member permissions /
#define __OM volatile /
! Defines ‘write only’ structure member permissions /
#define __IOM volatile /
! Defines ‘read / write’ structure member permissions */

#endif /TYPEFEF_H_/

最后

以上就是靓丽煎饼为你收集整理的type.h的全部内容,希望文章能够帮你解决type.h所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部