Commit 0b711148 authored by Benoit Rat's avatar Benoit Rat

c_headers: Add _MASK and _PREFIX for BIT/MONOSTABLE type

parent 42f285a3
......@@ -36,6 +36,10 @@ function cgen_c_field_define(field, reg, index)
emit(string.format("%-45s %s", "#define "..prefix.."_NAME", "\""..field.name.."\""));
emit(string.format("%-45s %s", "#define "..prefix.."_DESC", "WBGEN2_DESC(\""..field.description:gsub("\n.*", "").."\")"));
emit(string.format("%-45s %s", "#define "..prefix.."_ACCESS", "WBGEN2_"..rw_table[field.access_bus]));
if(field.type == BIT or field.type == MONOSTABLE) then
emit(string.format("%-45s %s", "#define "..prefix.."_MASK", "WBGEN2_GEN_MASK("..field.offset..", "..field.size..")"));
emit(string.format("%-45s %d", "#define "..prefix.."_SHIFT", field.offset));
end
end
-- for bit-type fields, emit only masks
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment