cpu/stm32/periph: Use uintptr_t for periph addr
The peripheral register addresses are fixed, properly aligned addresses. Storing them as uintptr_t makes live easier when casting them to helper structs, as no intermediate cast to uintptr_t is needed to silence -Wcast-align.
This commit is contained in:
parent
c9eb0ae3de
commit
7cd9d615fa
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = {
|
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = {
|
||||||
{
|
{
|
||||||
.periph = (uint8_t *)USB_OTG_FS_PERIPH_BASE,
|
.periph = USB_OTG_FS_PERIPH_BASE,
|
||||||
.rcc_mask = RCC_AHB2ENR_OTGFSEN,
|
.rcc_mask = RCC_AHB2ENR_OTGFSEN,
|
||||||
.phy = STM32_USB_OTG_PHY_BUILTIN,
|
.phy = STM32_USB_OTG_PHY_BUILTIN,
|
||||||
.type = STM32_USB_OTG_FS,
|
.type = STM32_USB_OTG_FS,
|
||||||
|
|||||||
@ -36,7 +36,7 @@ extern "C" {
|
|||||||
*/
|
*/
|
||||||
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = {
|
static const stm32_usb_otg_fshs_config_t stm32_usb_otg_fshs_config[] = {
|
||||||
{
|
{
|
||||||
.periph = (uint8_t *)USB_OTG_HS_PERIPH_BASE,
|
.periph = USB_OTG_HS_PERIPH_BASE,
|
||||||
.rcc_mask = RCC_AHB1ENR_OTGHSEN,
|
.rcc_mask = RCC_AHB1ENR_OTGHSEN,
|
||||||
.phy = STM32_USB_OTG_PHY_BUILTIN,
|
.phy = STM32_USB_OTG_PHY_BUILTIN,
|
||||||
.type = STM32_USB_OTG_HS,
|
.type = STM32_USB_OTG_HS,
|
||||||
|
|||||||
@ -821,7 +821,7 @@ typedef enum {
|
|||||||
* @brief stm32 USB OTG configuration
|
* @brief stm32 USB OTG configuration
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint8_t *periph; /**< USB peripheral base address */
|
uintptr_t periph; /**< USB peripheral base address */
|
||||||
uint32_t rcc_mask; /**< bit in clock enable register */
|
uint32_t rcc_mask; /**< bit in clock enable register */
|
||||||
stm32_usb_otg_fshs_phy_t phy; /**< Built-in or ULPI phy */
|
stm32_usb_otg_fshs_phy_t phy; /**< Built-in or ULPI phy */
|
||||||
stm32_usb_otg_fshs_type_t type; /**< FS or HS type */
|
stm32_usb_otg_fshs_type_t type; /**< FS or HS type */
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user