Krolyxon
Commit 3120783

Branches

Tags

Refs →

orion-rf.piolibdepsesp32-s3-n16r8RF24utilityTemplategpio.h

67 lines · 1.2 KB · Objective-C

1/**
2 * @file gpio.h
3 * Class declaration for SPI helper files
4 */
5
6/**
7 * Example of gpio.h class declaration for GPIO portability
8 *
9 * @defgroup Porting_GPIO Porting: GPIO
10 * @{
11 */
12#ifndef RF24_UTILITY_TEMPLATE_GPIO_H_
13#define RF24_UTILITY_TEMPLATE_GPIO_H_
14
15#include <cstdio>
16
17#ifndef DOXYGEN_FORCED
18// exclude this line from the docs to prevent displaying in the list of classes
19class GPIO
20#endif
21{
22
23public:
24 /* Constants */
25 static const int DIRECTION_OUT = 1;
26 static const int DIRECTION_IN = 0;
27
28 static const int OUTPUT_HIGH = 1;
29 static const int OUTPUT_LOW = 0;
30
31 GPIO();
32
33 /**
34 * Similar to Arduino pinMode(pin,mode);
35 * @param port
36 * @param DDR
37 */
38 static void open(int port, int DDR);
39
40 /**
41 *
42 * @param port
43 */
44 static void close(int port);
45
46 /**
47 * Similar to Arduino digitalRead(pin);
48 * @param port
49 */
50 static int read(int port);
51
52 /**
53 * Similar to Arduino digitalWrite(pin,state);
54 * @param port
55 * @param value
56 */
57 static void write(int port, int value);
58
59#ifndef DOXYGEN_FORCED
60 // exclude this line from the docs to prevent warnings docs generators
61 virtual ~GPIO();
62#endif
63};
64
65/**@}*/
66
67#endif // RF24_UTILITY_TEMPLATE_GPIO_H_