From c0690a36e130236939ed7e339601a62c53ee04a0 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Wed, 13 May 2015 12:48:51 +0000 Subject: [PATCH] RCC DAC macros git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@7978 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/STM32F0xx/stm32_rcc.h | 30 +++++++++++++ os/hal/ports/STM32/STM32F1xx/stm32_rcc.h | 30 +++++++++++++ os/hal/ports/STM32/STM32F37x/stm32_rcc.h | 55 ++++++++++++++++++++++++ os/hal/ports/STM32/STM32F3xx/stm32_rcc.h | 55 ++++++++++++++++++++++++ os/hal/ports/STM32/STM32F4xx/stm32_rcc.h | 1 - os/hal/ports/STM32/STM32L1xx/stm32_rcc.h | 30 +++++++++++++ 6 files changed, 200 insertions(+), 1 deletion(-) diff --git a/os/hal/ports/STM32/STM32F0xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F0xx/stm32_rcc.h index 3c8ffcff2..9d6be2b3d 100644 --- a/os/hal/ports/STM32/STM32F0xx/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F0xx/stm32_rcc.h @@ -198,6 +198,36 @@ #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST) /** @} */ +/** + * @name DAC peripheral specific RCC operations + * @{ + */ +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC1(lp) rccDisableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DACRST) +/** @} */ + /** * @name PWR interface specific RCC operations * @{ diff --git a/os/hal/ports/STM32/STM32F1xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F1xx/stm32_rcc.h index c381427a6..efa0a0d94 100644 --- a/os/hal/ports/STM32/STM32F1xx/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F1xx/stm32_rcc.h @@ -198,6 +198,36 @@ #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST) /** @} */ +/** + * @name DAC peripheral specific RCC operations + * @{ + */ +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC1(lp) rccDisableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DACRST) +/** @} */ + /** * @name Backup domain interface specific RCC operations * @{ diff --git a/os/hal/ports/STM32/STM32F37x/stm32_rcc.h b/os/hal/ports/STM32/STM32F37x/stm32_rcc.h index dc7a30793..72746db12 100644 --- a/os/hal/ports/STM32/STM32F37x/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F37x/stm32_rcc.h @@ -190,6 +190,61 @@ #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST) /** @} */ +/** + * @name DAC peripheral specific RCC operations + * @{ + */ +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DAC1EN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC1(lp) rccDisableAPB1(RCC_APB1ENR_DAC1EN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DAC1RST) + +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC2(lp) rccEnableAPB1(RCC_APB1ENR_DAC2EN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC2(lp) rccDisableAPB1(RCC_APB1ENR_DAC2EN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC2() rccResetAPB1(RCC_APB1RSTR_DAC2RST) +/** @} */ + /** * @name CAN peripherals specific RCC operations * @{ diff --git a/os/hal/ports/STM32/STM32F3xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F3xx/stm32_rcc.h index 3fa455222..19aa6850a 100644 --- a/os/hal/ports/STM32/STM32F3xx/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F3xx/stm32_rcc.h @@ -215,6 +215,61 @@ #define rccResetADC34() rccResetAHB(RCC_AHBRSTR_ADC34RST) /** @} */ +/** + * @name DAC peripheral specific RCC operations + * @{ + */ +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DAC1EN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC1(lp) rccDisableAPB1(RCC_APB1ENR_DAC1EN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DAC1RST) + +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC2(lp) rccEnableAPB1(RCC_APB1ENR_DAC2EN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC2(lp) rccDisableAPB1(RCC_APB1ENR_DAC2EN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC2() rccResetAPB1(RCC_APB1RSTR_DAC2RST) +/** @} */ + /** * @name CAN peripherals specific RCC operations * @{ diff --git a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h index 33659dc2c..393fa5994 100644 --- a/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32F4xx/stm32_rcc.h @@ -331,7 +331,6 @@ #define rccResetADC3() rccResetAPB2(RCC_APB2RSTR_ADC3RST) /** @} */ - /** * @name DAC peripheral specific RCC operations * @{ diff --git a/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h b/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h index 856b7857d..e64ff3929 100644 --- a/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h +++ b/os/hal/ports/STM32/STM32L1xx/stm32_rcc.h @@ -202,6 +202,36 @@ #define rccResetADC1() rccResetAPB2(RCC_APB2RSTR_ADC1RST) /** @} */ +/** + * @name DAC peripheral specific RCC operations + * @{ + */ +/** + * @brief Enables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccEnableDAC1(lp) rccEnableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Disables the DAC1 peripheral clock. + * + * @param[in] lp low power enable flag + * + * @api + */ +#define rccDisableDAC1(lp) rccDisableAPB1(RCC_APB1ENR_DACEN, lp) + +/** + * @brief Resets the DAC1 peripheral. + * + * @api + */ +#define rccResetDAC1() rccResetAPB1(RCC_APB1RSTR_DACRST) +/** @} */ + /** * @name DMA peripheral specific RCC operations * @{