File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed
src/modm/platform/gpio/sam Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,7 @@ template<class... PinConfigs>
278
278
struct PinCfgMixin
279
279
{
280
280
inline static void set(uint8_t){};
281
+ inline static void set(uint8_t, uint8_t){};
281
282
};
282
283
283
284
template<class PinConfig, class... PinConfigs>
@@ -292,6 +293,18 @@ struct PinCfgMixin<PinConfig, PinConfigs...>
292
293
%% endfor
293
294
PinCfgMixin<PinConfigs...>::set(cfg);
294
295
}
296
+
297
+ inline static void
298
+ set(uint8_t setBits, uint8_t clearMask)
299
+ {
300
+ %% for port in ports
301
+ if constexpr (PinConfig::port == PortName::{{ port }}) {
302
+ auto& reg = PORT->Group[{{loop.index0}}].PINCFG[PinConfig::pin].reg;
303
+ reg = (reg & (~clearMask)) | setBits;
304
+ }
305
+ %% endfor
306
+ PinCfgMixin<PinConfigs...>::set(setBits, clearMask);
307
+ }
295
308
};
296
309
297
310
template<class... PinConfigs>
@@ -371,7 +384,7 @@ public:
371
384
configure(InputType type)
372
385
{
373
386
set(type == InputType::PullUp);
374
- PinCfg::set(PORT_PINCFG_INEN | (type != InputType::Floating) << PORT_PINCFG_PULLEN_Pos);
387
+ PinCfg::set(PORT_PINCFG_INEN | (type != InputType::Floating) << PORT_PINCFG_PULLEN_Pos, PORT_PINCFG_PULLEN );
375
388
}
376
389
377
390
static void
You can’t perform that action at this time.
0 commit comments