Skip to content

Commit 4f6f878

Browse files
committed
added interrupt edge triggers to the dummy pin
1 parent 6a57a1d commit 4f6f878

1 file changed

Lines changed: 26 additions & 0 deletions

File tree

klib/io/port.hpp

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,38 @@ namespace klib::io {
1111
template <bool Value = false>
1212
class pin_dummy {
1313
public:
14+
// using for the array of callbacks
15+
using interrupt_callback = void(*)();
16+
17+
/**
18+
* @brief Enum for the dummy edge interrupts
19+
*
20+
*/
21+
enum class edge {
22+
falling,
23+
rising,
24+
dual_edge,
25+
low_level,
26+
high_level,
27+
};
28+
1429
/**
1530
* @brief Init the fake pin
1631
*
1732
*/
1833
constexpr static void init() {}
1934

35+
/**
36+
* @brief Init the fake pin using a edge trigger
37+
*
38+
* @note Will not do anything
39+
*
40+
* @tparam Edge
41+
* @param callback
42+
*/
43+
template <edge Edge>
44+
constexpr static void init(interrupt_callback callback) {}
45+
2046
/**
2147
* @brief Get the value of the pin
2248
*

0 commit comments

Comments
 (0)