firmata: add public firmata API to support custom firmata plugins
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
@@ -97,6 +97,8 @@ typedef struct s_firmata {
|
||||
uint8_t parse_buff[FIRMATA_MSG_LEN];
|
||||
int isReady;
|
||||
char firmware[140];
|
||||
uint8_t dev_count;
|
||||
struct _firmata** devs;
|
||||
} t_firmata;
|
||||
|
||||
t_firmata* firmata_new(const char* name);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
|
||||
* Author: Brendan Le Foll <brendan.le.foll@intel.com>
|
||||
* Copyright (c) 2014 Intel Corporation.
|
||||
* Copyright (c) 2014-2016 Intel Corporation.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining
|
||||
* a copy of this software and associated documentation files (the
|
||||
@@ -40,6 +40,17 @@
|
||||
#define MRAA_IO_SETUP_FAILURE -2
|
||||
#define MRAA_NO_SUCH_IO -1
|
||||
|
||||
#ifdef FIRMATA
|
||||
struct _firmata {
|
||||
/*@*/
|
||||
uint8_t feature; /**< the feature */
|
||||
uint8_t index;
|
||||
void (* isr)(uint8_t*, int); /**< the feature response request */
|
||||
mraa_boolean_t added; /**< boolean to set if responses already set in devs array */
|
||||
/*@}*/
|
||||
};
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A structure representing a gpio pin.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user