2019-10-20 19:18:52 +02:00
|
|
|
// BD3491 driver
|
|
|
|
// author : Julian Daube
|
|
|
|
|
|
|
|
#ifndef __AUDIO_MUX_BD3491_H__
|
|
|
|
#define __AUDIO_MUX_BD3491_H__
|
|
|
|
|
|
|
|
#include "stm32f1xx_hal.h"
|
|
|
|
|
2019-10-21 23:05:00 +02:00
|
|
|
#define BD_INPUT_MUTE (1<<4)
|
|
|
|
#define BD_INPUT_ALL (1<<5)
|
|
|
|
|
|
|
|
// number can either be 0-5 (meaning CHANNEL1 to CHANNEL 6)
|
|
|
|
// or BD_INPUT_MUTE or BD_INPUT_SHORT
|
2019-10-20 19:18:52 +02:00
|
|
|
void bd_set_input(I2C_HandleTypeDef * handle, uint8_t number);
|
|
|
|
|
|
|
|
#define BD_MAX_GAIN 20 // gain in db
|
|
|
|
int bd_set_gain(I2C_HandleTypeDef * handle, uint8_t gain_in_db);
|
|
|
|
|
|
|
|
#define BD_INF_ATTENUATION 0xFF
|
|
|
|
uint8_t bd_set_attenuation(I2C_HandleTypeDef * handle, uint8_t right_channel, uint8_t attenuation_in_db);
|
|
|
|
|
|
|
|
// when gain == 0, cut bass boost
|
2019-10-22 00:04:30 +02:00
|
|
|
uint8_t bd_set_bass_boost(I2C_HandleTypeDef * handle, uint8_t gain);
|
2019-10-20 19:18:52 +02:00
|
|
|
// when gain == 0, cut treble boost
|
2019-10-22 00:04:30 +02:00
|
|
|
uint8_t bd_set_treble_boost(I2C_HandleTypeDef * handle, uint8_t gain);
|
2019-10-20 19:18:52 +02:00
|
|
|
|
|
|
|
enum BD_SOURROUND_GAIN {
|
|
|
|
BD_SOURROUND_OFF = 0,
|
|
|
|
BD_SOURROUND_LOW = 5,
|
|
|
|
BD_SOURROUND_MIDDLE = 10,
|
|
|
|
BD_SOURROUND_HIGH = 15,
|
|
|
|
};
|
|
|
|
|
|
|
|
void bd_set_sourround(I2C_HandleTypeDef * handle, enum BD_SOURROUND_GAIN gain);
|
|
|
|
|
|
|
|
#endif
|