HWA
Bare metal programming with style
|
These definitions can be used in user application code. They may act on various types of arguments. Arguments are checked and explicit error messages are emitted.
Modules | |
HWA Classes | |
Macros | |
#define | hw(...) |
#define | HW_ADDRESS(...) |
#define | hw_asm(...) |
#define | HW_BITS(...) |
#define | HW_DECLARE(...) |
#define | HW_IMPLEMENT(...) HW_F(HW_IMPLEMENT,__VA_ARGS__) |
#define | HW_POSITION(...) |
#define | hw_stat_t(object) |
#define | hw_uint_t(n) |
#define | hwa(...) |
#define hw | ( | ... | ) |
hw( action, object [,...] )
executes an action immediately on an object.
#define HW_ADDRESS | ( | ... | ) |
Returns the address of an object or -1 if the object does not exist.
For I/O objects, the address is computed from their definition.
#define hw_asm | ( | ... | ) |
Insert inline assembler code.
#define HW_BITS | ( | ... | ) |
Number of bits of an object, 0 if the object has no bits or does not exist (no error is emitted).
#define HW_DECLARE | ( | ... | ) |
Declares the functions that implement an object.
External objects usually rely on functions to implement their HWA actions. These functions are declared by HW_DECLARE() and implemened by HW_IMPLEMENT().
An optionnal parameter 'weak' can be given so that the definitions can be overriden:
#define HW_IMPLEMENT | ( | ... | ) | HW_F(HW_IMPLEMENT,__VA_ARGS__) |
Defines the functions that implement an object.
External objects usually rely on functions to implement their HWA actions. These functions are declared by HW_DECLARE()
and defined by HW_IMPLEMENT()
.
#define hw_stat_t | ( | object | ) |
#define hw_uint_t | ( | n | ) |
Declares an unsigned integer.
hw_uint_t(8)
expands to uint8_t
;hw_uint_t(16)
expands to uint16_t
.This is useful when you need to store a value whose size depends on an object:
#define hwa | ( | ... | ) |
hwa( action, object [,...] )
stores an action for an object into a HWA context.
hwa(begin)
or hwa(begin, reset)
.hwa(commit)
triggers the production of the machine code.hwa(nocommit)
does not produce code but is useful to put the context in a known state.