Is there any way to produce a Type by cat strings together?

I think you have already posted the answer:

for bits in [8,16,32]
    name = Symbol("D",bits)
    t = Symbol("UInt", bits)
    @eval struct $name
        addr::UInt32
        data::$t
    end
end
3 Likes