STM32LIB
rw_t.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "ro_t.hpp"
4 
8 struct rw_t : ro_t
9 {
10  static void write(
11  volatile unsigned * device,
12  unsigned offset,
13  unsigned mask,
14  unsigned value
15  )
16  { *device = (*device & ~mask) | ((value << offset) & mask); }
17 
18  static void set(
19  volatile unsigned * device,
20  unsigned mask
21  )
22  { *device |= mask; }
23 
24  static void clear(
25  volatile unsigned * device,
26  unsigned mask
27  )
28  { *device &= ~mask; }
29 };
Definition: ro_t.hpp:6
static void clear(volatile unsigned *device, unsigned mask)
Definition: rw_t.hpp:24
Definition: rw_t.hpp:8
static void set(volatile unsigned *device, unsigned mask)
Definition: rw_t.hpp:18
static void write(volatile unsigned *device, unsigned offset, unsigned mask, unsigned value)
Definition: rw_t.hpp:10