Added to HR_Cx000 driver a function for setting the gain of the audio input stage.

replace/23406aac3c56751bc13c33e6e3bfa44bf8f89477
Silvano Seva 2021-04-27 16:14:25 +02:00
rodzic 5b0bec8c5f
commit 529b108771
2 zmienionych plików z 24 dodań i 0 usunięć

Wyświetl plik

@ -46,6 +46,21 @@ void HR_Cx000< C6000_SpiOpModes >::setDacGain(uint8_t value)
writeReg(C6000_SpiOpModes::CONFIG, 0x37, (0x80 | value));
}
template <>
void HR_Cx000< C5000_SpiOpModes >::setInputGain(uint8_t value)
{
// Mic gain is controlled by bytes 7:3 of register 0x0F (ADLinVol).
if(value > 31) value = 31;
writeReg(C5000_SpiOpModes::CONFIG, 0x0F, value << 3);
}
template <>
void HR_Cx000< C6000_SpiOpModes >::setInputGain(uint8_t value)
{
// TODO: Experiments needed for identification of HR_C6000 mic gain register.
(void) value;
}
ScopedChipSelect::ScopedChipSelect()
{
gpio_clearPin(DMR_CS);

Wyświetl plik

@ -153,6 +153,15 @@ public:
*/
void setDacGain(uint8_t value);
/**
* Set the gain for the incoming audio from both the microphone and line-in
* sources. This value affects the modulation level in analog FM mode and
* it must be correctly tuned to avoid distorsions.
*
* @param value: gain value. Allowed range is 0-31.
*/
void setInputGain(uint8_t value);
/**
* Configure chipset for DMR operation.
*/