]> sigrok.org Git - libsigrok.git/blame - output/text/text.h
sr/cli/gtk: Remove analog left-overs from API.
[libsigrok.git] / output / text / text.h
CommitLineData
97554432
BV
1/*
2 * This file is part of the sigrok project.
3 *
4 * Copyright (C) 2011 Bert Vermeulen <bert@biot.com>
5 *
6 * This program is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
97554432
BV
20#ifndef TEXT_H_
21#define TEXT_H_
22
23#define DEFAULT_BPL_BITS 64
24#define DEFAULT_BPL_HEX 192
25#define DEFAULT_BPL_ASCII 74
26
27enum outputmode {
28 MODE_BITS = 1,
29 MODE_HEX,
30 MODE_ASCII,
31};
32
33struct context {
34 unsigned int num_enabled_probes;
35 int samples_per_line;
36 unsigned int unitsize;
37 int line_offset;
38 int linebuf_len;
39 char *probelist[65];
40 char *linebuf;
41 int spl_cnt;
42 uint8_t *linevalues;
43 char *header;
44 int mark_trigger;
45 uint64_t prevsample;
46 enum outputmode mode;
47};
48
49void flush_linebufs(struct context *ctx, char *outbuf);
f50f3f40
UH
50int init(struct sr_output *o, int default_spl, enum outputmode mode);
51int event(struct sr_output *o, int event_type, char **data_out,
97554432
BV
52 uint64_t *length_out);
53
54
f50f3f40 55int init_bits(struct sr_output *o);
54ac5277 56int data_bits(struct sr_output *o, const char *data_in, uint64_t length_in,
97554432
BV
57 char **data_out, uint64_t *length_out);
58
f50f3f40 59int init_hex(struct sr_output *o);
54ac5277 60int data_hex(struct sr_output *o, const char *data_in, uint64_t length_in,
97554432
BV
61 char **data_out, uint64_t *length_out);
62
f50f3f40 63int init_ascii(struct sr_output *o);
54ac5277 64int data_ascii(struct sr_output *o, const char *data_in, uint64_t length_in,
97554432
BV
65 char **data_out, uint64_t *length_out);
66
54ac5277 67#endif