Macros for using decorated memory accesses with the Bit Manipulation Engine available in Kinetis Cortex-M0+ devices.
More...
Macros for using decorated memory accesses with the Bit Manipulation Engine available in Kinetis Cortex-M0+ devices.
|
file | bme.h |
| Macro definitions for the Kinetis Bit Manipulation Engine (BME)
|
|
|
static volatile void * | bme_bf_addr (volatile void *ptr, uintptr_t bit, uintptr_t width) |
| Bit field address macro. More...
|
|
static volatile uint32_t * | bme_bitfield32 (volatile uint32_t *ptr, uint8_t bit, uint8_t width) |
| Access a bitfield (32 bit load/store) More...
|
|
static volatile uint16_t * | bme_bitfield16 (volatile uint16_t *ptr, uint8_t bit, uint8_t width) |
| Access a bitfield (16 bit load/store) More...
|
|
static volatile uint8_t * | bme_bitfield8 (volatile uint8_t *ptr, uint8_t bit, uint8_t width) |
| Access a bitfield (8 bit load/store) More...
|
|
◆ BME_BF_MASK
#define BME_BF_MASK |
( |
|
bit, |
|
|
|
width |
|
) |
| ((1 << 28) | ((bit) << 23) | (((width) - 1 ) << 19)) |
Bit field extraction bitmask.
- Parameters
-
bit | LSB of the bitfield within the word/halfword/byte |
width | Number of bits to extract |
Definition at line 45 of file bme.h.
◆ bme_bf_addr()
static volatile void* bme_bf_addr |
( |
volatile void * |
ptr, |
|
|
uintptr_t |
bit, |
|
|
uintptr_t |
width |
|
) |
| |
|
inlinestatic |
Bit field address macro.
- Precondition
- The target address must lie within a part of the peripheral address space 0x40000000 - 0x40070000
- Parameters
-
[in] | ptr | Pointer to target register |
[in] | bit | Location of the LSB of the bitfield within the register |
[in] | width | Width of the bitfield, in bits |
- Returns
- bitfield address as an uintptr_t
Definition at line 59 of file bme.h.
◆ bme_bitfield16()
static volatile uint16_t* bme_bitfield16 |
( |
volatile uint16_t * |
ptr, |
|
|
uint8_t |
bit, |
|
|
uint8_t |
width |
|
) |
| |
|
inlinestatic |
Access a bitfield (16 bit load/store)
This macro can be used both for store (*bme_bitfield16(xxx) = y)
and load (y = *bme_bitfield16(ptr, bit))
- Precondition
- The target address must lie within a part of the peripheral address space 0x40000000 - 0x40070000
- Parameters
-
[in] | ptr | Pointer to target register |
[in] | bit | Location of the LSB of the bitfield within the register |
[in] | width | Width of the bitfield, in bits |
- Returns
- bitfield extracted as a (modifiable) lvalue
Definition at line 99 of file bme.h.
◆ bme_bitfield32()
static volatile uint32_t* bme_bitfield32 |
( |
volatile uint32_t * |
ptr, |
|
|
uint8_t |
bit, |
|
|
uint8_t |
width |
|
) |
| |
|
inlinestatic |
Access a bitfield (32 bit load/store)
This macro can be used both for store (*bme_bitfield32(xxx) = y)
and load (y = *bme_bitfield32(ptr, bit))
- Precondition
- The target address must lie within a part of the peripheral address space 0x40000000 - 0x40070000
- Parameters
-
[in] | ptr | Pointer to target register |
[in] | bit | Location of the LSB of the bitfield within the register |
[in] | width | Width of the bitfield, in bits |
- Returns
- bitfield extracted as a (modifiable) lvalue
Definition at line 79 of file bme.h.
◆ bme_bitfield8()
static volatile uint8_t* bme_bitfield8 |
( |
volatile uint8_t * |
ptr, |
|
|
uint8_t |
bit, |
|
|
uint8_t |
width |
|
) |
| |
|
inlinestatic |
Access a bitfield (8 bit load/store)
This macro can be used both for store (*bme_bitfield8(xxx) = y)
and load (y = *bme_bitfield8(ptr, bit))
- Precondition
- The target address must lie within a part of the peripheral address space 0x40000000 - 0x40070000
- Parameters
-
[in] | ptr | Pointer to target register |
[in] | bit | Location of the LSB of the bitfield within the register |
[in] | width | Width of the bitfield, in bits |
- Returns
- bitfield extracted as a (modifiable) lvalue
Definition at line 119 of file bme.h.