Question
USART DMA: registers
Posted on October 13, 2015 at 10:08
Hi,
Im using STM32F071RB. For SW certification purpose, I need to get rid of libraries and operate at register level. I modified the init function for USART1 RX in DMA mode: HAL_StatusTypeDef HAL_UART_Init(UART_HandleTypeDef *huart) { static DMA_HandleTypeDef hdma_rx; RCC->APB2ENR |= (RCC_APB2ENR_USART1EN); RCC->AHBENR |= (RCC_AHBENR_DMA1EN); UART_GPIO_Config();hdma_rx.Instance = DMA1_Channel3; DMA1_Channel3->CCR |= 0x000020AF;huart->hdmarx = &(hdma_rx);hdma_rx.Parent = huart; HAL_NVIC_SetPriority(DMA1_Channel2_3_IRQn, 0, 0); HAL_NVIC_EnableIRQ(DMA1_Channel2_3_IRQn); USART1->CR1 &= ~USART_CR1_UE; USART1->CR1 = 0x0000000C; USART1->BRR = 0x00000034; USART1->CR3 = 0x00001000; USART1->CR1 |= USART_CR1_UE; return (UART_CheckIdleState(huart)); } This code works, but I cannot ''translate'' the bold lines into register level, because I dont see any effect on DMA1 and USART1 register. What should I search for? Thanks, M. #dma-usart
