kopia lustrzana https://github.com/OpenRTX/OpenRTX
Added to HR_Cx000 driver a function for setting the gain of the audio input stage.
rodzic
5b0bec8c5f
commit
529b108771
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
*/
|
||||
|
|
Ładowanie…
Reference in New Issue