]> sigrok.org Git - libsigrok.git/blame - hardware/alsa/protocol.h
Replace 'probe' with 'channel' in most places.
[libsigrok.git] / hardware / alsa / protocol.h
CommitLineData
9cd9f6b7
AG
1/*
2 * This file is part of the libsigrok project.
3 *
4 * Copyright (C) 2011 Daniel Ribeiro <drwyrm@gmail.com>
5 * Copyright (C) 2012 Uwe Hermann <uwe@hermann-uwe.de>
6 * Copyright (C) 2012 Alexandru Gagniuc <mr.nuke.me@gmail.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22
23#ifndef LIBSIGROK_HARDWARE_ALSA_PROTOCOL_H
24#define LIBSIGROK_HARDWARE_ALSA_PROTOCOL_H
25
721ecf3d
UH
26#include <stdint.h>
27#include <alsa/asoundlib.h>
9cd9f6b7
AG
28#include "libsigrok.h"
29#include "libsigrok-internal.h"
30
3544f848 31#define LOG_PREFIX "alsa"
9cd9f6b7
AG
32
33/** Private, per-device-instance driver context. */
34struct dev_context {
35 uint64_t cur_samplerate;
36 uint64_t limit_samples;
37 uint64_t num_samples;
ba7dd8bb 38 uint8_t num_channels;
aa0dbd68 39 uint64_t *samplerates;
721ecf3d 40 char *hwdev;
9cd9f6b7
AG
41 snd_pcm_t *capture_handle;
42 snd_pcm_hw_params_t *hw_params;
43 struct pollfd *ufds;
44 void *cb_data;
45};
65faa197 46
6944b2d0 47SR_PRIV GSList *alsa_scan(GSList *options, struct sr_dev_driver *di);
65faa197 48SR_PRIV int alsa_set_samplerate(const struct sr_dev_inst *sdi,
721ecf3d 49 uint64_t newrate);
9cd9f6b7
AG
50SR_PRIV int alsa_receive_data(int fd, int revents, void *cb_data);
51
721ecf3d 52#endif