Add esp/iomux_regs.h
This commit is contained in:
parent
3eee1a9845
commit
2ffd3da71e
7 changed files with 197 additions and 180 deletions
core/include
|
@ -16,6 +16,15 @@
|
|||
#define BIT(X) (1<<(X))
|
||||
#endif
|
||||
|
||||
/* These macros convert values to/from bitfields specified by *_M and *_S (mask
|
||||
* and shift) constants. Used primarily with ESP8266 register access.
|
||||
*/
|
||||
|
||||
#define VAL2FIELD(fieldname, value) (((value) & fieldname##_M) << fieldname##_S)
|
||||
#define FIELD2VAL(fieldname, regbits) (((regbits) >> fieldname##_S) & fieldname##_M)
|
||||
|
||||
#define SETFIELD(regbits, fieldname, value) (((regbits) & ~(fieldname##_M << fieldname##_S)) | VAL2FIELD(fieldname, value))
|
||||
|
||||
/* Use this macro to store constant values in IROM flash instead
|
||||
of having them loaded into rodata (which resides in DRAM)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue