2021-03-19 10:05:24 -07:00
|
|
|
/*
|
|
|
|
ChibiOS - Copyright (C) 2006..2018 Giovanni Di Sirio
|
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:49:26 -07:00
|
|
|
* @file GD32VF103/gd32_rcu.h
|
2021-03-31 02:24:51 -07:00
|
|
|
* @brief RCU helper driver header.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note This file requires definitions from the ST header file
|
2021-04-06 00:11:47 -07:00
|
|
|
* @p gd32vf103.h.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
2021-03-31 02:49:26 -07:00
|
|
|
* @addtogroup GD32VF103_RCU
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
|
2021-03-31 02:24:51 -07:00
|
|
|
#ifndef GD32_RCU_H
|
|
|
|
#define GD32_RCU_H
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver constants. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver pre-compile time settings. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Derived constants and error checks. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver data structures and types. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* Driver macros. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name Generic RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @brief Enables the clock of one or more peripheral on the APB1 bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB1 peripherals mask
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuEnableAPB1(mask, lp) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB1EN |= (mask); \
|
|
|
|
(void)RCU->APB1EN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the clock of one or more peripheral on the APB1 bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB1 peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuDisableAPB1(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB1EN &= ~(mask); \
|
|
|
|
(void)RCU->APB1EN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets one or more peripheral on the APB1 bus.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB1 peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuResetAPB1(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB1RST |= (mask); \
|
|
|
|
RCU->APB1RST &= ~(mask); \
|
|
|
|
(void)RCU->APB1RST; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the clock of one or more peripheral on the APB2 bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB2 peripherals mask
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuEnableAPB2(mask, lp) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB2EN |= (mask); \
|
|
|
|
(void)RCU->APB2EN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the clock of one or more peripheral on the APB2 bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB2 peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuDisableAPB2(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB2EN &= ~(mask); \
|
|
|
|
(void)RCU->APB2EN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets one or more peripheral on the APB2 bus.
|
|
|
|
*
|
|
|
|
* @param[in] mask APB2 peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuResetAPB2(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->APB2RST |= (mask); \
|
|
|
|
RCU->APB2RST &= ~(mask); \
|
|
|
|
(void)RCU->APB2RST; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the clock of one or more peripheral on the AHB bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask AHB peripherals mask
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuEnableAHB(mask, lp) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->AHBEN |= (mask); \
|
|
|
|
(void)RCU->AHBEN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the clock of one or more peripheral on the AHB bus.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] mask AHB peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuDisableAHB(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->AHBEN &= ~(mask); \
|
|
|
|
(void)RCU->AHBEN; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets one or more peripheral on the AHB bus.
|
|
|
|
*
|
|
|
|
* @param[in] mask AHB peripherals mask
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuResetAHB(mask) { \
|
2021-03-31 02:34:30 -07:00
|
|
|
RCU->AHBRST |= (mask); \
|
|
|
|
RCU->AHBRST &= ~(mask); \
|
|
|
|
(void)RCU->AHBRST; \
|
2021-03-19 10:05:24 -07:00
|
|
|
}
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name ADC peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-04-05 08:37:28 -07:00
|
|
|
* @brief Enables the ADC0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableADC0(lp) rcuEnableAPB2(RCU_APB2EN_ADC0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:37:28 -07:00
|
|
|
* @brief Disables the ADC0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableADC0() rcuDisableAPB2(RCU_APB2EN_ADC0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:37:28 -07:00
|
|
|
* @brief Resets the ADC0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:07:12 -07:00
|
|
|
#define rcuResetADC0() rcuResetAPB2(RCU_APB2RST_ADC0RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name DAC peripheral specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-04-05 08:29:59 -07:00
|
|
|
* @brief Enables the DAC peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableDAC(lp) rcuEnableAPB1(RCU_APB1EN_DACEN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:29:59 -07:00
|
|
|
* @brief Disables the DAC peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableDAC() rcuDisableAPB1(RCU_APB1EN_DACEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:29:59 -07:00
|
|
|
* @brief Resets the DAC peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetDAC() rcuResetAPB1(RCU_APB1RST_DACRST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name Backup domain interface specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @brief Enables the BKP interface clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableBKPInterface(lp) rcuEnableAPB1((RCU_APB1EN_BKPIEN), lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables BKP interface clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableBKPInterface() rcuDisableAPB1(RCU_APB1EN_BKPIEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the Backup Domain interface.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuResetBKPInterface() rcuResetAPB1(RCU_APB1EN_BKPRST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the entire Backup Domain.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuResetBKP() (RCU->BDCTL |= RCU_BDCTL_BKPRST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:38:28 -07:00
|
|
|
* @name PMU interface specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-31 02:38:28 -07:00
|
|
|
* @brief Enables the PMU interface clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnablePMUInterface(lp) rcuEnableAPB1(RCU_APB1EN_PMUEN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-31 02:38:28 -07:00
|
|
|
* @brief Disables PMU interface clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisablePMUInterface() rcuDisableAPB1(RCU_APB1EN_PMUEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-31 02:38:28 -07:00
|
|
|
* @brief Resets the PMU interface.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetPMUInterface() rcuResetAPB1(RCU_APB1RST_PMURST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name CAN peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Enables the CAN0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableCAN0(lp) rcuEnableAPB1(RCU_APB1EN_CAN0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Disables the CAN0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableCAN0() rcuDisableAPB1(RCU_APB1EN_CAN0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Resets the CAN0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetCAN0() rcuResetAPB1(RCU_APB1RST_CAN0RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Enables the CAN1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableCAN1(lp) rcuEnableAPB1(RCU_APB1EN_CAN1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Disables the CAN1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableCAN1() rcuDisableAPB1(RCU_APB1EN_CAN1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 08:16:48 -07:00
|
|
|
* @brief Resets the CAN1 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetCAN1() rcuResetAPB1(RCU_APB1RST_CAN1RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name DMA peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-20 15:27:49 -07:00
|
|
|
* @brief Enables the DMA0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuEnableDMA0(lp) rcuEnableAHB(RCU_AHBEN_DMA0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-20 15:27:49 -07:00
|
|
|
* @brief Disables the DMA0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuDisableDMA0() rcuDisableAHB(RCU_AHBEN_DMA0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-20 15:27:49 -07:00
|
|
|
* @brief Resets the DMA0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note Not supported in this family, does nothing.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuResetDMA0()
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-20 15:47:28 -07:00
|
|
|
* @brief Enables the DMA1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuEnableDMA1(lp) rcuEnableAHB(RCU_AHBEN_DMA1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-20 15:47:28 -07:00
|
|
|
* @brief Disables the DMA1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuDisableDMA1() rcuDisableAHB(RCU_AHBEN_DMA1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-20 15:27:49 -07:00
|
|
|
* @brief Resets the DMA0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note Not supported in this family, does nothing.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-03-31 02:24:51 -07:00
|
|
|
#define rcuResetDMA1()
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name I2C peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-25 10:57:11 -07:00
|
|
|
* @brief Enables the I2C0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableI2C0(lp) rcuEnableAPB1(RCU_APB1EN_I2C0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 10:57:11 -07:00
|
|
|
* @brief Disables the I2C0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableI2C0() rcuDisableAPB1(RCU_APB1EN_I2C0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 10:57:11 -07:00
|
|
|
* @brief Resets the I2C0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetI2C0() rcuResetAPB1(RCU_APB1RST_I2C0RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 10:57:46 -07:00
|
|
|
* @brief Enables the I2C1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableI2C1(lp) rcuEnableAPB1(RCU_APB1EN_I2C1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 10:57:46 -07:00
|
|
|
* @brief Disables the I2C1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableI2C1() rcuDisableAPB1(RCU_APB1EN_I2C1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 10:57:46 -07:00
|
|
|
* @brief Resets the I2C1 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetI2C1() rcuResetAPB1(RCU_APB1RST_I2C1RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name OTG peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-23 03:57:43 -07:00
|
|
|
* @brief Enables the USBFS peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuEnableUSBFS(lp) rcuEnableAHB(RCU_AHBEN_USBFSEN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-23 03:57:43 -07:00
|
|
|
* @brief Disables the USBFS peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuDisableUSBFS() rcuDisableAHB(RCU_AHBEN_USBFSEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-23 03:57:43 -07:00
|
|
|
* @brief Resets the USBFS peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuResetUSBFS() rcuResetAHB(RCU_AHBRST_USBFSRST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name SPI peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Enables the SPI0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableSPI0(lp) rcuEnableAPB2(RCU_APB2EN_SPI0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Disables the SPI0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableSPI0() rcuDisableAPB2(RCU_APB2EN_SPI0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Resets the SPI0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:25:19 -07:00
|
|
|
#define rcuResetSPI0() rcuResetAPB2(RCU_APB2RST_SPI0RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Enables the SPI1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableSPI1(lp) rcuEnableAPB1(RCU_APB1EN_SPI1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Disables the SPI1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableSPI1() rcuDisableAPB1(RCU_APB1EN_SPI1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Resets the SPI1 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetSPI1() rcuResetAPB1(RCU_APB1RST_SPI1RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Enables the SPI2 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableSPI2(lp) rcuEnableAPB1(RCU_APB1EN_SPI2EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Disables the SPI2 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableSPI2() rcuDisableAPB1(RCU_APB1EN_SPI2EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-04-05 09:25:19 -07:00
|
|
|
* @brief Resets the SPI2 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetSPI2() rcuResetAPB1(RCU_APB1RST_SPI2RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name TIM peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
2021-03-30 09:39:36 -07:00
|
|
|
/**
|
|
|
|
* @brief Enables the TIM0 peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM0(lp) rcuEnableAPB2(RCU_APB2EN_TIMER0EN, lp)
|
2021-03-30 09:39:36 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM0 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM0() rcuDisableAPB2(RCU_APB2EN_TIMER0EN)
|
2021-03-30 09:39:36 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM0 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:07:12 -07:00
|
|
|
#define rcuResetTIM0() rcuResetAPB2(RCU_APB2RST_TIMER0RST)
|
2021-03-30 09:39:36 -07:00
|
|
|
|
2021-03-19 10:05:24 -07:00
|
|
|
/**
|
|
|
|
* @brief Enables the TIM1 peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM1(lp) rcuEnableAPB1(RCU_APB1EN_TIMER1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM1 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM1() rcuDisableAPB1(RCU_APB1EN_TIMER1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM1 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM1() rcuResetAPB1(RCU_APB1RST_TIMER1RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the TIM2 peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM2(lp) rcuEnableAPB1(RCU_APB1EN_TIMER2EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM2 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM2() rcuDisableAPB1(RCU_APB1EN_TIMER2EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM2 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM2() rcuResetAPB1(RCU_APB1RST_TIMER2RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the TIM3 peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM3(lp) rcuEnableAPB1(RCU_APB1EN_TIMER3EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM3 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM3() rcuDisableAPB1(RCU_APB1EN_TIMER3EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM3 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM3() rcuResetAPB1(RCU_APB1RST_TIMER3RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the TIM4 peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM4(lp) rcuEnableAPB1(RCU_APB1EN_TIMER4EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM4 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM4() rcuDisableAPB1(RCU_APB1EN_TIMER4EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM4 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM4() rcuResetAPB1(RCU_APB1RST_TIMER4RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the TIM5 peripheral clock.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM5(lp) rcuEnableAPB1(RCU_APB1EN_TIMER5EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM5 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM5() rcuDisableAPB1(RCU_APB1EN_TIMER5EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM5 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM5() rcuResetAPB1(RCU_APB1RST_TIMER5RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Enables the TIM6 peripheral clock.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableTIM6(lp) rcuEnableAPB1(RCU_APB1EN_TIMER6EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the TIM6 peripheral clock.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableTIM6() rcuDisableAPB1(RCU_APB1EN_TIMER6EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the TIM6 peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetTIM6() rcuResetAPB1(RCU_APB1RST_TIMER6RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
|
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name USART/UART peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Enables the USART0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUSART0(lp) rcuEnableAPB2(RCU_APB2EN_USART0EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Disables the USART0 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUSART0() rcuDisableAPB2(RCU_APB2EN_USART0EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Resets the USART0 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:07:12 -07:00
|
|
|
#define rcuResetUSART0() rcuResetAPB2(RCU_APB2RST_USART0RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Enables the USART1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUSART1(lp) rcuEnableAPB1(RCU_APB1EN_USART1EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Disables the USART1 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUSART1() rcuDisableAPB1(RCU_APB1EN_USART1EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Resets the USART1 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetUSART1() rcuResetAPB1(RCU_APB1RST_USART1RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Enables the USART2 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUSART2(lp) rcuEnableAPB1(RCU_APB1EN_USART2EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Disables the USART2 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUSART2() rcuDisableAPB1(RCU_APB1EN_USART2EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:56:29 -07:00
|
|
|
* @brief Resets the USART2 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetUSART2() rcuResetAPB1(RCU_APB1RST_USART2RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Enables the UART3 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUART3(lp) rcuEnableAPB1(RCU_APB1EN_UART3EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Disables the UART3 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUART3() rcuDisableAPB1(RCU_APB1EN_UART3EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Resets the UART3 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetUART3() rcuResetAPB1(RCU_APB1RST_UART3RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Enables the UART4 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUART4(lp) rcuEnableAPB1(RCU_APB1EN_UART4EN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Disables the UART4 peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUART4() rcuDisableAPB1(RCU_APB1EN_UART4EN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-25 13:58:13 -07:00
|
|
|
* @brief Resets the UART4 peripheral.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetUART4() rcuResetAPB1(RCU_APB1RST_UART4RST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 02:24:51 -07:00
|
|
|
* @name USB peripheral specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
|
|
|
* @brief Enables the USB peripheral clock.
|
|
|
|
* @note The @p lp parameter is ignored in this family.
|
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuEnableUSB(lp) rcuEnableAPB1(RCU_APB1EN_USBEN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Disables the USB peripheral clock
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:36:41 -07:00
|
|
|
#define rcuDisableUSB() rcuDisableAPB1(RCU_APB1EN_USBEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Resets the USB peripheral.
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 09:52:41 -07:00
|
|
|
#define rcuResetUSB() rcuResetAPB1(RCU_APB1RST_USBRST)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/**
|
2021-03-31 03:04:15 -07:00
|
|
|
* @name EXMC peripherals specific RCU operations
|
2021-03-19 10:05:24 -07:00
|
|
|
* @{
|
|
|
|
*/
|
|
|
|
/**
|
2021-03-31 03:04:15 -07:00
|
|
|
* @brief Enables the EXMC peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @param[in] lp low power enable flag
|
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuEnableEXMC(lp) rcuEnableAHB(RCU_AHBEN_EXMCEN, lp)
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/**
|
2021-03-31 03:04:15 -07:00
|
|
|
* @brief Disables the EXMC peripheral clock.
|
2021-03-19 10:05:24 -07:00
|
|
|
*
|
|
|
|
* @api
|
|
|
|
*/
|
2021-04-05 10:02:45 -07:00
|
|
|
#define rcuDisableEXMC() rcuDisableAHB(RCU_AHBEN_EXMCEN)
|
2021-03-19 10:05:24 -07:00
|
|
|
/** @} */
|
|
|
|
|
|
|
|
/*===========================================================================*/
|
|
|
|
/* External declarations. */
|
|
|
|
/*===========================================================================*/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2021-03-31 02:24:51 -07:00
|
|
|
#endif /* GD32_RCU_H */
|
2021-03-19 10:05:24 -07:00
|
|
|
|
|
|
|
/** @} */
|