firewire_bebob_protocols/behringer.rs
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (c) 2021 Takashi Sakamoto
3
4//! Protocol implementation for Behringer Firepower series.
5//!
6//! The module includes structure, enumeration, and trait and its implementation for protocol
7//! defined by Behringer for Firepower series.
8//!
9//! DM1500 is used for Behringer Firepower FCA610.
10//!
11//! ## Diagram of internal signal flow for FCA610
12//!
13//! ```text
14//! analog-input-1/2 ----------+--------------> stream-output-1/2
15//! analog-input-3/4 ----------|-+------------> stream-output-3/4
16//! digital-input-1/2 ----------|-|-+----------> stream-output-5/6
17//! | | |
18//! v v v
19//! ++=======++
20//! stream-input-1/2 ------> || 8 x 2 ||
21//! || mixer ||-------> analog-output-1/2
22//! ++=======++
23//! stream-input-3/4 --------------------------> analog-output-3/4
24//! stream-input-5/6 --------------------------> analog-output-5/6
25//! stream-input-7/8 --------------------------> digital-output-1/2
26//! ```
27//!
28//! The protocol implementation for Behringer FCA610 was written with firmware version below:
29//!
30//! ```sh
31//! $ cargo run --bin bco-bootloader-info -- /dev/fw1
32//! protocol:
33//! version: 3
34//! bootloader:
35//! timestamp: 2012-10-15T10:47:10+0000
36//! version: 0.0.0
37//! hardware:
38//! GUID: 0x0002ad7300156400
39//! model ID: 0x000003
40//! revision: 0.0.0
41//! software:
42//! timestamp: 2012-11-02T03:34:31+0000
43//! ID: 0x00000610
44//! revision: 0.0.8348
45//! image:
46//! base address: 0x400c0080
47//! maximum size: 0x15b520
48//! ```
49
50use super::*;
51
52/// The protocol implementation for media and sampling clock of FCA 610.
53#[derive(Default, Debug)]
54pub struct Fca610ClkProtocol;
55
56impl MediaClockFrequencyOperation for Fca610ClkProtocol {
57 const FREQ_LIST: &'static [u32] = &[44100, 48000, 88200, 96000];
58}
59
60impl SamplingClockSourceOperation for Fca610ClkProtocol {
61 const DST: SignalAddr = SignalAddr::Subunit(SignalSubunitAddr {
62 subunit: MUSIC_SUBUNIT_0,
63 plug_id: 0x05,
64 });
65
66 const SRC_LIST: &'static [SignalAddr] = &[
67 // Device internal clock
68 SignalAddr::Unit(SignalUnitAddr::Ext(0x04)),
69 // S/PDIF
70 SignalAddr::Unit(SignalUnitAddr::Ext(0x03)),
71 // Firewire-bus. This is the same source as Internal in former BeBoB models.
72 SignalAddr::Subunit(SignalSubunitAddr {
73 subunit: MUSIC_SUBUNIT_0,
74 plug_id: 0x07,
75 }),
76 ];
77}