Skip to content

Commit

Permalink
[board] Use SoftwareGpioPort in SAM BSPs
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-durand authored and salkinium committed Feb 4, 2023
1 parent 9dde068 commit afdb5ba
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 58 deletions.
21 changes: 1 addition & 20 deletions src/modm/board/samd21_xplained_pro/board.hpp
Expand Up @@ -63,26 +63,7 @@ struct SystemClock
using Led0 = GpioB30;
using Button = GpioA15;

// No SoftwareGpioPort yet for SAM
struct Leds
{
static constexpr std::size_t width{1};

static void setOutput()
{
Led0::setOutput();
}

static void write(uint32_t value)
{
Led0::set(value & 1);
}

static void toggle()
{
Led0::toggle();
}
};
using Leds = SoftwareGpioPort<Led0>;

struct Debug
{
Expand Down
16 changes: 1 addition & 15 deletions src/modm/board/same54_xplained_pro/board.hpp
Expand Up @@ -69,21 +69,7 @@ struct SystemClock
using Led0 = GpioC18;
using Button = GpioB31;

// No SoftwareGpioPort yet for SAM
struct Leds
{
static constexpr std::size_t width{1};

static void setOutput()
{
Led0::setOutput();
}

static void write(uint32_t value)
{
Led0::set(value & 1);
}
};
using Leds = SoftwareGpioPort<Led0>;

struct Debug
{
Expand Down
24 changes: 1 addition & 23 deletions src/modm/board/samv71_xplained_ultra/board.hpp
Expand Up @@ -53,29 +53,7 @@ using Led0 = GpioA23;
using Led1 = GpioC9;
using ButtonSW0 = GpioA9;

// No SoftwareGpioPort yet for SAM
struct Leds
{
static constexpr std::size_t width{2};

static void setOutput()
{
Led0::setOutput();
Led1::setOutput();
}

static void setOutput(bool state)
{
Led0::setOutput(state);
Led1::setOutput(state);
}

static void write(uint32_t value)
{
Led0::set(value & 1);
Led1::set(value & 2);
}
};
using Leds = SoftwareGpioPort<Led1, Led0>;

struct Debug
{
Expand Down

0 comments on commit afdb5ba

Please sign in to comment.