Skip to content

Commit

Permalink
Add but not yet boot nor use LED0
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Jul 21, 2024
1 parent 8a5d707 commit d911e37
Showing 1 changed file with 32 additions and 8 deletions.
40 changes: 32 additions & 8 deletions ref_app/src/mcal/rpi_pico_rp2040/mcal_led.cpp
Original file line number Diff line number Diff line change
@@ -1,21 +1,45 @@
///////////////////////////////////////////////////////////////////////////////
// Copyright Christopher Kormanyos 2007 - 2020.
// Copyright Christopher Kormanyos 2007 - 2024.
// Distributed under the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt
// or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include <Gpio/Gpio.h>

#include <mcal_led.h>
#include <mcal_led/mcal_led_port.h>
#include <mcal_led/mcal_led_boolean_state_base.h>

mcal::led::led_base& mcal::led::led0()
namespace mcal
{
using led0_port_type = mcal::port::port_pin<std::uint32_t,
std::uint32_t,
mcal::reg::gpioc_odr,
UINT32_C(8)>;
namespace led
{
class led_rp2040_green : public mcal::led::led_boolean_state_base
{
public:
led_rp2040_green()
{
LED_GREEN_OFF();
LED_GREEN_CFG();
}

~led_rp2040_green() override = default;

auto toggle() -> void override
{
using base_class_type = led_boolean_state_base;

LED_GREEN_TOGGLE();

using led0_led_type = mcal::led::led_port<led0_port_type>;
base_class_type::toggle();
}
};
}
}

mcal::led::led_base& mcal::led::led0()
{
using led0_led_type = mcal::led::led_rp2040_green;

static led0_led_type l0;

Expand Down

0 comments on commit d911e37

Please sign in to comment.