Created calibration data structure for Module17

pull/139/head
Silvano Seva 2022-12-08 18:55:55 +01:00
rodzic a9a6217d89
commit c862638fd1
2 zmienionych plików z 53 dodań i 4 usunięć

Wyświetl plik

@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (C) 2022 by Federico Amedeo Izzo IU2NUO, *
* Niccolò Izzo IU2KIN *
* Frederik Saraci IU2NRO *
* Silvano Seva IU2KWO *
* Mathis Schmieder DB9MAT *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, see <http://www.gnu.org/licenses/> *
***************************************************************************/
#ifndef CALIBINFO_MOD17_H
#define CALIBINFO_MOD17_H
#include <datatypes.h>
#include <stdint.h>
/**
* \brief Calibration data for Module17.
*/
typedef struct
{
uint16_t tx_wiper;
uint16_t rx_wiper;
uint8_t mic_gain;
uint8_t tx_invert : 1,
rx_invert : 1,
_padding : 6;
}
mod17Calib_t;
#endif /* CALIBINFO_MOD17_H */

Wyświetl plik

@ -29,8 +29,11 @@
#include <interfaces/audio.h>
#include <ADC1_Mod17.h>
#include <interfaces/nvmem.h>
#include <calibInfo_Mod17.h>
#include <MCP4551.h>
mod17Calib_t mod17CalData;
void platform_init()
{
/* Configure GPIOs */
@ -53,10 +56,14 @@ void platform_init()
i2c_init();
mcp4551_init(SOFTPOT_RX);
mcp4551_init(SOFTPOT_TX);
mcp4551_setWiper(SOFTPOT_TX, 0x100);
//mcp4551_setWiper(SOFTPOT_RX, MCP4551_WIPER_A);
audio_init();
/* Set defaults for calibration */
mod17CalData.tx_wiper = 0x080;
mod17CalData.rx_wiper = 0x080;
mod17CalData.tx_invert = 0;
mod17CalData.rx_invert = 0;
mod17CalData.mic_gain = 0;
}
void platform_terminate()
@ -157,7 +164,7 @@ void platform_beepStop()
const void *platform_getCalibrationData()
{
return NULL;
return ((const void *) &mod17CalData);
}
const hwInfo_t *platform_getHwInfo()