Smart Remote 3 nRF52 v1.2
app_debug_pin.h
1 /*$$$LICENCE_NORDIC_STANDARD<2016>$$$*/
2 
12 #ifndef __APP_DEBUG_PIN_H__
13 #define __APP_DEBUG_PIN_H__
14 
15 #include <stdint.h>
16 
17 #include "nrf.h"
18 #include "sr3_config.h"
19 
20 #if CONFIG_DEBUG_PIN_ENABLED
21 
22 #define DBG_PIN_PULSE(pin) debug_pin_pulse(pin)
23 #define DBG_PIN_SET(pin) debug_pin_set(pin)
24 #define DBG_PIN_CLEAR(pin) debug_pin_clear(pin)
25 #define DBG_PIN_TOGGLE(pin) debug_pin_toggle(pin)
26 #define DBG_PIN_FLAG(pin, flag) debug_pin_flag(pin, flag)
27 #define DBG_PIN_SEND(word, bits) debug_pin_send(word, bits)
28 
32 void debug_pin_init(void);
33 
38 void debug_pin_pulse(const unsigned int pin);
39 
44 void debug_pin_set(const unsigned int pin);
45 
50 void debug_pin_clear(const unsigned int pin);
51 
56 void debug_pin_toggle(const unsigned int pin);
57 
63 void debug_pin_flag(const unsigned int pin, bool flag);
64 
73 void debug_pin_send(const uint32_t word, const uint8_t bits);
74 
82 void debug_pin_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name);
83 
84 #else /* !CONFIG_DEBUG_PIN_ENABLED */
85 
86 #define DBG_PIN_PULSE(pin) do { } while (0)
87 #define DBG_PIN_SET(pin) do { } while (0)
88 #define DBG_PIN_CLEAR(pin) do { } while (0)
89 #define DBG_PIN_TOGGLE(pin) do { } while (0)
90 #define DBG_PIN_FLAG(pin, flag) do { } while (0)
91 #define DBG_PIN_SEND(word, bits) do { } while (0)
92 
93 __STATIC_INLINE void debug_pin_init(void)
94 {
95  // Do nothing.
96 }
97 
98 __STATIC_INLINE void debug_pin_pulse(const unsigned int pin)
99 {
100  // Do nothing.
101 }
102 
103 __STATIC_INLINE void debug_pin_set(const unsigned int pin)
104 {
105  // Do nothing.
106 }
107 
108 __STATIC_INLINE void debug_pin_clear(const unsigned int pin)
109 {
110  // Do nothing.
111 }
112 
113 __STATIC_INLINE void debug_pin_toggle(const unsigned int pin)
114 {
115  // Do nothing.
116 }
117 
118 __STATIC_INLINE void debug_pin_flag(const unsigned int pin, bool flag)
119 {
120  // Do nothing.
121 }
122 
123 __STATIC_INLINE void debug_pin_send(const uint32_t word, const uint8_t bits)
124 {
125  // Do nothing.
126 }
127 
128 __STATIC_INLINE void debug_pin_error_handler(uint32_t error_code, uint32_t line_num, const uint8_t *p_file_name)
129 {
130  // Do nothing.
131 }
132 
133 #endif /* CONFIG_DEBUG_PIN_ENABLED */
134 #endif /* __APP_DEBUG_PIN_H__ */
135 

Documentation feedback | Developer Zone | Subscribe | Updated