Lo más sensato sería que representaras el sensor en tu código, así, incluso, te sería más fácil depurar.
C, y por ende C++ son lenguajes creados para hablar con la máquina pero muchas veces, sobre todo quien trabaja a más alto nivel olvida o desconoce ese potencial del lenguaje. En tu caso deberías usar los bitfields.
En tu ejemplo, para representar el registro CONFIG_0 podrías hacer así:
#include <stdio.h>
#include <stdlib.h>
typedef enum {
DIVIDE_BY_2,
DIVIDE_BY_4,
DIVIDE_BY_8, /* Default value */
DIVIDE_BY_16,
DIVIDE_BY_32,
DIVIDE_BY_64,
DIVIDE_BY_128,
DIVIDE_BY_256
} prescaler;
struct {
unsigned TX_FREQ_DIV : 3;
unsigned NUM_TX : 5;
} CONFIG_0;
/* Aquí otros registros
struct {
unsigned <campo> : <tamaño en bits>;
unsigned <campo> : <tamaño en bits>;
...
} <nombre del registro>
...
*/
int main() {
CONFIG_0.TX_FREQ_DIV = DIVIDE_BY_8;
CONFIG_0.NUM_TX = 5;
puts("CONFIG_0 register status"); puts("------------------------"); printf("TX_FREQ_DIV : %u\n", CONFIG_0.
TX_FREQ_DIV); printf("NUM_TX : %u\n", CONFIG_0.
NUM_TX); }