* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
#ifndef LIBSIGROK_HARDWARE_CENTER_3XX_PROTOCOL_H
#include <ctype.h>
#include <math.h>
#include <glib.h>
-#include "libsigrok.h"
+#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#define LOG_PREFIX "center-3xx"
-/* Note: When adding entries here, don't forget to update CENTER_DEV_COUNT. */
enum {
CENTER_309,
VOLTCRAFT_K204,
};
-#define CENTER_DEV_COUNT 2
-
struct center_dev_info {
- char *vendor;
- char *device;
- char *conn;
+ const char *vendor;
+ const char *device;
+ const char *conn;
int num_channels;
uint32_t max_sample_points;
uint8_t packet_size;
int (*receive_data)(int, int, void *);
};
-extern SR_PRIV const struct center_dev_info center_devs[CENTER_DEV_COUNT];
+extern SR_PRIV const struct center_dev_info center_devs[];
#define SERIAL_BUFSIZE 256
-/** Private, per-device-instance driver context. */
struct dev_context {
- /** The current sampling limit (in number of samples). */
- uint64_t limit_samples;
-
- /** The current sampling limit (in ms). */
- uint64_t limit_msec;
-
- /** Opaque pointer passed in by the frontend. */
- void *cb_data;
-
- /** The current number of already received samples. */
- uint64_t num_samples;
-
- int64_t starttime;
+ struct sr_sw_limits sw_limits;
uint8_t buf[SERIAL_BUFSIZE];
int bufoffset;