Program Listing for File tbman.h#

Return to documentation for file (src/generated/structs/tbman.h)

#pragma once

#include "../ifgen/common.h"

namespace RP2040
{

struct [[gnu::packed]] tbman
{
    /* Constant attributes. */
    static constexpr std::size_t size = 4;
    /* Fields. */
    const uint32_t PLATFORM =
        {};
    /* Methods. */

    inline bool get_PLATFORM_ASIC() volatile
    {
        return PLATFORM & (1u << 0u);
    }

    inline bool get_PLATFORM_FPGA() volatile
    {
        return PLATFORM & (1u << 1u);
    }

    inline void get_PLATFORM(bool &ASIC, bool &FPGA) volatile
    {
        uint32_t curr = PLATFORM;

        ASIC = curr & (1u << 0u);
        FPGA = curr & (1u << 1u);
    }
};

static_assert(sizeof(tbman) == tbman::size);

static volatile tbman *const TBMAN = reinterpret_cast<tbman *>(0x4006c000);

}; // namespace RP2040