semilimes mcu sdk 1.0.1
semilimes Software Development Kit for microcontrollers
Loading...
Searching...
No Matches
device.h
1#ifndef _device_
2#define _device_
3
4#include "../defines.h"
5
6class Device
7{
8private:
9 #define headerSize 11
10 #define headerPinSize 64
11 #define headerFunctionSize 27
12 SmeJson json_data;
13 char* json = nullptr;
14 char* jsonPins = nullptr;
15 char* jsonFunctions = nullptr;
16
17public:
18// variable: Device.pinTypes
19
20// describes the type of the pin
22 char pinTypes[5][10] = {"out", "in", "analogIn", "analogOut", "pwm"};
23
24// Function: Device.set
25
26// an object that describes the device from the hw perspective
27
28// Prototype:
29// void Device::set(char* name);
30
31// Parameters:
33
34// Returns:
36 void set(char* name);
37
38// Function: Device.addGPIO
39
40// add a GPIO to an array that describes the hw interface capabilities of the device
41
42// Prototype:
43// void Device::addGPIO(char* name, char* pinType, char* portName, int pinNumber, int value);
44
45// Parameters:
51
52// Returns:
54 void addGPIO(char* name, char* GPIOType, char* portName, int pinNumber, int value);
55
56// Function: Device.appendGPIOs
57
58// Append the selected GPIO
59
60// Prototype:
61// void Device::appendGPIOs();
62
63// Parameters:
64
65// Returns:
67 void appendGPIOs();
68
69// Function: Device.addFunction
70
71// add an array of internal methods/functions
72
73// Prototype:
74// void Device::addFunction(char* name, char* methodName);
75
76// Parameters:
79
80// Returns:
82 void addFunction(char* name, char* methodName);
83
84// Function: Device.appendFunctions
85
86// Append the selected functions
87
88// Prototype:
89// void Device::appendFunctions();
90
91// Parameters:
92
93// Returns:
95
96 void appendFunctions();
97
98// Function: Device.get
99
100// return the json script
101
102// Prototype:
103// void Device::get();
104
105// Parameters:
106
107// Returns:
109 char* get();
110};
111
112#endif
Definition device.h:7
void appendFunctions()
Definition device.cpp:137
char * get()
Definition device.cpp:156
void set(char *name)
Definition device.cpp:16
void addFunction(char *name, char *methodName)
Definition device.cpp:83
char pinTypes[5][10]
Definition device.h:22
void addGPIO(char *name, char *GPIOType, char *portName, int pinNumber, int value)
Definition device.cpp:43
void appendGPIOs()
Definition device.cpp:118