blob: 62ce0c189ce773ea3ea984c250e6b7f1743abd57 [file] [log] [blame]
Uwe Hermanna1bb33a2010-04-02 20:18:27 +02001/*
Uwe Hermann50985c22013-04-23 22:24:30 +02002 * This file is part of the libsigrok project.
Uwe Hermanna1bb33a2010-04-02 20:18:27 +02003 *
Bert Vermeulenc73d2ea2012-02-13 14:31:51 +01004 * Copyright (C) 2010-2012 Bert Vermeulen <bert@biot.com>
Uwe Hermanna1bb33a2010-04-02 20:18:27 +02005 *
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
Bert Vermeulen45c59c82012-07-05 00:55:07 +020020#include "libsigrok.h"
21#include "libsigrok-internal.h"
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020022
Uwe Hermann7b870c32012-10-21 16:13:36 +020023/**
Uwe Hermann393fb9c2012-10-22 00:30:12 +020024 * @file
25 *
26 * Output file/data format handling.
27 */
28
29/**
Uwe Hermann7b870c32012-10-21 16:13:36 +020030 * @defgroup grp_output Output formats
31 *
32 * Output file/data format handling.
33 *
Uwe Hermann07e1aad2013-02-22 15:12:32 +010034 * libsigrok supports several output (file) formats, e.g. binary, VCD,
35 * gnuplot, and so on. It provides an output API that frontends can use.
36 * New output formats can be added/implemented in libsigrok without having
37 * to change the frontends at all.
38 *
39 * All output modules are fed data in a stream. Devices that can stream data
40 * into libsigrok live, instead of storing and then transferring the whole
41 * buffer, can thus generate output live.
42 *
43 * Output modules are responsible for allocating enough memory to store
44 * their own output, and passing a pointer to that memory (and length) of
45 * the allocated memory back to the caller. The caller is then expected to
46 * free this memory when finished with it.
47 *
Uwe Hermann7b870c32012-10-21 16:13:36 +020048 * @{
49 */
50
Uwe Hermannb4bd7082012-10-19 10:07:22 +020051/** @cond PRIVATE */
Uwe Hermann7c1d3912012-02-04 10:56:51 +010052extern SR_PRIV struct sr_output_format output_text_bits;
53extern SR_PRIV struct sr_output_format output_text_hex;
54extern SR_PRIV struct sr_output_format output_text_ascii;
55extern SR_PRIV struct sr_output_format output_binary;
56extern SR_PRIV struct sr_output_format output_vcd;
Bert Vermeulenf1b296f2013-12-16 01:31:46 +010057
Uwe Hermann7c1d3912012-02-04 10:56:51 +010058extern SR_PRIV struct sr_output_format output_csv;
Bert Vermeulen161a8a22012-09-08 13:24:48 +020059extern SR_PRIV struct sr_output_format output_analog;
Uwe Hermann7c1d3912012-02-04 10:56:51 +010060/* extern SR_PRIV struct sr_output_format output_analog_gnuplot; */
Uwe Hermannb4bd7082012-10-19 10:07:22 +020061/* @endcond */
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020062
Uwe Hermannf50f3f42011-01-29 16:36:57 +010063static struct sr_output_format *output_module_list[] = {
Uwe Hermann02076d62010-04-12 23:21:12 +020064 &output_text_bits,
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020065 &output_text_hex,
HÃ¥vard Espelandd4f228d2011-01-17 22:56:14 +010066 &output_text_ascii,
Uwe Hermann1c5b9d32010-04-12 21:22:58 +020067 &output_binary,
Uwe Hermann4c9ffa82010-04-04 13:19:20 +020068 &output_vcd,
Uwe Hermann02604ed2011-04-26 23:56:00 +020069 &output_csv,
Bert Vermeulen161a8a22012-09-08 13:24:48 +020070 &output_analog,
Uwe Hermann77b45442011-02-20 13:08:44 +010071 /* &output_analog_gnuplot, */
Uwe Hermann4c9ffa82010-04-04 13:19:20 +020072 NULL,
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020073};
74
Uwe Hermann1a081ca2012-02-01 23:40:35 +010075SR_API struct sr_output_format **sr_output_list(void)
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020076{
Uwe Hermanna1bb33a2010-04-02 20:18:27 +020077 return output_module_list;
78}
Uwe Hermann7b870c32012-10-21 16:13:36 +020079
80/** @} */