aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 7ca829c3b009cf3f6fbbb87a560b06a1b6efff41 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# funreg: Functional Register I/O using modern C++

*funreg* provides a functional approach to interacting with registers.
The library includes support for memory-mapped registers; however, other types
of registers can be supported through creating a simple access interface.

A unique feature of this library is its ability to handle multiple register
operations with a single function call; these operations will be merged
together so that the register is only read and written once.

Registers may also be organized into groups. These groups can similarly receive
a list of operations, which will be directed the to the appropriate registers
for the same single-read-single-write process.

For example, LEDs can be controlled by a microcontroller with a single call:

```cpp
LEDS::modify<LED1::set, LED2::clear, LED3::set>();
```

...no matter if the LEDs use different registers, or if any of them are
controlled by an external circuit rather than a built-in IO peripheral.

See `GUIDE.md` for a walk-through of the available functionality.

## Feature overview

* Define registers of any size, at any address, with optional custom access interface
* Define register masks to name the bits of registers
* Define register groups so ease programming (e.g. define an `RTC` group to work with all real-time clock registers at once)
* Make modifications through groups, masks, or the registers directly

## Requirements

* C++20
* GCC or Clang with some optimization enabled (O1, O2, O3, Os).