Program Listing for File IO_BANK0_GPIO6_CTRL_FUNCSEL.h#

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

#pragma once

#include <cstdint>
#include <cstring>

namespace RP2040
{

enum class IO_BANK0_GPIO6_CTRL_FUNCSEL : uint8_t
{
    spi0_sclk = 1,
    uart1_cts = 2,
    i2c1_sda = 3,
    pwm_a_3 = 4,
    sio_6 = 5,
    pio0_6 = 6,
    pio1_6 = 7,
    usb_muxing_extphy_softcon = 8,
    usb_muxing_overcurr_detect = 9,
    null = 31
};
static_assert(sizeof(IO_BANK0_GPIO6_CTRL_FUNCSEL) == 1);

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

    switch (instance)
    {
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::spi0_sclk:
        result = "spi0_sclk";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::uart1_cts:
        result = "uart1_cts";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::i2c1_sda:
        result = "i2c1_sda";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::pwm_a_3:
        result = "pwm_a_3";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::sio_6:
        result = "sio_6";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::pio0_6:
        result = "pio0_6";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::pio1_6:
        result = "pio1_6";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::usb_muxing_extphy_softcon:
        result = "usb_muxing_extphy_softcon";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::usb_muxing_overcurr_detect:
        result = "usb_muxing_overcurr_detect";
        break;
    case IO_BANK0_GPIO6_CTRL_FUNCSEL::null:
        result = "null";
        break;
    }

    return result;
}

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

    if ((result = !strncmp(data, "spi0_sclk", 9)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::spi0_sclk;
    }
    else if ((result = !strncmp(data, "uart1_cts", 9)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::uart1_cts;
    }
    else if ((result = !strncmp(data, "i2c1_sda", 8)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::i2c1_sda;
    }
    else if ((result = !strncmp(data, "pwm_a_3", 7)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::pwm_a_3;
    }
    else if ((result = !strncmp(data, "sio_6", 5)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::sio_6;
    }
    else if ((result = !strncmp(data, "pio0_6", 6)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::pio0_6;
    }
    else if ((result = !strncmp(data, "pio1_6", 6)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::pio1_6;
    }
    else if ((result = !strncmp(data, "usb_muxing_extphy_softcon", 25)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::usb_muxing_extphy_softcon;
    }
    else if ((result = !strncmp(data, "usb_muxing_overcurr_detect", 26)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::usb_muxing_overcurr_detect;
    }
    else if ((result = !strncmp(data, "null", 4)))
    {
        output = IO_BANK0_GPIO6_CTRL_FUNCSEL::null;
    }

    return result;
}

}; // namespace RP2040