Modbus Vault v1.0
Loading...
Searching...
No Matches
debug_pins.h
Go to the documentation of this file.
1
10#ifndef DEBUG_PINS_H
11#define DEBUG_PINS_H
12
13#include "driver/gpio.h"
14#include "sdkconfig.h"
15
16// Define the GPIO numbers in one place
27#define PINS_TABLE(ENTRY) \
28 ENTRY (DEBUG_PINS_FRAME_CAPTURE, (GPIO_NUM_6)) \
29 ENTRY (DEBUG_PINS_FRAME_SERIALIZED, (GPIO_NUM_7)) \
30 ENTRY (DEBUG_PINS_FRAME_PUBLISHED, (GPIO_NUM_8)) \
31 ENTRY (DEBUG_PINS_FRAME_LOGGED, (GPIO_NUM_9))
32
39typedef enum {
41#define AS_ENUM(pin_name, pin_num) pin_name = pin_num,
43#undef AS_ENUM
45
46#ifdef CONFIG_DEBUG_PINS_ENABLE
48#define DEBUG_GPIO_SET(pin) gpio_set_level (pin, 1)
50#define DEBUG_GPIO_CLR(pin) gpio_set_level (pin, 0)
51#else
53#define DEBUG_GPIO_SET(pin)
55#define DEBUG_GPIO_CLR(pin)
56#endif
57
65esp_err_t init_debug_pins (void);
66
67#endif
debug_pins_t
Debug pins Enums.
Definition debug_pins.h:39
#define AS_ENUM(pin_name, pin_num)
Definition debug_pins.h:41
#define PINS_TABLE(ENTRY)
Debug pins table.
Definition debug_pins.h:27
esp_err_t init_debug_pins(void)
Initiate debug pins if any.
Definition debug_pins.c:20