aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarti Bolivar <mbolivar@leaflabs.com>2012-02-02 06:53:44 -0500
committerMarti Bolivar <mbolivar@leaflabs.com>2012-04-11 16:56:54 -0400
commit63d6d83c24bddc451a8c7f2ecc44d33c63553652 (patch)
tree47fa9aada4ec4e7ddda073d72230bd828aee9214
parent1251c6e396dffd218d85db13be211ff34365279e (diff)
downloadlibrambutan-63d6d83c24bddc451a8c7f2ecc44d33c63553652.tar.gz
librambutan-63d6d83c24bddc451a8c7f2ecc44d33c63553652.zip
libmaple/rcc.h: Add rcc_enable_css(), rcc_disable_css().
Signed-off-by: Marti Bolivar <mbolivar@leaflabs.com>
-rw-r--r--libmaple/include/libmaple/rcc.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/libmaple/include/libmaple/rcc.h b/libmaple/include/libmaple/rcc.h
index 842800b..4a22b5e 100644
--- a/libmaple/include/libmaple/rcc.h
+++ b/libmaple/include/libmaple/rcc.h
@@ -91,10 +91,27 @@ void rcc_turn_off_clk(rcc_clk clock);
int rcc_is_clk_ready(rcc_clk clock);
/* Peripheral clock lines and clock domains. */
+
void rcc_clk_enable(rcc_clk_id device);
void rcc_reset_dev(rcc_clk_id device);
rcc_clk_domain rcc_dev_clk(rcc_clk_id device);
+/* Clock security system */
+
+/**
+ * @brief Enable the clock security system (CSS).
+ */
+static inline void rcc_enable_css() {
+ RCC_BASE->CR |= RCC_CR_CSSON;
+}
+
+/**
+ * @brief Disable the clock security system (CSS).
+ */
+static inline void rcc_disable_css() {
+ RCC_BASE->CR &= ~RCC_CR_CSSON;
+}
+
#ifdef __cplusplus
} // extern "C"
#endif