-
I find it a bit confusing to have some peripheral interfaces declared in
I understand that I have the impression I am missing something. Please enlighten me. |
Beta Was this translation helpful? Give feedback.
Replies: 12 comments
-
Everything that's can be implemented on every platform is declared in architecture. The current STM32 timer classes aren't much of an interface, they wrap the registers in a nicer way. It should be called In that sense, You can technically generate different interfaces for different targets with lbuild and simply move the platform-specific interfaces from the So the concepts are applied differently, we simply never created platform-indepentent interfaces for Timers. I assume because it's not as straight forward as Uart, I2c, SPI, Can, which are at least fairly standardized protocols. What protocols can the Timers implement? Pwm, (Quad-)Encoder inputs, Input Capture, etc. Those would be the platform-independent interfaces I'd love to see in |
Beta Was this translation helpful? Give feedback.
-
Thank your for your answer @salkinium! This sentence was the key for my understanding:
I am thinking about, if this insight can be incorperated into the documentation. |
Beta Was this translation helpful? Give feedback.
-
Yes, such general ideas should be described in the |
Beta Was this translation helpful? Give feedback.
-
Correct me if I am wrong: I can blindly include the modm:architecture:* modules regardless of the target, and lbuild will do its black magic. So, in a multi-target project, I can have a common.xml having all the modm:architecture:* and then specialized single-target target.xml extending it with modm:platform:* modules? |
Beta Was this translation helpful? Give feedback.
-
Yes, you can theoretically to |
Beta Was this translation helpful? Give feedback.
-
It's just a dependency graph, you can do |
Beta Was this translation helpful? Give feedback.
-
You can also rename |
Beta Was this translation helpful? Give feedback.
-
Does it accept wildcards or you just used the wildcard for talking sake?
Awesome! |
Beta Was this translation helpful? Give feedback.
-
Yes, along full hierarchical name resolution: https://github.com/modm-io/lbuild#name-resolution |
Beta Was this translation helpful? Give feedback.
Everything that's can be implemented on every platform is declared in architecture.
The current STM32 timer classes aren't much of an interface, they wrap the registers in a nicer way. It should be called
modm::platform::Timer6Hal
, to be consistent with for example themodm::platform::UsartHalN
, which is then used to implement bothmodm::platform::UartN
to satisfy themodm::Uart
interface andmodm::platform::UartSpiMasterN
formodm::SpiMaster
.Note that you can pass the classes implementing
modm::Uart
,modm::SpiMaster
andmodm::I2cMaster
to any driver in:driver
, since they use that common interface regardless of the target.In that sense,
modm::platform::Timer6Hal
could be used to implem…