D | reg_access.h | 4 * SPDX-License-Identifier: Apache-2.0 11 * NPCX register bit/field access operations 13 #define IS_BIT_SET(reg, bit) (((reg >> bit) & (0x1)) != 0) argument 17 #define FIELD_POS(field) GET_POS_##field argument 18 #define FIELD_SIZE(field) GET_SIZE_##field argument 20 #define GET_FIELD(reg, field) \ argument 21 _GET_FIELD_(reg, FIELD_POS(field), FIELD_SIZE(field)) 22 #define _GET_FIELD_(reg, f_pos, f_size) (((reg)>>(f_pos)) & ((1<<(f_size))-1)) 24 #define SET_FIELD(reg, field, value) \ argument 25 _SET_FIELD_(reg, FIELD_POS(field), FIELD_SIZE(field), value) [all …]
|