STM32 Blue Pill Drivers
Drivers that could be used to interface and interact with STM32F103C8T6 Microcontroller
Loading...
Searching...
No Matches
Hardware registers macro-functions

These macro-functions help in mapping and accessing the hardware registers. More...

+ Collaboration diagram for Hardware registers macro-functions:

Macros

#define REGISTER_ADDRESS(ADDRESS, OFFSET)   ((ADDRESS) + (OFFSET))
 Placeholder for declaring a register address. More...
 
#define REGISTER(REG_TYPE, ADDRESS)   (*(VOLATILE P2VAR(REG_TYPE))(ADDRESS))
 Map to a certain register by its address in the memory. More...
 
#define REGISTER_U8(ADDRESS)   REGISTER(t_u8, ADDRESS)
 Map to a certain register by its 8-bit address in the memory (used for 8-bit registers) More...
 
#define REGISTER_U16(ADDRESS)   REGISTER(t_u16, ADDRESS)
 Map to a certain register by its 16-bit address in the memory (used for 16-bit registers) More...
 
#define REGISTER_U32(ADDRESS)   REGISTER(t_u32, ADDRESS)
 Map to a certain register by its 32-bit address in the memory (used for 32-bit registers) More...
 

Detailed Description

These macro-functions help in mapping and accessing the hardware registers.

Macro Definition Documentation

◆ REGISTER_ADDRESS

#define REGISTER_ADDRESS (   ADDRESS,
  OFFSET 
)    ((ADDRESS) + (OFFSET))

#include <LIB/LSTD_HW_REGS.h>

Placeholder for declaring a register address.

Parameters
[in]ADDRESSThe address of the register
[in]OFFSETThe offset of the register
Returns
The final address of the register

◆ REGISTER

#define REGISTER (   REG_TYPE,
  ADDRESS 
)    (*(VOLATILE P2VAR(REG_TYPE))(ADDRESS))

#include <LIB/LSTD_HW_REGS.h>

Map to a certain register by its address in the memory.

Parameters
[in]ADDRESSThe address of the register
[in]REG_TYPEThe type of the register
Note
REG_TYPE can be a standard type (e.g. t_u8, t_u16, t_u32, ...) or a user-defined type
Returns
The value of the register
See also
Standard data types

◆ REGISTER_U8

#define REGISTER_U8 (   ADDRESS)    REGISTER(t_u8, ADDRESS)

#include <LIB/LSTD_HW_REGS.h>

Map to a certain register by its 8-bit address in the memory (used for 8-bit registers)

Parameters
[in]ADDRESSThe address of the register
Returns
The value of the register

◆ REGISTER_U16

#define REGISTER_U16 (   ADDRESS)    REGISTER(t_u16, ADDRESS)

#include <LIB/LSTD_HW_REGS.h>

Map to a certain register by its 16-bit address in the memory (used for 16-bit registers)

Parameters
[in]ADDRESSThe address of the register
Returns
The value of the register

◆ REGISTER_U32

#define REGISTER_U32 (   ADDRESS)    REGISTER(t_u32, ADDRESS)

#include <LIB/LSTD_HW_REGS.h>

Map to a certain register by its 32-bit address in the memory (used for 32-bit registers)

Parameters
[in]ADDRESSThe address of the register
Returns
The value of the register