audioMux/firmware
Julian Daube f8ff866d32 project: write extra readme text 2019-10-23 23:24:33 +02:00
..
Include firmware: add current state query command 2019-10-23 22:28:06 +02:00
Src firmware: add current state query command 2019-10-23 22:28:06 +02:00
.gitignore firmware: add .gitignore 2019-10-20 19:17:47 +02:00
README.md project: write extra readme text 2019-10-23 23:24:33 +02:00
audioMux.ioc firmware: complete cubemx setup 2019-10-20 19:17:35 +02:00
platformio.ini firmware: completed 2019-10-20 19:18:52 +02:00

README.md

Building the Firmware

In order to build the firmware, platformio must be installed.

To build the firmware, navigate to this folder using the terminal of your choice and type

platformio run

Flashing the firmware

If you happen to have an stlink compatible interface (e.g the programmer attached the nucleo-boards), then (after connecting said interface to the PC and the PCB), the firmware can be flashed with

platformio run -t upload

serial control Syntax

Upon connecting the stm32 to a PC using USB it will register itself as a new Serial Port. The following text commands can be issued via said Serial connection (the baudrate is irrelevant):

  • 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.

  • B[number]\n or T[number]\n adds Bass or Treble gain to the output

  • M[0/1]\n will either mute or unmute the output

  • S[0/1]\n will connect all inputs to the output