2009-04-24 23:07:15 +02:00
|
|
|
#ifndef UTILS_H
|
|
|
|
#define UTILS_H
|
|
|
|
|
|
|
|
#define reg32(x) (*(volatile uint32_t *)(x))
|
|
|
|
#define reg16(x) (*(volatile uint16_t *)(x))
|
|
|
|
|
2009-05-21 20:52:27 +02:00
|
|
|
#define bit(bit) (1<<bit)
|
|
|
|
#define bit_is_set(val,bit) (((val & (1<<bit)) >> bit) == 1)
|
|
|
|
#define clear_bit(val,bit) (val=(val & ~(1<<bit)))
|
|
|
|
#define set_bit(val,bit) (val=(val | (1<<bit)))
|
|
|
|
|
2009-04-24 23:07:15 +02:00
|
|
|
#endif
|