Private
Public Access
2
0

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:
Brendan Le Foll
2016-03-08 12:20:08 +00:00
parent 612f566c99
commit 59107f0a29
8 changed files with 386 additions and 14 deletions

View File

@@ -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);

View File

@@ -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.
*/