Skip to content

Commit cedb3aa

Browse files
committed
[rp] fix gpio functional
1 parent 6a4aeaf commit cedb3aa

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

src/modm/platform/gpio/rp/base.hpp.in

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ struct Gpio
5959
PushPull
6060
};
6161

62-
enum class
63-
OutputSpeed
64-
{
65-
Slow = 0,
66-
Fast = 1,
67-
};
68-
6962
enum class
7063
DriveStrength
7164
{

src/modm/platform/gpio/rp/set.hpp.in

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ public:
6262
setOutput();
6363
}
6464

65-
static void setOutput(OutputType type, OutputSpeed speed = OutputSpeed::Slow)
65+
static void setOutput(OutputType type, SlewRate speed = SlewRate::Slow)
6666
{
6767
setOutput();
6868
configure(type, speed);
6969
}
7070

71-
static void configure(OutputType, OutputSpeed speed = OutputSpeed::Slow)
71+
static void configure(OutputType, SlewRate speed = SlewRate::Slow)
7272
{
73-
(PortRegs<Gpios::port>::set_speed(Gpios::pin, speed), ...);
73+
(PortRegs<Gpios::port>::set_slewrate(Gpios::pin, uint8_t(speed)), ...);
7474
}
7575

7676
static void setInput()
@@ -96,6 +96,11 @@ public:
9696
(PortRegs<Gpios::port>::set_slewrate(Gpios::pin, uint8_t(rate)), ...);
9797
}
9898

99+
static void setDriveStrength(DriveStrength drive)
100+
{
101+
(PortRegs<Gpios::port>::set_drive(Gpios::pin, uint8_t(drive)), ...);
102+
}
103+
99104
static void set()
100105
{
101106
%% for port, id in ports.items()

src/modm/platform/gpio/rp/static.hpp.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ public:
4545

4646
static void setFunction(uint8_t func) { Regs::set_funcsel(pin, func); }
4747
static void setDriveStrength(DriveStrength strength)
48-
{ Regs::set_drive(pin, strength); }
48+
{ Regs::set_drive(pin, uint8_t(strength)); }
4949

5050
public:
5151
static void setOutput() { PinSet::setOutput(); }
5252
static void setOutput(bool value) { PinSet::setOutput(value); }
53-
static void setOutput(OutputType type, OutputSpeed speed=OutputSpeed::Slow)
53+
static void setOutput(OutputType type, SlewRate speed=SlewRate::Slow)
5454
{ PinSet::setOutput(type, speed); }
55-
static void configure(OutputType type, OutputSpeed speed=OutputSpeed::Slow)
55+
static void configure(OutputType type, SlewRate speed=SlewRate::Slow)
5656
{ PinSet::configure(type, speed); }
5757

5858
static void set() { PinSet::set(); }

0 commit comments

Comments
 (0)