本文整理汇总了C++中HAL_NVIC_DisableIRQ函数的典型用法代码示例。如果您正苦于以下问题:C++ HAL_NVIC_DisableIRQ函数的具体用法?C++ HAL_NVIC_DisableIRQ怎么用?C++ HAL_NVIC_DisableIRQ使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了HAL_NVIC_DisableIRQ函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: TIMER_Task
void TIMER_Task(void)
{
tm_sm_e state;
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
state = timer1.state;
if (EXPIRED == state) timer1.state = IDLE;
if (EXPIRED_AUTO == state) timer1.state = RUNNING_AUTO;
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
if (EXPIRED_AUTO == state || EXPIRED == state)
{
EQ_PutEvent(TIMER1_EXPIRED);
}
HAL_NVIC_DisableIRQ(TIM6_DAC_IRQn);
state = timer2.state;
if (EXPIRED == state) timer2.state = IDLE;
if (EXPIRED_AUTO == state) timer2.state = RUNNING_AUTO;
HAL_NVIC_EnableIRQ(TIM6_DAC_IRQn);
if (EXPIRED_AUTO == state || EXPIRED == state)
{
EQ_PutEvent(TIMER2_EXPIRED);
}
}
示例2: 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)
{
/*##-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 NVIC for I2C ###########################################*/
HAL_NVIC_DisableIRQ(I2Cx_IRQn);
}
示例3: HAL_DMA2D_MspDeInit
/**
* @brief DMA2D MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Reset Peripheral
* - Disable the Peripheral's clock
* - Deactivate Peripheral IRQ
* @param hdma2d: DMA2D handle pointer
* @retval None
*/
void HAL_DMA2D_MspDeInit(DMA2D_HandleTypeDef *hdma2d)
{
/*##-1- Reset peripherals ##################################################*/
/* Enable DMA2D reset state */
__HAL_RCC_DMA2D_FORCE_RESET();
/* Release DMA2D from reset state */
__HAL_RCC_DMA2D_RELEASE_RESET();
/* ##-2- Disable DMA2D Clock ##################################################*/
__HAL_RCC_DMA2D_CLK_DISABLE();
/* ##-3- Disable DMA2D IRQ in NVIC #############################################*/
HAL_NVIC_DisableIRQ(DMA2D_IRQn);
}
示例4: 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)
{
/*##-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 NVIC for UART ##########################################*/
HAL_NVIC_DisableIRQ(USARTx_IRQn);
}
示例5: HAL_CAN_MspDeInit
/**
* @brief CAN MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO to their default state
* @param hcan: CAN handle pointer
* @retval None
*/
void HAL_CAN_MspDeInit(CAN_HandleTypeDef *hcan)
{
/*##-1- Reset peripherals ##################################################*/
CANx_FORCE_RESET();
CANx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks ################################*/
/* De-initialize the CAN1 TX GPIO pin */
HAL_GPIO_DeInit(CANx_TX_GPIO_PORT, CANx_TX_PIN);
/* De-initialize the CAN1 RX GPIO pin */
HAL_GPIO_DeInit(CANx_RX_GPIO_PORT, CANx_RX_PIN);
/*##-4- Disable the NVIC for CAN reception #################################*/
HAL_NVIC_DisableIRQ(CANx_RX_IRQn);
}
示例6: HAL_ADC_MspDeInit
/**
* @brief ADC MSP de-initialization
* This function frees the hardware resources used in this example:
* - Disable clock of ADC peripheral
* - Revert GPIO associated to the peripheral channels to their default state
* - Revert DMA associated to the peripheral to its default state
* - Revert NVIC associated to the peripheral interruptions to its default state
* @param hadc: ADC handle pointer
* @retval None
*/
void HAL_ADC_MspDeInit(ADC_HandleTypeDef *hadc)
{
/*##-1- Reset peripherals ##################################################*/
ADCx_FORCE_RESET();
ADCx_RELEASE_RESET();
/*##-2- Disable peripherals and GPIO Clocks ################################*/
/* De-initialize GPIO pin of the selected ADC channel */
HAL_GPIO_DeInit(ADCx_CHANNELa_GPIO_PORT, ADCx_CHANNELa_PIN);
/*##-3- Disable the DMA ####################################################*/
/* De-Initialize the DMA associated to the peripheral */
if(hadc->DMA_Handle != NULL)
{
HAL_DMA_DeInit(hadc->DMA_Handle);
}
/*##-4- Disable the NVIC ###################################################*/
/* Disable the NVIC configuration for DMA interrupt */
HAL_NVIC_DisableIRQ(ADCx_DMA_IRQn);
/* Disable the NVIC configuration for ADC interrupt */
HAL_NVIC_DisableIRQ(ADCx_IRQn);
}
示例7: HAL_UART_MspDeInit
void HAL_UART_MspDeInit(UART_HandleTypeDef* huart)
{
if(huart->Instance==USART1)
{
/* USER CODE BEGIN USART1_MspDeInit 0 */
/* USER CODE END USART1_MspDeInit 0 */
/* Peripheral clock disable */
__USART1_CLK_DISABLE();
/**USART1 GPIO Configuration
PA9 ------> USART1_TX
PA10 ------> USART1_RX
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_9|GPIO_PIN_10);
/* Peripheral DMA DeInit*/
HAL_DMA_DeInit(huart->hdmarx);
HAL_DMA_DeInit(huart->hdmatx);
/* Peripheral interrupt DeInit*/
HAL_NVIC_DisableIRQ(USART1_IRQn);
/* USER CODE BEGIN USART1_MspDeInit 1 */
/* USER CODE END USART1_MspDeInit 1 */
}
else if(huart->Instance==USART2)
{
/* USER CODE BEGIN USART2_MspDeInit 0 */
/* USER CODE END USART2_MspDeInit 0 */
/* Peripheral clock disable */
__USART2_CLK_DISABLE();
/**USART2 GPIO Configuration
PA2 ------> USART2_TX
PA3 ------> USART2_RX
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_2|GPIO_PIN_3);
/* USER CODE BEGIN USART2_MspDeInit 1 */
/* USER CODE END USART2_MspDeInit 1 */
}
}
示例8: prvDisableUart1Interface
/**
* @brief Disables the UART1 interface
* @param None
* @retval None
*/
static void prvDisableUart1Interface()
{
HAL_NVIC_DisableIRQ(USART1_IRQn);
HAL_UART_DeInit(&UART_Handle);
__USART1_CLK_DISABLE();
xSemaphoreGive(xSemaphore);
prvRxBuffer1CurrentIndex = 0;
prvRxBuffer1Count = 0;
prvRxBuffer1State = BUFFERState_Writing;
prvRxBuffer2CurrentIndex = 0;
prvRxBuffer2Count = 0;
prvRxBuffer2State = BUFFERState_Writing;
prvChannelIsEnabled = false;
}
示例9: 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 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- Disable peripherals and GPIO Clocks ################################*/
/* Configure SPI SCK as alternate function */
HAL_GPIO_DeInit(SPIx_SCK_GPIO_PORT, SPIx_SCK_PIN);
/* Configure SPI MISO as alternate function */
HAL_GPIO_DeInit(SPIx_MISO_GPIO_PORT, SPIx_MISO_PIN);
/* Configure SPI MOSI as alternate function */
HAL_GPIO_DeInit(SPIx_MOSI_GPIO_PORT, SPIx_MOSI_PIN);
/*##-2- Disable the NVIC for SPI ###########################################*/
HAL_NVIC_DisableIRQ(SPIx_IRQn);
}
}
示例10: 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;
static DMA_HandleTypeDef dma_rx_handle2;
static DMA_HandleTypeDef dma_tx_handle2;
if(hsd->Instance == SDMMC1)
{
/* Disable NVIC for DMA transfer complete interrupts */
HAL_NVIC_DisableIRQ(SD1_DMAx_Rx_IRQn);
HAL_NVIC_DisableIRQ(SD1_DMAx_Tx_IRQn);
/* Deinitialize the stream for new transfer */
dma_rx_handle.Instance = SD1_DMAx_Rx_STREAM;
HAL_DMA_DeInit(&dma_rx_handle);
/* Deinitialize the stream for new transfer */
dma_tx_handle.Instance = SD1_DMAx_Tx_STREAM;
HAL_DMA_DeInit(&dma_tx_handle);
/* Disable NVIC for SDIO interrupts */
HAL_NVIC_DisableIRQ(SDMMC1_IRQn);
/* DeInit GPIO pins can be done in the application
(by surcharging this __weak function) */
/* Disable SDMMC1 clock */
__HAL_RCC_SDMMC1_CLK_DISABLE();
}
else
{ /* Disable NVIC for DMA transfer complete interrupts */
HAL_NVIC_DisableIRQ(SD2_DMAx_Rx_IRQn);
HAL_NVIC_DisableIRQ(SD2_DMAx_Tx_IRQn);
/* Deinitialize the stream for new transfer */
dma_rx_handle2.Instance = SD2_DMAx_Rx_STREAM;
HAL_DMA_DeInit(&dma_rx_handle2);
/* Deinitialize the stream for new transfer */
dma_tx_handle2.Instance = SD2_DMAx_Tx_STREAM;
HAL_DMA_DeInit(&dma_tx_handle2);
/* Disable NVIC for SDIO interrupts */
HAL_NVIC_DisableIRQ(SDMMC2_IRQn);
/* DeInit GPIO pins can be done in the application
(by surcharging this __weak function) */
/* Disable SDMMC2 clock */
__HAL_RCC_SDMMC2_CLK_DISABLE();
}
/* GPIO pins clock and DMA clocks can be shut down in the application
by surcharging this __weak function */
}
示例11: IRQ_HAL_DeInit
void IRQ_HAL_DeInit(IRQ_HandleTypeDef* hirq)
{
assert_param(hirq);
assert_param(hirq->irqn <= FPU_IRQn);
HAL_NVIC_DisableIRQ(hirq->irqn);
hirq->state = IRQ_HANDLE_STATE_RESET;
if (hirq->irqh_obj)
{
assert_param(hirq->registry);
IRQ_HandlerObject_Unregister(hirq->registry, hirq->irqn);
hirq->irqh_obj = 0; // remove link
}
}
示例12: BSP_SDRAM_MspDeInit
/**
* @brief DeInitializes SDRAM MSP.
* @param hsdram: SDRAM handle
* @retval None
*/
__weak void BSP_SDRAM_MspDeInit(SDRAM_HandleTypeDef *hsdram, void *Params)
{
static DMA_HandleTypeDef dma_handle;
/* Disable NVIC configuration for DMA interrupt */
HAL_NVIC_DisableIRQ(SDRAM_DMAx_IRQn);
/* Deinitialize the stream for new transfer */
dma_handle.Instance = SDRAM_DMAx_STREAM;
HAL_DMA_DeInit(&dma_handle);
/* DeInit GPIO pins can be done in the application
(by surcharging this __weak function) */
/* GPIO pins clock, FMC clock and DMA clock can be shut down in the application
by surcharging this __weak function */
}
示例13: HAL_PCD_MspDeInit
void HAL_PCD_MspDeInit(PCD_HandleTypeDef* hpcd)
{
if(hpcd->Instance==USB)
{
/* Peripheral clock disable */
__USB_CLK_DISABLE();
/**USB GPIO Configuration
PA11 ------> USB_DM
PA12 ------> USB_DP
*/
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_11|GPIO_PIN_12);
/* Peripheral interrupt Deinit*/
HAL_NVIC_DisableIRQ(USB_LP_CAN_RX0_IRQn);
}
}
示例14: HAL_COMP_MspDeInit
/**
* @brief DeInitializes the COMP MSP.
* @param hcomp: pointer to a COMP_HandleTypeDef structure that contains
* the configuration information for the specified COMP.
* @retval None
*/
void HAL_COMP_MspDeInit(COMP_HandleTypeDef* hcomp)
{
/*##-1- Reset peripherals ##################################################*/
/* Disable COMP1 clock */
__HAL_RCC_SYSCFG_CLK_DISABLE();
/* Disable GPIO clock */
__HAL_RCC_GPIOA_CLK_DISABLE();
/*##-2- Disable peripherals and GPIO ######################################*/
/* De-Initialize COMP1 */
HAL_COMP_DeInit(&hcomp1);
/* De-initialize the GPIO pin */
HAL_GPIO_DeInit(GPIOA, GPIO_PIN_1);
/*##-3- Disable the NVIC for COMP ##########################################*/
HAL_NVIC_DisableIRQ(ADC1_COMP_IRQn);
}
示例15: HAL_SDADC_MspDeInit
/**
* @brief SDADC MSP De-Initialization
* This function frees the hardware resources used in this example:
* - Disable the Peripheral's clock
* - Revert GPIO to their default state
* @param hsdadc: SDADC handle pointer
* @retval None
*/
void HAL_SDADC_MspDeInit(SDADC_HandleTypeDef *hsdadc)
{
/*##-1- Power Off SDADC ###################################################*/
HAL_PWREx_DisableSDADCAnalog(POT_PWR_SDADC);
/*##-2- Disable power clock ###############################################*/
__PWR_CLK_DISABLE();
/*##-3- Power Off SDADC ###################################################*/
POT_GPIO_CLK_DISABLE();
/*##-4- Disable SDADC clock ###############################################*/
POT_SDADC_CLK_DISABLE();
/*##-5- Disable interrupt #################################################*/
HAL_NVIC_DisableIRQ(POT_SDADC_IRQn);
}