upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/tests/unit/stubs/driver/gpio.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/stubs/driver/gpio.h')
-rw-r--r--tests/unit/stubs/driver/gpio.h44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/unit/stubs/driver/gpio.h b/tests/unit/stubs/driver/gpio.h
new file mode 100644
index 0000000..d8dda0a
--- /dev/null
+++ b/tests/unit/stubs/driver/gpio.h
@@ -0,0 +1,44 @@
1#ifndef STUBS_DRIVER_GPIO_H
2#define STUBS_DRIVER_GPIO_H
3
4#include <stdint.h>
5
6typedef enum {
7 GPIO_MODE_DISABLE = 0,
8 GPIO_MODE_INPUT,
9 GPIO_MODE_OUTPUT,
10 GPIO_MODE_OUTPUT_OD,
11 GPIO_MODE_INPUT_OUTPUT_OD,
12 GPIO_MODE_INPUT_OUTPUT,
13} gpio_mode_t;
14
15typedef enum {
16 GPIO_INTR_DISABLE = 0,
17} gpio_int_type_t;
18
19typedef enum {
20 GPIO_PULLUP_DISABLE = 0,
21 GPIO_PULLUP_ENABLE,
22} gpio_pullup_t;
23
24typedef enum {
25 GPIO_PULLDOWN_DISABLE = 0,
26 GPIO_PULLDOWN_ENABLE,
27} gpio_pulldown_t;
28
29typedef struct {
30 uint64_t pin_bit_mask;
31 gpio_mode_t mode;
32 gpio_pullup_t pull_up_en;
33 gpio_pulldown_t pull_down_en;
34 gpio_int_type_t intr_type;
35} gpio_config_t;
36
37static inline int gpio_config(const gpio_config_t *cfg) { (void)cfg; return 0; }
38static inline int gpio_set_level(uint32_t gpio_num, uint32_t level) { (void)gpio_num; (void)level; return 0; }
39
40#define GPIO_INTR_DISABLE 0
41#define GPIO_PULLUP_DISABLE 0
42#define GPIO_PULLDOWN_DISABLE 0
43
44#endif