Go to the documentation of this file.
15 #include "stm32h7xx_hal.h"
20 #define UUID_ADDRESS (0x1FF1E800)
21 #define UUID_SIZE (12)
23 #define PV_COM (USART3)
24 #define PV_COM_ALT (GPIO_AF7_USART3)
25 #define PV_COM_IRQn (USART3_IRQn)
26 #define PV_COM_TX_Pin (GPIO_PIN_8)
27 #define PV_COM_TX_GPIO_Port (GPIOD)
28 #define PV_COM_RX_Pin (GPIO_PIN_9)
29 #define PV_COM_RX_GPIO_Port (GPIOD)
54 RCC_OscInitStruct.
PLL.
PLLN = 110;
86 return (
const uint8_t *)
uuid;
109 PeriphClkInitStruct.Sai4AClockSelection = RCC_SAI4ACLKSOURCE_PLL2;
125 MPU_Region_InitTypeDef MPU_InitStruct = {0};
127 MPU_InitStruct.Enable = MPU_REGION_ENABLE;
128 MPU_InitStruct.Number = MPU_REGION_NUMBER0;
129 MPU_InitStruct.BaseAddress = 0x24000000;
130 MPU_InitStruct.Size = MPU_REGION_SIZE_512KB;
131 MPU_InitStruct.SubRegionDisable = 0x0;
132 MPU_InitStruct.TypeExtField = MPU_TEX_LEVEL0;
133 MPU_InitStruct.AccessPermission = MPU_REGION_FULL_ACCESS;
134 MPU_InitStruct.DisableExec = MPU_INSTRUCTION_ACCESS_ENABLE;
135 MPU_InitStruct.IsShareable = MPU_ACCESS_NOT_SHAREABLE;
136 MPU_InitStruct.IsCacheable = MPU_ACCESS_CACHEABLE;
137 MPU_InitStruct.IsBufferable = MPU_ACCESS_NOT_BUFFERABLE;
139 HAL_MPU_ConfigRegion(&MPU_InitStruct);
141 MPU_InitStruct.Number = MPU_REGION_NUMBER1;
142 MPU_InitStruct.BaseAddress = 0x38000000;
143 MPU_InitStruct.Size = MPU_REGION_SIZE_16KB;
144 MPU_InitStruct.IsCacheable = MPU_ACCESS_NOT_CACHEABLE;
146 HAL_MPU_ConfigRegion(&MPU_InitStruct);
147 HAL_MPU_Enable(MPU_PRIVILEGED_DEFAULT);
#define __HAL_RCC_PLL_PLLSOURCE_CONFIG(__PLLSOURCE__)
Macro to configure the PLL clock source.
#define __HAL_PWR_GET_FLAG(__FLAG__)
Check PWR flag is set or not.
#define UART_TXFIFO_THRESHOLD_1_8
void HAL_NVIC_EnableIRQ(IRQn_Type IRQn)
HAL_StatusTypeDef HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout)
@ PV_STATUS_INVALID_STATE
HAL_StatusTypeDef HAL_UARTEx_DisableFifoMode(UART_HandleTypeDef *huart)
GPIO Init structure definition
RCC System, AHB and APB busses clock configuration structure definition.
RCC Internal/External Oscillator (HSE, HSI, LSE and LSI) configuration structure definition.
#define UART_RXFIFO_THRESHOLD_1_8
__STATIC_FORCEINLINE void __disable_irq(void)
Disable IRQ Interrupts.
#define __HAL_RCC_USART3_CLK_ENABLE()
uint32_t PeriphClockSelection
#define GPIO_SPEED_FREQ_LOW
UART handle Structure definition.
#define __HAL_RCC_GPIOE_CLK_ENABLE()
#define RCC_PLL2VCOMEDIUM
static pv_status_t pv_clock_config(void)
static void PeriphCommonClock_Config(void)
HAL_StatusTypeDef HAL_PWREx_ConfigSupply(uint32_t SupplySource)
static void MX_GPIO_Init(void)
__STATIC_FORCEINLINE void SCB_EnableICache(void)
Enable I-Cache.
#define RCC_SYSCLKSOURCE_PLLCLK
#define __HAL_RCC_GPIOD_CLK_ENABLE()
#define UART_HWCONTROL_NONE
#define RCC_SAI1CLKSOURCE_PLL2
void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
void pv_error_handler(void)
static uint8_t uuid[UUID_SIZE]
#define RCC_CLOCKTYPE_PCLK1
HAL_StatusTypeDef HAL_RCC_ClockConfig(RCC_ClkInitTypeDef *RCC_ClkInitStruct, uint32_t FLatency)
#define RCC_CLOCKTYPE_D3PCLK1
HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart)
HAL_StatusTypeDef HAL_RCC_OscConfig(RCC_OscInitTypeDef *RCC_OscInitStruct)
pv_status_t pv_message_init(void)
#define __HAL_RCC_SYSCFG_CLK_ENABLE()
#define RCC_CLOCKTYPE_PCLK2
const uint32_t pv_get_uuid_size(void)
#define UART_WORDLENGTH_8B
#define RCC_PLLSOURCE_HSE
#define RCC_CLOCKTYPE_SYSCLK
const uint8_t * pv_get_uuid(void)
void assert_failed(uint8_t *file, uint32_t line)
HAL_StatusTypeDef HAL_Init(void)
This function is used to initialize the HAL Library; it must be the first instruction to be executed ...
static void MPU_Config(void)
#define RCC_CLOCKTYPE_HCLK
__STATIC_FORCEINLINE void SCB_EnableDCache(void)
Enable D-Cache.
#define RCC_PERIPHCLK_SAI1
static void CPU_CACHE_Enable(void)
pv_status_t pv_board_init()
HAL_StatusTypeDef HAL_RCCEx_PeriphCLKConfig(RCC_PeriphCLKInitTypeDef *PeriphClkInit)
#define RCC_PLL1VCIRANGE_2
#define PWR_REGULATOR_VOLTAGE_SCALE0
uint32_t Sai1ClockSelection
#define UART_OVERSAMPLING_16
#define RCC_PLL2VCIRANGE_0
#define RCC_OSCILLATORTYPE_HSE
void HAL_NVIC_SetPriority(IRQn_Type IRQn, uint32_t PreemptPriority, uint32_t SubPriority)
#define RCC_CLOCKTYPE_D1PCLK1
RCC extended clocks structure definition.
HAL_StatusTypeDef HAL_UARTEx_SetTxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold)
void HAL_EnableCompensationCell(void)
Enables the I/O Compensation Cell.
HAL_StatusTypeDef HAL_UARTEx_SetRxFifoThreshold(UART_HandleTypeDef *huart, uint32_t Threshold)
#define __HAL_RCC_CSI_ENABLE()
Macros to enable or disable the Internal oscillator (CSI).
#define PV_COM_TX_GPIO_Port
#define __HAL_RCC_GPIOH_CLK_ENABLE()
#define __HAL_PWR_VOLTAGESCALING_CONFIG(__REGULATOR__)
macros configure the main internal regulator output voltage.
static pv_status_t pv_uart_init(void)