sarmfsw: SMFSW Toolbox (desinged for ARM / compatible with other 8b/16b/32b platforms) 4.0rc
SMFSW collection of miscellaneous functions \& macros (desinged for ARM / compatible with other 8b/16b/32b platforms)
Loading...
Searching...
No Matches
arm_typedefs.h File Reference

ARM common typedefs. More...

#include <stdbool.h>
#include <stdint.h>
Include dependency graph for arm_typedefs.h:
This graph shows which files directly or indirectly include this file:

Data Structures

struct  sBitfield8
 Bitfield 8b. More...
 
struct  sBitfield16
 Bitfield 16b. More...
 
struct  sBitfield32
 Bitfield 32b. More...
 
struct  sBitfield64
 Bitfield 64b. More...
 
union  uByte
 Union for BYTE. More...
 
union  uWord
 Union for WORD. More...
 
union  uDWord
 Union for DWORD. More...
 
union  uLWord
 Union for LWORD. More...
 

Macros

#define __STDBOOL_DEF
 Include stdbool.h.
 
#define __STDINT_DEF
 Include stdint.h.
 

Typedefs

typedef int intCPU_t
 Signed integer typedef.
 
typedef unsigned int uintCPU_t
 Unsigned integer typedef.
 
typedef bool BOOL
 boolean typedef (1bit, for stdbool.h handling compilers)
 
typedef char CHAR
 Char typedef (8bits)
 
typedef uint8_t BYTE
 Unsigned Byte typedef (8bits)
 
typedef uint16_t WORD
 Unsigned Word typedef (16bits)
 
typedef uint32_t DWORD
 Unsigned dWord typedef (32bits)
 
typedef uint64_t LWORD
 Unsigned lWord typedef (64bits)
 
typedef int8_t SBYTE
 Signed Byte typedef (8bits)
 
typedef int16_t SWORD
 Signed Word typedef (16bits)
 
typedef int32_t SDWORD
 Signed dWord typedef (32bits)
 
typedef int64_t SLWORD
 Signed lWord typedef (64bits)
 
typedef struct sBitfield8 sBitfield8
 

Enumerations

enum  eState { Off = 0U , On = 1U }
 Activation state On, Off. More...
 
enum  eEdge { NoEdge = 0 , Rising , Falling }
 Signal Edges. More...
 
enum  eGPIOState { Reset = 0 , Set , Toggle }
 GPIO possible states/actions enumeration. More...
 
enum  eGPIOPull { PullDown = 0 , PullUp , NoPull }
 GPIO possible pull resistor configuration. More...
 

Detailed Description

ARM common typedefs.

Author
SMFSW
Warning
Endianness for unions shall be checked following target / compiler to avoid potential headaches!
sBitfieldXX are defined from lsb to msb as most compiler does by default; if it's not the case, try to find a compiler directive or pragma to reverse bitfield order; if not available, define REVERSE_BITFIELD symbol at project level.
For Arduino platform, some binary.h definitions needs to be undefined. If you find them useful, define USE_INO_BINARY_HEADER before including sarmfsw.h to keep them defined. Please note, B0 & B1 Bytes sub-structures of unions defined hereafter will not be available in this case.
Note
For Arduino platform, prefer ANSI-C(pp) 0b notation for binary representation, instead of using defines from Arduino binary.h
STDBOOL_NDEF can be defined at project level if stdint.h doesn't exist for target compiler
STDINT_NDEF can be defined at project level if stdint.h doesn't exist for target compiler
MISRA C:2012 Deviations

Header scope deviation has been granted for following rules:
Rule-2.3 - Advisory: unused type (misra-c2012-2.3)
Rule-19.2 - Advisory: union keyword (misra-c2012-19.2)
Rule-20.5 - Advisory: #undef (misra-c2012-20.5)

Header scope derogation authorized for:
Rule-5.5 - Required: Identifiers shall be distinct from macro name (misra-c2012-5.5)
Justification: Replacing B0 & B1 macro only for arduino platform.

Rule-21.1 - Required: #define and #undef on reserved identifiers (misra-c2012-21.1)
Justification: #define are library specific reserved identifiers.

Macro Definition Documentation

◆ __STDBOOL_DEF

#define __STDBOOL_DEF

Include stdbool.h.

◆ __STDINT_DEF

#define __STDINT_DEF

Include stdint.h.

Typedef Documentation

◆ BOOL

typedef bool BOOL

boolean typedef (1bit, for stdbool.h handling compilers)

◆ BYTE

typedef uint8_t BYTE

Unsigned Byte typedef (8bits)

◆ CHAR

typedef char CHAR

Char typedef (8bits)

◆ DWORD

typedef uint32_t DWORD

Unsigned dWord typedef (32bits)

◆ intCPU_t

typedef int intCPU_t

Signed integer typedef.

◆ LWORD

typedef uint64_t LWORD

Unsigned lWord typedef (64bits)

◆ sBitfield8

typedef struct sBitfield8 sBitfield8

◆ SBYTE

typedef int8_t SBYTE

Signed Byte typedef (8bits)

◆ SDWORD

typedef int32_t SDWORD

Signed dWord typedef (32bits)

◆ SLWORD

typedef int64_t SLWORD

Signed lWord typedef (64bits)

◆ SWORD

typedef int16_t SWORD

Signed Word typedef (16bits)

◆ uintCPU_t

typedef unsigned int uintCPU_t

Unsigned integer typedef.

◆ WORD

typedef uint16_t WORD

Unsigned Word typedef (16bits)

Enumeration Type Documentation

◆ eEdge

enum eEdge

Signal Edges.

Enumerator
NoEdge 

No change.

Rising 

Rising edge.

Falling 

Falling edge.

◆ eGPIOPull

enum eGPIOPull

GPIO possible pull resistor configuration.

Enumerator
PullDown 

GPIO with pull down.

PullUp 

GPIO with pull up.

NoPull 

GPIO without pull.

◆ eGPIOState

enum eGPIOState

GPIO possible states/actions enumeration.

Enumerator
Reset 

Reset State.

Set 

Set State.

Toggle 

Toggle Output

Note
Toggle is only GPIO output related

◆ eState

enum eState

Activation state On, Off.

Enumerator
Off 

Off / Reset.

On 

On / Set.