2020-12-06 10:33:42 +00:00
|
|
|
/* Automatically generated nanopb header */
|
2022-06-17 13:37:52 +00:00
|
|
|
/* Generated by nanopb-0.4.6 */
|
2020-12-06 10:33:42 +00:00
|
|
|
|
|
|
|
#ifndef PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
|
|
|
#define PB_REMOTE_HARDWARE_PB_H_INCLUDED
|
|
|
|
#include <pb.h>
|
|
|
|
|
|
|
|
#if PB_PROTO_HEADER_VERSION != 40
|
|
|
|
#error Regenerate this file with the current version of nanopb generator.
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Enum definitions */
|
2022-03-26 14:48:35 +00:00
|
|
|
typedef enum _HardwareMessage_Type {
|
|
|
|
HardwareMessage_Type_UNSET = 0,
|
|
|
|
HardwareMessage_Type_WRITE_GPIOS = 1,
|
|
|
|
HardwareMessage_Type_WATCH_GPIOS = 2,
|
|
|
|
HardwareMessage_Type_GPIOS_CHANGED = 3,
|
|
|
|
HardwareMessage_Type_READ_GPIOS = 4,
|
|
|
|
HardwareMessage_Type_READ_GPIOS_REPLY = 5
|
2020-12-07 02:18:11 +00:00
|
|
|
} HardwareMessage_Type;
|
2020-12-06 10:33:42 +00:00
|
|
|
|
|
|
|
/* Struct definitions */
|
2022-03-26 14:48:35 +00:00
|
|
|
/* An example app to show off the module system. This message is used for
|
|
|
|
REMOTE_HARDWARE_APP PortNums.
|
|
|
|
Also provides easy remote access to any GPIO.
|
|
|
|
In the future other remote hardware operations can be added based on user interest
|
|
|
|
(i.e. serial output, spi/i2c input/output).
|
|
|
|
FIXME - currently this feature is turned on by default which is dangerous
|
|
|
|
because no security yet (beyond the channel mechanism).
|
|
|
|
It should be off by default and then protected based on some TBD mechanism
|
|
|
|
(a special channel once multichannel support is included?) */
|
|
|
|
typedef struct _HardwareMessage {
|
|
|
|
/* What type of HardwareMessage is this? */
|
2022-09-09 09:19:18 +00:00
|
|
|
HardwareMessage_Type type;
|
2022-03-26 14:48:35 +00:00
|
|
|
/* What gpios are we changing. Not used for all MessageTypes, see MessageType for details */
|
2022-06-17 13:37:52 +00:00
|
|
|
uint64_t gpio_mask;
|
2022-03-26 14:48:35 +00:00
|
|
|
/* For gpios that were listed in gpio_mask as valid, what are the signal levels for those gpios.
|
|
|
|
Not used for all MessageTypes, see MessageType for details */
|
2022-06-17 13:37:52 +00:00
|
|
|
uint64_t gpio_value;
|
2020-12-06 10:33:42 +00:00
|
|
|
} HardwareMessage;
|
|
|
|
|
|
|
|
|
|
|
|
/* Helper constants for enums */
|
2020-12-07 02:18:11 +00:00
|
|
|
#define _HardwareMessage_Type_MIN HardwareMessage_Type_UNSET
|
|
|
|
#define _HardwareMessage_Type_MAX HardwareMessage_Type_READ_GPIOS_REPLY
|
|
|
|
#define _HardwareMessage_Type_ARRAYSIZE ((HardwareMessage_Type)(HardwareMessage_Type_READ_GPIOS_REPLY+1))
|
2020-12-06 10:33:42 +00:00
|
|
|
|
|
|
|
|
2020-12-11 01:11:53 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2020-12-06 10:33:42 +00:00
|
|
|
/* Initializer values for message structs */
|
2020-12-07 02:18:11 +00:00
|
|
|
#define HardwareMessage_init_default {_HardwareMessage_Type_MIN, 0, 0}
|
|
|
|
#define HardwareMessage_init_zero {_HardwareMessage_Type_MIN, 0, 0}
|
2020-12-06 10:33:42 +00:00
|
|
|
|
|
|
|
/* Field tags (for use in manual encoding/decoding) */
|
2022-09-09 09:19:18 +00:00
|
|
|
#define HardwareMessage_type_tag 1
|
2020-12-06 10:33:42 +00:00
|
|
|
#define HardwareMessage_gpio_mask_tag 2
|
|
|
|
#define HardwareMessage_gpio_value_tag 3
|
|
|
|
|
|
|
|
/* Struct field encoding specification for nanopb */
|
|
|
|
#define HardwareMessage_FIELDLIST(X, a) \
|
2022-09-09 09:19:18 +00:00
|
|
|
X(a, STATIC, SINGULAR, UENUM, type, 1) \
|
2020-12-06 10:33:42 +00:00
|
|
|
X(a, STATIC, SINGULAR, UINT64, gpio_mask, 2) \
|
|
|
|
X(a, STATIC, SINGULAR, UINT64, gpio_value, 3)
|
|
|
|
#define HardwareMessage_CALLBACK NULL
|
|
|
|
#define HardwareMessage_DEFAULT NULL
|
|
|
|
|
|
|
|
extern const pb_msgdesc_t HardwareMessage_msg;
|
|
|
|
|
|
|
|
/* Defines for backwards compatibility with code written before nanopb-0.4.0 */
|
|
|
|
#define HardwareMessage_fields &HardwareMessage_msg
|
|
|
|
|
|
|
|
/* Maximum encoded size of messages (where known) */
|
|
|
|
#define HardwareMessage_size 24
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
} /* extern "C" */
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif
|