Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
software:c:registries [2016/03/02 08:56] – created feur | software:c:registries [2018/01/31 14:39] (current) – [CT Board Registers] ruan | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | To access the registries | + | To access the registers |
- | A pointer of this type then points to the registry's physical address. \\ \\ | + | A pointer of this type then points to the register's physical address. \\ \\ |
- | * The [[# | + | * The [[# |
- | * The [[# | + | * The [[# |
\\ | \\ | ||
Line 22: | Line 22: | ||
\\ {{type_union.svg}} \\ \\ | \\ {{type_union.svg}} \\ \\ | ||
- | ===== STM32F429 Registries | + | ===== STM32F429ZI Registers |
+ | |||
+ | Below is the definition of the [[stm32: | ||
+ | |||
+ | <code c> | ||
+ | volatile uint32_t MODER; | ||
+ | volatile uint32_t OTYPER; | ||
+ | volatile uint32_t OSPEEDR; | ||
+ | volatile uint32_t PUPDR; | ||
+ | volatile uint32_t IDR; /**< Input data register. */ | ||
+ | volatile uint32_t ODR; /**< output data register. */ | ||
+ | volatile uint16_t BSRR[2]; | ||
+ | [1]: Bit reset register. */ | ||
+ | volatile uint32_t LCKR; / | ||
+ | volatile uint32_t AFR[2]; | ||
+ | [1]: Alternate Function register pin 8..15. */ | ||
+ | } reg_gpio_t; | ||
+ | |||
+ | #define GPIOA | ||
+ | #define GPIOB | ||
+ | #define GPIOC | ||
+ | #define GPIOD | ||
+ | #define GPIOE | ||
+ | #define GPIOF | ||
+ | #define GPIOG | ||
+ | #define GPIOH | ||
+ | #define GPIOI | ||
+ | #define GPIOJ | ||
+ | #define GPIOK | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | The GPIO register is mapped to the data type '' | ||
+ | For every GPIO port exists a macro, which is simply a pointer of the type '' | ||
+ | For convenience there is a special operator ''< | ||
+ | <code c> | ||
+ | GPIOA-> | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | ===== CT Board Registers ===== | ||
+ | |||
+ | The registers of the STM32F429ZI are mostly for configuration purposes, while the registers of the CT Board are mostly holding some kind of data. The data in the CT Board registers can be accessed using different widths, eg. '' | ||
+ | |||
+ | \\ {{type_combined.svg}} \\ \\ | ||
+ | |||
+ | Below is the definition of the [[ctboard: | ||
+ | |||
+ | <code c> | ||
+ | struct { | ||
+ | volatile uint8_t S7_0; /**< Switch 7..0. */ | ||
+ | volatile uint8_t S15_8; | ||
+ | volatile uint8_t S23_16; | ||
+ | volatile uint8_t S31_24; | ||
+ | } BYTE; | ||
+ | struct { | ||
+ | volatile uint16_t S15_0; | ||
+ | volatile uint16_t S31_16; | ||
+ | } HWORD; | ||
+ | volatile uint32_t WORD; / | ||
+ | } reg_ct_dipsw_t; | ||
+ | |||
+ | #define CT_DIPSW | ||
+ | </ | ||
+ | \\ | ||
+ | |||
+ | The CT_DIPSW register can be accessed using either '' | ||
+ | |||
+ | <code c> | ||
+ | uint8_t data_byte = CT_DIPSW-> | ||
+ | uint16_t data_halfword = CT_DIPSW-> | ||
+ | uint32_t data_word = CT_DIPSW-> | ||
+ | </ |