mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Merge branch 'docs/update_arguments_reg_set_bits' into 'master'
docs: update arguments of REG_SET_BITS See merge request espressif/esp-idf!26145
This commit is contained in:
commit
d33ee17dee
@ -537,7 +537,7 @@ Register Access Macros
|
||||
|
||||
Previously, all register access macros could be used as expressions, so the following was allowed::
|
||||
|
||||
uint32_t val = REG_SET_BITS(reg, mask);
|
||||
uint32_t val = REG_SET_BITS(reg, bits, mask);
|
||||
|
||||
In ESP-IDF v5.0, register access macros which write or read-modify-write the register can no longer be used as expressions, and can only be used as statements. This applies to the following macros: ``REG_WRITE``, ``REG_SET_BIT``, ``REG_CLR_BIT``, ``REG_SET_BITS``, ``REG_SET_FIELD``, ``WRITE_PERI_REG``, ``CLEAR_PERI_REG_MASK``, ``SET_PERI_REG_MASK``, ``SET_PERI_REG_BITS``.
|
||||
|
||||
@ -548,5 +548,5 @@ To store the value which would have been written into the register, split the op
|
||||
|
||||
To get the value of the register after modification (which may be different from the value written), add an explicit read::
|
||||
|
||||
REG_SET_BITS(reg, mask);
|
||||
REG_SET_BITS(reg, bits, mask);
|
||||
uint32_t new_val = REG_READ(reg);
|
||||
|
@ -537,7 +537,7 @@ LCD
|
||||
|
||||
更新前,所有用于访问寄存器的宏都可以作为表达式来使用,所以以下命令是允许的::
|
||||
|
||||
uint32_t val = REG_SET_BITS(reg, mask);
|
||||
uint32_t val = REG_SET_BITS(reg, bits, mask);
|
||||
|
||||
在 ESP-IDF v5.0 中,用于写入或读取-修改-写入寄存器的宏不能再作为表达式使用,而只能作为语句使用,这适用于以下宏: ``REG_WRITE``, ``REG_SET_BIT``, ``REG_CLR_BIT``, ``REG_SET_BITS``, ``REG_SET_FIELD``, ``WRITE_PERI_REG``, ``CLEAR_PERI_REG_MASK``, ``SET_PERI_REG_MASK``, ``SET_PERI_REG_BITS``。
|
||||
|
||||
@ -548,5 +548,5 @@ LCD
|
||||
|
||||
要获得修改后的寄存器的值(该值可能与写入的值不同),要增加一个显示的读取命令::
|
||||
|
||||
REG_SET_BITS(reg, mask);
|
||||
REG_SET_BITS(reg, bits, mask);
|
||||
uint32_t new_val = REG_READ(reg);
|
||||
|
Loading…
Reference in New Issue
Block a user