diff --git a/include/libopencm3/cm3/common.h b/include/libopencm3/cm3/common.h index 4aa879ce..7e758822 100644 --- a/include/libopencm3/cm3/common.h +++ b/include/libopencm3/cm3/common.h @@ -52,6 +52,13 @@ #define MMIO32(addr) (*(volatile uint32_t *)(addr)) #define MMIO64(addr) (*(volatile uint64_t *)(addr)) +/* Generic bit-band I/O accessor functions */ +#define BBIO_SRAM(addr,bit) \ + MMIO8(((addr) & 0x0FFFFF) * 32 | 0x22000000 + (bit) * 4 ) + +#define BBIO_PERIPH(addr,bit) \ + MMIO8(((addr) & 0x0FFFFF) * 32 | 0x42000000 + (bit) * 4 ) + /* Generic bit definition */ #define BIT0 (1<<0) #define BIT1 (1<<1)