From 94d3a8f52bd8cedbdecff22cab0c18c3f1e73da6 Mon Sep 17 00:00:00 2001 From: Silvano Seva Date: Sun, 28 Mar 2021 10:29:58 +0200 Subject: [PATCH] Stub drivers for NVM and radio management on MD-9600 --- platform/drivers/NVM/nvmem_MD9600.c | 79 +++++++++++++++++++++++ platform/drivers/NVM/spiFlash_MD9600.c | 45 +++++++++++++ platform/drivers/baseband/radio_MD9600.c | 82 ++++++++++++++++++++++++ 3 files changed, 206 insertions(+) create mode 100644 platform/drivers/NVM/nvmem_MD9600.c create mode 100644 platform/drivers/NVM/spiFlash_MD9600.c create mode 100644 platform/drivers/baseband/radio_MD9600.c diff --git a/platform/drivers/NVM/nvmem_MD9600.c b/platform/drivers/NVM/nvmem_MD9600.c new file mode 100644 index 00000000..4bbe478e --- /dev/null +++ b/platform/drivers/NVM/nvmem_MD9600.c @@ -0,0 +1,79 @@ +/*************************************************************************** + * Copyright (C) 2021 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * 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 * + ***************************************************************************/ + +#include +#include +#include + +void nvm_init() +{ +} + +void nvm_terminate() +{ +} + +void nvm_loadHwInfo(hwInfo_t *info) +{ + (void) info; +} + +int nvm_readVFOChannelData(channel_t *channel) +{ + (void) channel; + return -1; +} + +int nvm_readChannelData(channel_t *channel, uint16_t pos) +{ + (void) channel; + (void) pos; + + return -1; +} + +int nvm_readZoneData(zone_t *zone, uint16_t pos) +{ + (void) zone; + (void) pos; + + return -1; +} + +int nvm_readContactData(contact_t *contact, uint16_t pos) +{ + (void) contact; + (void) pos; + + return -1; +} + +int nvm_readSettings(settings_t *settings) +{ + (void) settings; + return -1; +} + +int nvm_writeSettings(settings_t *settings) +{ + (void) settings; + return -1; +} + diff --git a/platform/drivers/NVM/spiFlash_MD9600.c b/platform/drivers/NVM/spiFlash_MD9600.c new file mode 100644 index 00000000..0ae7345d --- /dev/null +++ b/platform/drivers/NVM/spiFlash_MD9600.c @@ -0,0 +1,45 @@ +/*************************************************************************** + * Copyright (C) 2020 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * 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 * + ***************************************************************************/ + +#include +#include +#include +#include + +/* + * Implementation of external flash SPI interface for MD9600 devices. + */ + +uint8_t spiFlash_SendRecv(uint8_t val) +{ + spi2_lockDeviceBlocking(); + uint8_t x = spi2_sendRecv(val); + spi2_releaseDevice(); + + return x; +} + +void spiFlash_init() +{ +} + +void spiFlash_terminate() +{ +} diff --git a/platform/drivers/baseband/radio_MD9600.c b/platform/drivers/baseband/radio_MD9600.c new file mode 100644 index 00000000..8eea6dbc --- /dev/null +++ b/platform/drivers/baseband/radio_MD9600.c @@ -0,0 +1,82 @@ +/*************************************************************************** + * Copyright (C) 2020 by Federico Amedeo Izzo IU2NUO, * + * Niccolò Izzo IU2KIN * + * Frederik Saraci IU2NRO * + * Silvano Seva IU2KWO * + * * + * 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 * + ***************************************************************************/ + +#include +#include + +void radio_init() +{ +} + +void radio_terminate() +{ +} + +void radio_setBandwidth(const enum bandwidth bw) +{ + (void) bw; +} + +void radio_setOpmode(const enum opmode mode) +{ + (void) mode; +} + +void radio_setVcoFrequency(const freq_t frequency, const bool isTransmitting) +{ + (void) frequency; + (void) isTransmitting; +} + +void radio_setCSS(const tone_t rxCss, const tone_t txCss) +{ + (void) rxCss; + (void) txCss; +} + +bool radio_checkRxDigitalSquelch() +{ + return true; +} + +void radio_enableRx() +{ +} + +void radio_enableTx(const float txPower, const bool enableCss) +{ + (void) txPower; + (void) enableCss; +} + +void radio_disableRtx() +{ +} + +void radio_updateCalibrationParams(const rtxStatus_t* rtxCfg) +{ + (void) rtxCfg; +} + +float radio_getRssi(const freq_t rxFreq) +{ + (void) rxFreq; + return -100.0f; +}