mirror of
https://github.com/OpenRTX/OpenRTX
synced 2026-08-08 12:29:06 -04:00
This change removes the old copyright header from project sources and replaces it with a new simplified SPDX-compliant header. Note that files that were missing the header but reasonably understood to be licensed according to the root license were not corrected. Signed-off-by: Ryan Turner <ryan@turnrye.com>
31 lines
617 B
C++
31 lines
617 B
C++
/*
|
|
* SPDX-FileCopyrightText: Copyright 2020-2026 OpenRTX Contributors
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
#include "peripherals/gpio.h"
|
|
#include "hwconfig.h"
|
|
#include "MAX9814.h"
|
|
|
|
/*
|
|
* Implementation of MAX9814 gain setting
|
|
*/
|
|
|
|
void max9814_setGain(uint8_t gain)
|
|
{
|
|
if (gain == 0)
|
|
{
|
|
gpio_setMode(MIC_GAIN, OUTPUT);
|
|
gpio_setPin(MIC_GAIN); // 40 dB gain
|
|
}
|
|
else if (gain == 1)
|
|
{
|
|
gpio_setMode(MIC_GAIN, OUTPUT);
|
|
gpio_clearPin(MIC_GAIN); // 50 dB gain
|
|
}
|
|
else
|
|
{
|
|
gpio_setMode(MIC_GAIN, INPUT); // High impedance, 60 dB gain
|
|
}
|
|
}
|