aboutsummaryrefslogtreecommitdiffstats
path: root/libmaple/include
diff options
context:
space:
mode:
Diffstat (limited to 'libmaple/include')
-rw-r--r--libmaple/include/libmaple/i2c.h15
-rw-r--r--libmaple/include/libmaple/nvic.h8
-rw-r--r--libmaple/include/libmaple/stm32.h2
-rw-r--r--libmaple/include/libmaple/systick.h1
-rw-r--r--libmaple/include/libmaple/usb_cdcacm.h2
5 files changed, 8 insertions, 20 deletions
diff --git a/libmaple/include/libmaple/i2c.h b/libmaple/include/libmaple/i2c.h
index ff1c313..b198bfa 100644
--- a/libmaple/include/libmaple/i2c.h
+++ b/libmaple/include/libmaple/i2c.h
@@ -47,6 +47,8 @@ extern "C" {
/*
* Series header must provide:
*
+ * - struct i2c_reg_map
+ *
* - uint32 _i2c_bus_clk(i2c_dev*): Clock frequency of dev's bus, in
* MHz. (This is for internal use only).
*
@@ -72,19 +74,6 @@ extern "C" {
#include <libmaple/nvic.h>
#include <libmaple/gpio.h>
-/** I2C register map type */
-typedef struct i2c_reg_map {
- __io uint32 CR1; /**< Control register 1 */
- __io uint32 CR2; /**< Control register 2 */
- __io uint32 OAR1; /**< Own address register 1 */
- __io uint32 OAR2; /**< Own address register 2 */
- __io uint32 DR; /**< Data register */
- __io uint32 SR1; /**< Status register 1 */
- __io uint32 SR2; /**< Status register 2 */
- __io uint32 CCR; /**< Clock control register */
- __io uint32 TRISE; /**< TRISE (rise time) register */
-} i2c_reg_map;
-
/**
* @brief I2C message type
*/
diff --git a/libmaple/include/libmaple/nvic.h b/libmaple/include/libmaple/nvic.h
index ffe385d..3e29f9e 100644
--- a/libmaple/include/libmaple/nvic.h
+++ b/libmaple/include/libmaple/nvic.h
@@ -107,16 +107,12 @@ void nvic_sys_reset();
/**
* Enables interrupts and configurable fault handlers (clear PRIMASK).
*/
-static __always_inline void nvic_globalirq_enable() {
- asm volatile("cpsie i");
-}
+#define nvic_globalirq_enable() do { asm volatile("cpsie i"); } while (0)
/**
* Disable interrupts and configurable fault handlers (set PRIMASK).
*/
-static __always_inline void nvic_globalirq_disable() {
- asm volatile("cpsid i");
-}
+#define nvic_globalirq_disable() do { asm volatile("cpsid i"); } while (0)
/**
* @brief Enable interrupt irq_num
diff --git a/libmaple/include/libmaple/stm32.h b/libmaple/include/libmaple/stm32.h
index 3845cab..5fef820 100644
--- a/libmaple/include/libmaple/stm32.h
+++ b/libmaple/include/libmaple/stm32.h
@@ -69,6 +69,8 @@ extern "C" {
*/
#include <series/stm32.h>
+/* FIXME: need an STM32_USART_MASK to parallel STM32_TIMER_MASK */
+
/* Ensure the series header isn't broken. */
#if (!defined(STM32_PCLK1) || \
!defined(STM32_PCLK2) || \
diff --git a/libmaple/include/libmaple/systick.h b/libmaple/include/libmaple/systick.h
index 551f800..bd8b18f 100644
--- a/libmaple/include/libmaple/systick.h
+++ b/libmaple/include/libmaple/systick.h
@@ -87,6 +87,7 @@ static inline uint32 systick_uptime(void) {
void systick_init(uint32 reload_val);
void systick_disable();
void systick_enable();
+void systick_attach_callback(void (*)(void));
/**
* @brief Returns the current value of the SysTick counter.
diff --git a/libmaple/include/libmaple/usb_cdcacm.h b/libmaple/include/libmaple/usb_cdcacm.h
index 5fe832c..b925883 100644
--- a/libmaple/include/libmaple/usb_cdcacm.h
+++ b/libmaple/include/libmaple/usb_cdcacm.h
@@ -168,7 +168,7 @@ int usb_cdcacm_get_n_data_bits(void); /* bDataBits */
void usb_cdcacm_set_hooks(unsigned hook_flags, void (*hook)(unsigned, void*));
-static __always_inline void usb_cdcacm_remove_hooks(unsigned hook_flags) {
+static inline void usb_cdcacm_remove_hooks(unsigned hook_flags) {
usb_cdcacm_set_hooks(hook_flags, 0);
}