Program Listing for File IO_BANK0_GPIO11_CTRL_FUNCSEL.h#

Return to documentation for file (src/generated/enums/IO_BANK0_GPIO11_CTRL_FUNCSEL.h)

#pragma once

#include <cstdint>
#include <cstring>

namespace RP2040
{

enum class IO_BANK0_GPIO11_CTRL_FUNCSEL : uint8_t
{
    spi1_tx = 1,
    uart1_rts = 2,
    i2c1_scl = 3,
    pwm_b_5 = 4,
    sio_11 = 5,
    pio0_11 = 6,
    pio1_11 = 7,
    usb_muxing_extphy_suspnd = 8,
    usb_muxing_vbus_en = 9,
    null = 31
};
static_assert(sizeof(IO_BANK0_GPIO11_CTRL_FUNCSEL) == 1);

inline const char *to_string(IO_BANK0_GPIO11_CTRL_FUNCSEL instance)
{
    const char *result = "UNKNOWN IO_BANK0_GPIO11_CTRL_FUNCSEL";

    switch (instance)
    {
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::spi1_tx:
        result = "spi1_tx";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::uart1_rts:
        result = "uart1_rts";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::i2c1_scl:
        result = "i2c1_scl";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::pwm_b_5:
        result = "pwm_b_5";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::sio_11:
        result = "sio_11";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::pio0_11:
        result = "pio0_11";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::pio1_11:
        result = "pio1_11";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::usb_muxing_extphy_suspnd:
        result = "usb_muxing_extphy_suspnd";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::usb_muxing_vbus_en:
        result = "usb_muxing_vbus_en";
        break;
    case IO_BANK0_GPIO11_CTRL_FUNCSEL::null:
        result = "null";
        break;
    }

    return result;
}

inline bool from_string(const char *data, IO_BANK0_GPIO11_CTRL_FUNCSEL &output)
{
    bool result = false;

    if ((result = !strncmp(data, "spi1_tx", 7)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::spi1_tx;
    }
    else if ((result = !strncmp(data, "uart1_rts", 9)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::uart1_rts;
    }
    else if ((result = !strncmp(data, "i2c1_scl", 8)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::i2c1_scl;
    }
    else if ((result = !strncmp(data, "pwm_b_5", 7)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::pwm_b_5;
    }
    else if ((result = !strncmp(data, "sio_11", 6)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::sio_11;
    }
    else if ((result = !strncmp(data, "pio0_11", 7)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::pio0_11;
    }
    else if ((result = !strncmp(data, "pio1_11", 7)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::pio1_11;
    }
    else if ((result = !strncmp(data, "usb_muxing_extphy_suspnd", 24)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::usb_muxing_extphy_suspnd;
    }
    else if ((result = !strncmp(data, "usb_muxing_vbus_en", 18)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::usb_muxing_vbus_en;
    }
    else if ((result = !strncmp(data, "null", 4)))
    {
        output = IO_BANK0_GPIO11_CTRL_FUNCSEL::null;
    }

    return result;
}

}; // namespace RP2040