From 3bc5a249a12231264e8c796501ed24d1e53ae712 Mon Sep 17 00:00:00 2001 From: BuFran Date: Wed, 19 Jun 2013 13:51:56 +0200 Subject: [PATCH] Added support for BitBand I/O --- include/libopencm3/cm3/common.h | 7 +++++++ 1 file changed, 7 insertions(+) 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)