-
-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BSP files and build target for Micro17
- Loading branch information
Showing
7 changed files
with
469 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2024 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 <http://www.gnu.org/licenses/> * | ||
***************************************************************************/ | ||
|
||
#ifndef CALIBINFO_MICRO17_H | ||
#define CALIBINFO_MICRO17_H | ||
|
||
#include <datatypes.h> | ||
#include <stdint.h> | ||
|
||
/** | ||
* \brief Calibration data for Micro17. | ||
*/ | ||
typedef struct | ||
{ | ||
uint16_t tx_wiper; ///< Baseband TX potentiometer | ||
uint16_t rx_wiper; ///< Baseband RX potentiometer | ||
uint16_t mic_wiper; ///< Microphone input potentiometer | ||
uint16_t spk_wiper; ///< Speaker output potentiometer | ||
uint8_t bb_tx_invert : 1, ///< Invert TX baseband | ||
bb_rx_invert : 1, ///< Invert RX baseband | ||
ptt_in_level : 1, ///< PTT in acive level | ||
ptt_out_level : 1, ///< PTT out active level | ||
_padding : 4; | ||
} | ||
micro17Calib_t; | ||
|
||
#endif /* CALIBINFO_MICRO17_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2024 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 <http://www.gnu.org/licenses/> * | ||
***************************************************************************/ | ||
|
||
#include <interfaces/nvmem.h> | ||
#include <calibInfo_Micro17.h> | ||
|
||
micro17Calib_t micro17CalData; | ||
|
||
|
||
void nvm_init() | ||
{ | ||
|
||
} | ||
|
||
void nvm_terminate() | ||
{ | ||
|
||
} | ||
|
||
void nvm_readCalibData(void *buf) | ||
{ | ||
(void) buf; | ||
} | ||
|
||
void nvm_readHwInfo(hwInfo_t *info) | ||
{ | ||
(void) info; | ||
} | ||
|
||
int nvm_readVfoChannelData(channel_t *channel) | ||
{ | ||
(void) channel; | ||
|
||
return -1; | ||
} | ||
|
||
int nvm_readSettings(settings_t *settings) | ||
{ | ||
(void) settings; | ||
|
||
return -1; | ||
} | ||
|
||
int nvm_writeSettings(const settings_t *settings) | ||
{ | ||
(void) settings; | ||
|
||
return -1; | ||
} | ||
|
||
int nvm_writeSettingsAndVfo(const settings_t *settings, const channel_t *vfo) | ||
{ | ||
(void) settings; | ||
(void) vfo; | ||
|
||
return -1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2024 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 <http://www.gnu.org/licenses/> * | ||
***************************************************************************/ | ||
|
||
#include <interfaces/radio.h> | ||
#include <peripherals/gpio.h> | ||
#include <calibInfo_Micro17.h> | ||
#include <hwconfig.h> | ||
|
||
static enum opstatus radioStatus; // Current operating status | ||
extern micro17Calib_t micro17CalData; // Calibration data | ||
|
||
|
||
void radio_init(const rtxStatus_t *rtxState) | ||
{ | ||
(void) rtxState; | ||
|
||
// Configure PTT output GPIO and set it to idle state (TX off) | ||
gpio_setMode(PTT_OUT, OUTPUT); | ||
radio_disableRtx(); | ||
|
||
radioStatus = OFF; | ||
} | ||
|
||
void radio_terminate() | ||
{ | ||
radioStatus = OFF; | ||
} | ||
|
||
void radio_tuneVcxo(const int16_t vhfOffset, const int16_t uhfOffset) | ||
{ | ||
(void) vhfOffset; | ||
(void) uhfOffset; | ||
} | ||
|
||
void radio_setOpmode(const enum opmode mode) | ||
{ | ||
(void) mode; | ||
} | ||
|
||
bool radio_checkRxDigitalSquelch() | ||
{ | ||
return false; | ||
} | ||
|
||
void radio_enableAfOutput() | ||
{ | ||
|
||
} | ||
|
||
void radio_disableAfOutput() | ||
{ | ||
|
||
} | ||
|
||
void radio_enableRx() | ||
{ | ||
radioStatus = RX; | ||
|
||
// Module17 PTT output is open drain. This means that, on MCU side, we have | ||
// to assert the gpio to bring it to low state. | ||
if(micro17CalData.ptt_out_level) | ||
gpio_setPin(PTT_OUT); | ||
else | ||
gpio_clearPin(PTT_OUT); | ||
} | ||
|
||
void radio_enableTx() | ||
{ | ||
radioStatus = TX; | ||
|
||
if(micro17CalData.ptt_out_level) | ||
gpio_clearPin(PTT_OUT); | ||
else | ||
gpio_setPin(PTT_OUT); | ||
} | ||
|
||
void radio_disableRtx() | ||
{ | ||
if(micro17CalData.ptt_out_level) | ||
gpio_setPin(PTT_OUT); | ||
else | ||
gpio_clearPin(PTT_OUT); | ||
} | ||
|
||
void radio_updateConfiguration() | ||
{ | ||
|
||
} | ||
|
||
rssi_t radio_getRssi() | ||
{ | ||
return -123.0f; | ||
} | ||
|
||
enum opstatus radio_getStatus() | ||
{ | ||
return radioStatus; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2024 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 <http://www.gnu.org/licenses/> * | ||
***************************************************************************/ | ||
|
||
#ifndef HWCONFIG_H | ||
#define HWCONFIG_H | ||
|
||
#include <stm32g4xx.h> | ||
#include "pinmap.h" | ||
|
||
/* Screen dimensions */ | ||
#define CONFIG_SCREEN_WIDTH 128 | ||
#define CONFIG_SCREEN_HEIGHT 64 | ||
|
||
/* Screen pixel format */ | ||
#define CONFIG_PIX_FMT_BW | ||
|
||
/* Device has no battery */ | ||
#define CONFIG_BAT_NONE | ||
|
||
/* Device supports M17 mode */ | ||
#define CONFIG_M17 | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/*************************************************************************** | ||
* Copyright (C) 2024 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 <http://www.gnu.org/licenses/> * | ||
***************************************************************************/ | ||
|
||
#ifndef PINMAP_H | ||
#define PINMAP_H | ||
|
||
#include <stm32g4xx.h> | ||
|
||
/* PTT control */ | ||
#define PTT_IN GPIOC,13 | ||
#define PTT_OUT GPIOA,6 | ||
|
||
/* Audio */ | ||
#define AUDIO_IN GPIOA,2 // ADC1_IN3 | ||
#define AUDIO_OUT GPIOA,5 // DAC1_OUT2 | ||
#define BASEBAND_IN GPIOA,1 // ADC12_IN2 | ||
#define BASEBAND_OUT GPIOA,4 // DAC1_OUT1 | ||
#define BASEBAND_BYP GPIOA,7 | ||
#define AUDIOOUT_MUTE GPIOB,1 | ||
|
||
/* I2C for MCP4451 */ | ||
#define I2C_SDA GPIOB,9 | ||
#define I2C_SCL GPIOA,15 | ||
|
||
/* Serial ports */ | ||
#define MCU_TX GPIOA,9 | ||
#define MCU_RX GPIOA,10 | ||
#define USART3_TX GPIOB,10 | ||
#define USART3_RX GPIOB,11 | ||
|
||
/* Misc */ | ||
#define AIN_HWVER GPIOA,3 // ADC1_IN4 | ||
|
||
#endif /* PINMAP_H */ |
Oops, something went wrong.