本文整理汇总了C++中HAL_DMA_DeInit函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_DMA_DeInit函数的具体用法?C++ HAL_DMA_DeInit怎么用?C++ HAL_DMA_DeInit使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_DMA_DeInit函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: HAL_I2C_MspDeInit
void HAL_I2C_MspDeInit(I2C_HandleTypeDef* hi2c)
{
if(hi2c->Instance==I2C1)
{
/* USER CODE BEGIN I2C1_MspDeInit 0 */
/* USER CODE END I2C1_MspDeInit 0 */
/* Peripheral clock disable */
__I2C1_CLK_DISABLE();
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_6|GPIO_PIN_7);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(hi2c->hdmarx);
HAL_DMA_DeInit(hi2c->hdmatx);
/* USER CODE BEGIN I2C1_MspDeInit 1 */
/* USER CODE END I2C1_MspDeInit 1 */
}
}
示例2: HAL_UART_MspDeInit
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
if(huart->Instance==USART6)
{
/* USER CODE BEGIN USART6_MspDeInit 0 */
/* USER CODE END USART6_MspDeInit 0 */
/* Peripheral clock disable */
__USART6_CLK_DISABLE();
/**USART6 GPIO Configuration
PC6 ------> USART6_TX
PC7 ------> USART6_RX
*/
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_6|GPIO_PIN_7);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(huart->hdmarx);
HAL_DMA_DeInit(huart->hdmatx);
/* Peripheral interrupt Deinit*/
HAL_NVIC_DisableIRQ(USART6_IRQn);
}
/* USER CODE BEGIN USART6_MspDeInit 1 */
/* USER CODE END USART6_MspDeInit 1 */
}
示例3: HAL_UART_MspDeInit
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
if(huart->Instance==USART3)
{
/* USER CODE BEGIN USART3_MspDeInit 0 */
/* USER CODE END USART3_MspDeInit 0 */
/* Peripheral clock disable */
__USART3_CLK_DISABLE();
/**USART3 GPIO Configuration
PB10 ------> USART3_TX
PB11 ------> USART3_RX
PB13 ------> USART3_CTS
PB14 ------> USART3_RTS
*/
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_10|GPIO_PIN_11|GPIO_PIN_13|GPIO_PIN_14);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(huart->hdmarx);
HAL_DMA_DeInit(huart->hdmatx);
/* Peripheral interrupt Deinit*/
HAL_NVIC_DisableIRQ(USART3_IRQn);
}
/* USER CODE BEGIN USART3_MspDeInit 1 */
/* USER CODE END USART3_MspDeInit 1 */
}
示例4: HAL_SD_MspDeInit
void HAL_SD_MspDeInit(SD_HandleTypeDef* hsd)
{
if(hsd->Instance==SDIO)
{
/* USER CODE BEGIN SDIO_MspDeInit 0 */
/* USER CODE END SDIO_MspDeInit 0 */
/* Peripheral clock disable */
__SDIO_CLK_DISABLE();
/**SDIO GPIO Configuration
PC12 ------> SDIO_CK
PC11 ------> SDIO_D3
PC10 ------> SDIO_D2
PD2 ------> SDIO_CMD
PC9 ------> SDIO_D1
PC8 ------> SDIO_D0
*/
HAL_GPIO_DeInit(GPIOC, GPIO_PIN_12|GPIO_PIN_11|GPIO_PIN_10|GPIO_PIN_9
|GPIO_PIN_8);
HAL_GPIO_DeInit(GPIOD, GPIO_PIN_2);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(hsd->hdmarx);
HAL_DMA_DeInit(hsd->hdmatx);
/* USER CODE BEGIN SDIO_MspDeInit 1 */
/* USER CODE END SDIO_MspDeInit 1 */
}
}
示例5: HAL_UART_MspDeInit
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
if(huart->Instance==USART2)
{
/* USER CODE BEGIN USART2_MspDeInit 0 */
/* USER CODE END USART2_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_USART2_CLK_DISABLE();
/**USART2 GPIO Configuration
PA2 ------> USART2_TX
PA3 ------> USART2_RX
*/
HAL_GPIO_DeInit(GPIOA, UART_TX_Pin|UART_RX_Pin);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(huart->hdmarx);
HAL_DMA_DeInit(huart->hdmatx);
/* Peripheral interrupt DeInit*/
HAL_NVIC_DisableIRQ(USART2_IRQn);
}
/* USER CODE BEGIN USART2_MspDeInit 1 */
/* USER CODE END USART2_MspDeInit 1 */
}
示例6: HAL_SPI_MspDeInit
/**
* @brief SPI MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO, DMA and NVIC configuration to their default state
* @param hspi: SPI handle pointer
* @retval None
*/
void HAL_SPI_MspDeInit(SPI_HandleTypeDef *hspi)
{
if(hspi->Instance == SPIx)
{
/*##-1- Reset peripherals ##################################################*/
SPIx_FORCE_RESET();
SPIx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks ################################*/
/* Deconfigure SPI SCK */
HAL_GPIO_DeInit(SPIx_SCK_GPIO_PORT, SPIx_SCK_PIN);
/* Deconfigure SPI MISO */
HAL_GPIO_DeInit(SPIx_MISO_GPIO_PORT, SPIx_MISO_PIN);
/* Deconfigure SPI MOSI */
HAL_GPIO_DeInit(SPIx_MOSI_GPIO_PORT, SPIx_MOSI_PIN);
/*##-3- Disable the DMA ####################################################*/
/* De-Initialize the DMA associated to transmission process */
HAL_DMA_DeInit(&hdma_tx);
/* De-Initialize the DMA associated to reception process */
HAL_DMA_DeInit(&hdma_rx);
/*##-4- Disable the NVIC for DMA ###########################################*/
HAL_NVIC_DisableIRQ(SPIx_DMA_TX_IRQn);
HAL_NVIC_DisableIRQ(SPIx_DMA_RX_IRQn);
}
}
示例7: adcSetResolution
void adcSetResolution (uint8_t res){
samplingDisable();
HAL_ADC_Stop_DMA(&hadc1);
HAL_ADC_Stop_DMA(&hadc2);
HAL_ADC_Stop_DMA(&hadc3);
if(res==8){
ADCResolution = ADC_RESOLUTION8b;
}else if(res==12){
ADCResolution = ADC_RESOLUTION12b;
}else{
return;
}
HAL_ADC_DeInit(&hadc1);
HAL_ADC_DeInit(&hadc2);
HAL_ADC_DeInit(&hadc3);
HAL_DMA_DeInit(&hdma_adc1);
HAL_DMA_DeInit(&hdma_adc2);
HAL_DMA_DeInit(&hdma_adc3);
MX_ADC1_Init();
MX_ADC2_Init();
MX_ADC3_Init();
}
示例8: HAL_UART_MspDeInit
/**
* @brief UART MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO, DMA and NVIC configuration to their default state
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
{
/*##-1- Reset peripherals ##################################################*/
USARTx_FORCE_RESET();
USARTx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks #################################*/
/* Configure USARTx Tx as alternate function */
HAL_GPIO_DeInit(USARTx_TX_GPIO_PORT, USARTx_TX_PIN);
/* Configure USARTx Rx as alternate function */
HAL_GPIO_DeInit(USARTx_RX_GPIO_PORT, USARTx_RX_PIN);
/*##-3- Disable the DMA #####################################################*/
/* De-Initialize the DMA channel associated to reception process */
if(huart->hdmarx != 0)
{
HAL_DMA_DeInit(huart->hdmarx);
}
/* De-Initialize the DMA channel associated to transmission process */
if(huart->hdmatx != 0)
{
HAL_DMA_DeInit(huart->hdmatx);
}
/*##-4- Disable the NVIC for DMA ###########################################*/
HAL_NVIC_DisableIRQ(USARTx_DMA_TX_IRQn);
HAL_NVIC_DisableIRQ(USARTx_DMA_RX_IRQn);
}
示例9: HAL_UART_MspDeInit
/**
* @brief UART MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO and NVIC configuration to their default state
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
{
if( huart == &UartHandle ){
USARTx_FORCE_RESET();
USARTx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks ################################*/
/* Configure UART Tx as alternate function */
HAL_GPIO_DeInit(USARTx_TX_GPIO_PORT, USARTx_TX_PIN);
/* Configure UART Rx as alternate function */
HAL_GPIO_DeInit(USARTx_RX_GPIO_PORT, USARTx_RX_PIN);
/*##-3- Disable the DMA Streams ############################################*/
/* De-Initialize the DMA Stream associate to transmission process */
HAL_DMA_DeInit(&hdma_tx);
/* De-Initialize the DMA Stream associate to reception process */
HAL_DMA_DeInit(&hdma_rx);
/*##-3- Disable the NVIC for UART ##########################################*/
/*##-4- Configure the NVIC for DMA #########################################*/
/* NVIC configuration for DMA transfer complete interrupt (USARTx_TX) */
HAL_NVIC_DisableIRQ(USARTx_DMA_TX_IRQn);
HAL_NVIC_DisableIRQ(USARTx_DMA_RX_IRQn);
HAL_NVIC_DisableIRQ(USARTx_IRQn);
}
}
示例10: HAL_I2C_MspDeInit
void HAL_I2C_MspDeInit(I2C_HandleTypeDef* i2cHandle)
{
if(i2cHandle->Instance==I2C1)
{
/* USER CODE BEGIN I2C1_MspDeInit 0 */
/* USER CODE END I2C1_MspDeInit 0 */
/* Peripheral clock disable */
__HAL_RCC_I2C1_CLK_DISABLE();
/**I2C1 GPIO Configuration
PB6 ------> I2C1_SCL
PB7 ------> I2C1_SDA
*/
HAL_GPIO_DeInit(GPIOB, FG_SCL_Pin|FG_SCA_Pin);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(i2cHandle->hdmarx);
HAL_DMA_DeInit(i2cHandle->hdmatx);
}
/* USER CODE BEGIN I2C1_MspDeInit 1 */
/* USER CODE END I2C1_MspDeInit 1 */
}
示例11: HAL_I2C_MspDeInit
/**
* @brief I2C MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO, DMA and NVIC configuration to their default state
* @param hi2c: I2C handle pointer
* @retval None
*/
void HAL_I2C_MspDeInit(I2C_HandleTypeDef *hi2c)
{
static DMA_HandleTypeDef hdma_tx;
static DMA_HandleTypeDef hdma_rx;
/*##-1- Reset peripherals ##################################################*/
I2Cx_FORCE_RESET();
I2Cx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks ################################*/
/* Configure I2C Tx as alternate function */
HAL_GPIO_DeInit(I2Cx_SCL_GPIO_PORT, I2Cx_SCL_PIN);
/* Configure I2C Rx as alternate function */
HAL_GPIO_DeInit(I2Cx_SDA_GPIO_PORT, I2Cx_SDA_PIN);
/*##-3- Disable the DMA Streams ############################################*/
/* De-Initialize the DMA Stream associate to transmission process */
HAL_DMA_DeInit(&hdma_tx);
/* De-Initialize the DMA Stream associate to reception process */
HAL_DMA_DeInit(&hdma_rx);
/*##-4- Disable the NVIC for DMA ###########################################*/
HAL_NVIC_DisableIRQ(I2Cx_DMA_TX_IRQn);
HAL_NVIC_DisableIRQ(I2Cx_DMA_RX_IRQn);
}
示例12: HAL_UART_MspDeInit
/**
* @brief UART MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO, DMA and NVIC configuration to their default state
* @param huart: UART handle pointer
* @retval None
*/
void HAL_UART_MspDeInit(UART_HandleTypeDef *huart)
{
static DMA_HandleTypeDef hdma_tx;
static DMA_HandleTypeDef hdma_rx;
/*##-1- Reset peripherals ##################################################*/
USARTx_FORCE_RESET();
USARTx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks #################################*/
/* Configure UART Tx as alternate function */
HAL_GPIO_DeInit(USARTx_TX_GPIO_PORT, USARTx_TX_PIN);
/* Configure UART Rx as alternate function */
HAL_GPIO_DeInit(USARTx_RX_GPIO_PORT, USARTx_RX_PIN);
/*##-3- Disable the DMA Streams ############################################*/
/* De-Initialize the DMA Stream associate to transmission process */
HAL_DMA_DeInit(&hdma_tx);
/* De-Initialize the DMA Stream associate to reception process */
HAL_DMA_DeInit(&hdma_rx);
/*##-4- Disable the NVIC for DMA ###########################################*/
HAL_NVIC_DisableIRQ(USARTx_DMA_TX_IRQn);
HAL_NVIC_DisableIRQ(USARTx_DMA_RX_IRQn);
}
示例13: BSP_SD_MspDeInit
/**
* @brief DeInitializes the SD MSP.
* @param hsd: SD handle
* @retval None
*/
__weak void BSP_SD_MspDeInit(SD_HandleTypeDef *hsd, void *Params)
{
static DMA_HandleTypeDef dma_rx_handle;
static DMA_HandleTypeDef dma_tx_handle;
/* Disable NVIC for DMA transfer complete interrupts */
HAL_NVIC_DisableIRQ(SD_DMAx_Rx_IRQn);
HAL_NVIC_DisableIRQ(SD_DMAx_Tx_IRQn);
/* Deinitialize the stream for new transfer */
dma_rx_handle.Instance = SD_DMAx_Rx_STREAM;
HAL_DMA_DeInit(&dma_rx_handle);
/* Deinitialize the stream for new transfer */
dma_tx_handle.Instance = SD_DMAx_Tx_STREAM;
HAL_DMA_DeInit(&dma_tx_handle);
/* Disable NVIC for SDIO interrupts */
HAL_NVIC_DisableIRQ(SDIO_IRQn);
/* DeInit GPIO pins can be done in the application
(by surcharging this __weak function) */
/* Disable SDIO clock */
__HAL_RCC_SDIO_CLK_DISABLE();
/* GPIO pins clock and DMA clocks can be shut down in the application
by surcharging this __weak function */
}
示例14: HAL_SPI_MspDeInit
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI1)
{
/* USER CODE BEGIN SPI1_MspDeInit 0 */
/* USER CODE END SPI1_MspDeInit 0 */
/* Peripheral clock disable */
__SPI1_CLK_DISABLE();
/**SPI1 GPIO Configuration
PA4 ------> SPI1_NSS
PA5 ------> SPI1_SCK
PA6 ------> SPI1_MISO
PA7 ------> SPI1_MOSI
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_4|GPIO_PIN_5|GPIO_PIN_6|GPIO_PIN_7);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(hspi->hdmarx);
HAL_DMA_DeInit(hspi->hdmatx);
}
/* USER CODE BEGIN SPI1_MspDeInit 1 */
/* USER CODE END SPI1_MspDeInit 1 */
}
示例15: HAL_SPI_MspDeInit
void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi)
{
if(hspi->Instance==SPI2)
{
/* USER CODE BEGIN SPI2_MspDeInit 0 */
/* USER CODE END SPI2_MspDeInit 0 */
/* Peripheral clock disable */
__SPI2_CLK_DISABLE();
/**SPI2 GPIO Configuration
PB12 ------> SPI2_NSS
PB13 ------> SPI2_SCK
PB14 ------> SPI2_MISO
PB15 ------> SPI2_MOSI
*/
HAL_GPIO_DeInit(GPIOB, GPIO_PIN_12|GPIO_PIN_13|GPIO_PIN_14|GPIO_PIN_15);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(hspi->hdmarx);
HAL_DMA_DeInit(hspi->hdmatx);
}
/* USER CODE BEGIN SPI2_MspDeInit 1 */
/* USER CODE END SPI2_MspDeInit 1 */
}