Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Module.h */
- #ifndef STM32_HAL_MODULE_H
- #define STM32_HAL_MODULE_H
- #include "main.h"
- extern "C"
- {
- #define GENERAL_INIT \
- if (init == nullptr) \
- { \
- initTemplate.Mode = GPIO_MODE_OUTPUT_PP; \
- initTemplate.Pull = GPIO_PULLDOWN; \
- initTemplate.Speed = GPIO_SPEED_FREQ_LOW; \
- } \
- else \
- { \
- initTemplate.Mode = init->Mode; \
- initTemplate.Pull = init->Pull; \
- initTemplate.Speed = init->Speed; \
- }
- class Module
- {
- public:
- GPIO_TypeDef *gpio;
- uint16_t pin;
- Module(GPIO_TypeDef *gpio, uint16_t pinAt) : gpio(gpio), pin(pinAt) {};
- };
- }
- #endif
- // Module.cpp is empty
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement