From 92ba23f1cd277c08fdab81d7d4a1ade49501cf0f Mon Sep 17 00:00:00 2001 From: Julian Daube Date: Mon, 21 Oct 2019 13:09:09 +0200 Subject: [PATCH] add serial protocol doc to readme --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 9f92fc0..ed2af00 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,13 @@ Sometimes you just need more inputs. And this is how you do it. The BD3491 does all the audio switching. It combines one 6 input switch and an equalizer into a simple package. The STM32 configures the BD3491 to switch to the specified inputs based on pressed buttons or software control. +# serial control Syntax +The stm32 will register to the PCB as a new Serial Port. The following text commands can be send: + +- `C[number]\n` will change the input to the specified channel. The stm32 echo the command as it was understood. e.g: When Sending `C0\n` it will respond `C0\r\n` to acknowledge the channel switched to **Input 1**. When issuing a `C10` there will be no response, since 10 is out of range. *NOTE:* when using the buttons on the PCB to switch the input, the stm will also issue a `C[number]\r\n` over the serial port if it is connected to notify the PCB of the external input change. + +- `G[number]\n` will activate an input gain of [number] in dB. It will also respond with the closest gain it can do. e.g: `G10` will result in the stm responding `G12\r\n` which means it will add a 12db input boost, which was the closest matching _valid_ input gain value. You can check the datasheet of the BD3491 to find the possible gain values if this peaks your interest :) + +- `L[number]\n` or `R[number]\n` will activate an attenuator in either the left or the right channel. [number] is once again in dB. It works much like the `G`-command. Setting [number] to 0 will deactivate the Attenuation. +