File tree 3 files changed +11
-13
lines changed
src/modm/platform/gpio/rp
3 files changed +11
-13
lines changed Original file line number Diff line number Diff line change @@ -59,13 +59,6 @@ struct Gpio
59
59
PushPull
60
60
};
61
61
62
- enum class
63
- OutputSpeed
64
- {
65
- Slow = 0,
66
- Fast = 1,
67
- };
68
-
69
62
enum class
70
63
DriveStrength
71
64
{
Original file line number Diff line number Diff line change @@ -62,15 +62,15 @@ public:
62
62
setOutput();
63
63
}
64
64
65
- static void setOutput(OutputType type, OutputSpeed speed = OutputSpeed ::Slow)
65
+ static void setOutput(OutputType type, SlewRate speed = SlewRate ::Slow)
66
66
{
67
67
setOutput();
68
68
configure(type, speed);
69
69
}
70
70
71
- static void configure(OutputType, OutputSpeed speed = OutputSpeed ::Slow)
71
+ static void configure(OutputType, SlewRate speed = SlewRate ::Slow)
72
72
{
73
- (PortRegs<Gpios::port>::set_speed (Gpios::pin, speed), ...);
73
+ (PortRegs<Gpios::port>::set_slewrate (Gpios::pin, uint8_t( speed) ), ...);
74
74
}
75
75
76
76
static void setInput()
@@ -96,6 +96,11 @@ public:
96
96
(PortRegs<Gpios::port>::set_slewrate(Gpios::pin, uint8_t(rate)), ...);
97
97
}
98
98
99
+ static void setDriveStrength(DriveStrength drive)
100
+ {
101
+ (PortRegs<Gpios::port>::set_drive(Gpios::pin, uint8_t(drive)), ...);
102
+ }
103
+
99
104
static void set()
100
105
{
101
106
%% for port, id in ports.items()
Original file line number Diff line number Diff line change @@ -45,14 +45,14 @@ public:
45
45
46
46
static void setFunction(uint8_t func) { Regs::set_funcsel(pin, func); }
47
47
static void setDriveStrength(DriveStrength strength)
48
- { Regs::set_drive(pin, strength); }
48
+ { Regs::set_drive(pin, uint8_t( strength) ); }
49
49
50
50
public:
51
51
static void setOutput() { PinSet::setOutput(); }
52
52
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)
54
54
{ PinSet::setOutput(type, speed); }
55
- static void configure(OutputType type, OutputSpeed speed=OutputSpeed ::Slow)
55
+ static void configure(OutputType type, SlewRate speed=SlewRate ::Slow)
56
56
{ PinSet::configure(type, speed); }
57
57
58
58
static void set() { PinSet::set(); }
You can’t perform that action at this time.
0 commit comments