libboard_zynq: dead code, peripheral & regblock ctor names consistency #63
Loading…
Reference in New Issue
No description provided.
Delete Branch "harry/zynq-rs:cleanup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is an attempt to clean up some code, as well as unify the nomenclature for each peripheral device and their corresponding memory-mapped registers (
RegisterBlock
). The rules for such unification is as follows:struct
intended for accessing each peripheral, e.g. a struct namedPeriph
:struct
is always in PascalCase, not UPPERCASE or lowercase (e.g.sdio::Sdio
,uart::Uart
,ddr::DdrRam
).Periph::periph()
(note: there is an exception:gic::InterruptController::gic()
is named as-is instead ofinterrupt_controller()
).Periph::periph0()
,Periph::periph1()
, etc.struct
intended for accessing the memory-mapped register(s) for each module, e.g. a set of registers defined inmodule::regs
:struct
is always namedmodule::RegisterBlock
, regardless of its implementation (e.g.i2c::regs::RegisterBlock
is not actually using the I2C controller registers on Zynq, but the GPIO registers for bitbanging).ddr::regs::RegisterBlock::ddrc()
), or its module name if software register name is inapplicable (e.g.i2c::regs::RegisterBlock::i2c()
, sincei2c0
ori2c1
are the I2C controller register names)uart::regs::RegisterBlock::uart0()
,uart::regs::RegisterBlock::uart1()
).@astro can you review this?
These proposals make 100% sense. It was my negligence that I didn't name things like that in the first place.