These accessors are inlined and are used to perform the operations on avr_regbit_t definitions.
More...
|
static uint8_t | avr_regbit_set (avr_t *avr, avr_regbit_t rb) |
| Set/get/clear io register bits in one operation. More...
|
|
static uint8_t | avr_regbit_setto (avr_t *avr, avr_regbit_t rb, uint8_t v) |
|
static uint8_t | avr_regbit_setto_raw (avr_t *avr, avr_regbit_t rb, uint8_t v) |
| Set the 'raw' bits, if 'v' is the unshifted value of the bits. More...
|
|
static uint8_t | avr_regbit_get (avr_t *avr, avr_regbit_t rb) |
|
static uint8_t | avr_regbit_from_value (avr_t *avr, avr_regbit_t rb, uint8_t value) |
| Using regbit from value eliminates some of the set to test then clear register operations. More...
|
|
static uint8_t | avr_regbit_get_raw (avr_t *avr, avr_regbit_t rb) |
| Return the bit(s) 'in position' instead of zero based. More...
|
|
static uint8_t | avr_regbit_clear (avr_t *avr, avr_regbit_t rb) |
|
static uint8_t | avr_regbit_get_array (avr_t *avr, avr_regbit_t *rb, int count) |
| This reads the bits for an array of avr_regbit_t, make up a "byte" with them. More...
|
|
static void | avr_regbit_set_array_from_value (avr_t *avr, avr_regbit_t *rb, uint8_t count, uint8_t value) |
| Does the reverse of avr_regbit_get_array. More...
|
|
These accessors are inlined and are used to perform the operations on avr_regbit_t definitions.
This is the "official" way to access bits into registers The small footprint costs brings much better versatility for functions/bits that are not always defined in the same place on real AVR cores
#define ARRAY_SIZE |
( |
|
_aa | ) |
(sizeof(_aa) / sizeof((_aa)[0])) |
#define AVR_IO_REGBIT |
( |
|
_io, |
|
|
|
_bit |
|
) |
| { . reg = (_io), .bit = (_bit), .mask = 1 } |
#define AVR_IO_REGBITS |
( |
|
_io, |
|
|
|
_bit, |
|
|
|
_mask |
|
) |
| { . reg = (_io), .bit = (_bit), .mask = (_mask) } |
Using regbit from value eliminates some of the set to test then clear register operations.
makes cheking register bits before setting easier.
This reads the bits for an array of avr_regbit_t, make up a "byte" with them.
This allows reading bits like CS0, CS1, CS2 etc even if they are not in the same physical IO register.
Return the bit(s) 'in position' instead of zero based.
Set/get/clear io register bits in one operation.
static void avr_regbit_set_array_from_value |
( |
avr_t * |
avr, |
|
|
avr_regbit_t * |
rb, |
|
|
uint8_t |
count, |
|
|
uint8_t |
value |
|
) |
| |
|
inlinestatic |
Does the reverse of avr_regbit_get_array.
Set the 'raw' bits, if 'v' is the unshifted value of the bits.