kopia lustrzana https://github.com/OpenRTX/OpenRTX
Module17 platform changes for revision 0.1c
rodzic
4811838cb8
commit
55c0b0d868
|
@ -14,6 +14,16 @@
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
|
* As a special exception, if other files instantiate templates or use *
|
||||||
|
* macros or inline functions from this file, or you compile this file *
|
||||||
|
* and link it with other works to produce a work based on this file, *
|
||||||
|
* this file does not by itself cause the resulting work to be covered *
|
||||||
|
* by the GNU General Public License. However the source code for this *
|
||||||
|
* file must still be made available in accordance with the GNU General *
|
||||||
|
* Public License. This exception does not invalidate any other reasons *
|
||||||
|
* why a work based on this file might be covered by the GNU General *
|
||||||
|
* Public License. *
|
||||||
|
* *
|
||||||
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -25,30 +35,37 @@
|
||||||
|
|
||||||
void audio_init()
|
void audio_init()
|
||||||
{
|
{
|
||||||
|
gpio_setMode(SPK_MUTE, OUTPUT);
|
||||||
|
gpio_setMode(MIC_MUTE, OUTPUT);
|
||||||
|
gpio_setMode(MIC_GAIN, OUTPUT);
|
||||||
|
|
||||||
|
gpio_setPin(SPK_MUTE); //Off = logic high
|
||||||
|
gpio_clearPin(MIC_MUTE); //Off = logic low
|
||||||
|
gpio_setPin(MIC_GAIN); // gain = 40 dB
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio_terminate()
|
void audio_terminate()
|
||||||
{
|
{
|
||||||
|
gpio_setPin(SPK_MUTE);
|
||||||
|
gpio_clearPin(MIC_MUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio_enableMic()
|
void audio_enableMic()
|
||||||
{
|
{
|
||||||
|
gpio_setPin(MIC_MUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio_disableMic()
|
void audio_disableMic()
|
||||||
{
|
{
|
||||||
|
gpio_clearPin(MIC_MUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio_enableAmp()
|
void audio_enableAmp()
|
||||||
{
|
{
|
||||||
|
gpio_clearPin(SPK_MUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void audio_disableAmp()
|
void audio_disableAmp()
|
||||||
{
|
{
|
||||||
|
gpio_setPin(SPK_MUTE);
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,16 @@
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
|
* As a special exception, if other files instantiate templates or use *
|
||||||
|
* macros or inline functions from this file, or you compile this file *
|
||||||
|
* and link it with other works to produce a work based on this file, *
|
||||||
|
* this file does not by itself cause the resulting work to be covered *
|
||||||
|
* by the GNU General Public License. However the source code for this *
|
||||||
|
* file must still be made available in accordance with the GNU General *
|
||||||
|
* Public License. This exception does not invalidate any other reasons *
|
||||||
|
* why a work based on this file might be covered by the GNU General *
|
||||||
|
* Public License. *
|
||||||
|
* *
|
||||||
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -23,13 +33,17 @@
|
||||||
#include <interfaces/gpio.h>
|
#include <interfaces/gpio.h>
|
||||||
#include <hwconfig.h>
|
#include <hwconfig.h>
|
||||||
|
|
||||||
|
enum opstatus radioStatus; // Current operating status
|
||||||
|
|
||||||
void radio_init(const rtxStatus_t *rtxState)
|
void radio_init(const rtxStatus_t *rtxState)
|
||||||
{
|
{
|
||||||
(void) rtxState;
|
(void) rtxState;
|
||||||
|
radioStatus = OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_terminate()
|
void radio_terminate()
|
||||||
{
|
{
|
||||||
|
radioStatus = OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_tuneVcxo(const int16_t vhfOffset, const int16_t uhfOffset)
|
void radio_tuneVcxo(const int16_t vhfOffset, const int16_t uhfOffset)
|
||||||
|
@ -50,11 +64,13 @@ bool radio_checkRxDigitalSquelch()
|
||||||
|
|
||||||
void radio_enableRx()
|
void radio_enableRx()
|
||||||
{
|
{
|
||||||
|
radioStatus = RX;
|
||||||
gpio_clearPin(PTT_OUT);
|
gpio_clearPin(PTT_OUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void radio_enableTx()
|
void radio_enableTx()
|
||||||
{
|
{
|
||||||
|
radioStatus = TX;
|
||||||
gpio_setPin(PTT_OUT);
|
gpio_setPin(PTT_OUT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -65,7 +81,8 @@ void radio_disableRtx()
|
||||||
|
|
||||||
void radio_updateConfiguration()
|
void radio_updateConfiguration()
|
||||||
{
|
{
|
||||||
|
if(radioStatus == RX) radio_enableRx();
|
||||||
|
if(radioStatus == TX) radio_enableTx();
|
||||||
}
|
}
|
||||||
|
|
||||||
float radio_getRssi()
|
float radio_getRssi()
|
||||||
|
@ -75,5 +92,5 @@ float radio_getRssi()
|
||||||
|
|
||||||
enum opstatus radio_getStatus()
|
enum opstatus radio_getStatus()
|
||||||
{
|
{
|
||||||
return OFF;
|
return radioStatus;
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,6 +15,16 @@
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||||
* GNU General Public License for more details. *
|
* GNU General Public License for more details. *
|
||||||
* *
|
* *
|
||||||
|
* As a special exception, if other files instantiate templates or use *
|
||||||
|
* macros or inline functions from this file, or you compile this file *
|
||||||
|
* and link it with other works to produce a work based on this file, *
|
||||||
|
* this file does not by itself cause the resulting work to be covered *
|
||||||
|
* by the GNU General Public License. However the source code for this *
|
||||||
|
* file must still be made available in accordance with the GNU General *
|
||||||
|
* Public License. This exception does not invalidate any other reasons *
|
||||||
|
* why a work based on this file might be covered by the GNU General *
|
||||||
|
* Public License. *
|
||||||
|
* *
|
||||||
* You should have received a copy of the GNU General Public License *
|
* You should have received a copy of the GNU General Public License *
|
||||||
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
* along with this program; if not, see <http://www.gnu.org/licenses/> *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
@ -42,34 +52,37 @@
|
||||||
#define BAT_NONE
|
#define BAT_NONE
|
||||||
|
|
||||||
/* Signalling LEDs */
|
/* Signalling LEDs */
|
||||||
#define PTT_LED GPIOE,13
|
#define PTT_LED GPIOC,8
|
||||||
#define SYNC_LED GPIOE,14
|
#define SYNC_LED GPIOC,9
|
||||||
#define ERR_LED GPIOE,15
|
#define ERR_LED GPIOA,8
|
||||||
|
|
||||||
/* Display */
|
/* Display */
|
||||||
#define LCD_RST GPIOB,11
|
#define LCD_RST GPIOC,7
|
||||||
#define LCD_RS GPIOB,12
|
#define LCD_RS GPIOC,6
|
||||||
#define LCD_CS GPIOB,10
|
#define LCD_CS GPIOB,14
|
||||||
#define LCD_BKLIGHT GPIOE,15
|
//#define LCD_BKLIGHT GPIOE,15
|
||||||
#define SPI2_CLK GPIOB,13
|
#define SPI2_CLK GPIOB,13
|
||||||
#define SPI2_SDO GPIOB,14
|
#define SPI2_SDO GPIOB,9 //UNUSED
|
||||||
#define SPI2_SDI GPIOB,15
|
#define SPI2_SDI GPIOB,15
|
||||||
|
|
||||||
/* Keyboard */
|
/* Keyboard */
|
||||||
#define ESC_SW GPIOD,1
|
#define ESC_SW GPIOB,8
|
||||||
#define RIGHT_SW GPIOD,2
|
#define RIGHT_SW GPIOB,11
|
||||||
#define UP_SW GPIOD,3
|
#define UP_SW GPIOB,10
|
||||||
#define DOWN_SW GPIOD,4
|
#define DOWN_SW GPIOC,2
|
||||||
#define LEFT_SW GPIOB,9
|
#define LEFT_SW GPIOC,3
|
||||||
#define ENTER_SW GPIOB,8
|
#define ENTER_SW GPIOB,12
|
||||||
|
|
||||||
#define PTT_SW GPIOD,8
|
#define PTT_SW GPIOC,13
|
||||||
#define PTT_OUT GPIOD,10
|
#define PTT_OUT GPIOD,2
|
||||||
|
|
||||||
/* Audio */
|
/* Audio */
|
||||||
#define AUDIO_MIC GPIOA,2
|
#define AUDIO_MIC GPIOA,2
|
||||||
#define AUDIO_SPK GPIOA,5
|
#define AUDIO_SPK GPIOA,5
|
||||||
#define BASEBAND_RX GPIOA,1
|
#define BASEBAND_RX GPIOA,1
|
||||||
#define BASEBAND_TX GPIOA,4
|
#define BASEBAND_TX GPIOA,4
|
||||||
|
#define SPK_MUTE GPIOB,1
|
||||||
|
#define MIC_MUTE GPIOC,4
|
||||||
|
#define MIC_GAIN GPIOC,5
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -38,6 +38,8 @@ void platform_init()
|
||||||
gpio_setMode(PTT_SW, INPUT);
|
gpio_setMode(PTT_SW, INPUT);
|
||||||
gpio_setMode(PTT_OUT, OUTPUT);
|
gpio_setMode(PTT_OUT, OUTPUT);
|
||||||
gpio_clearPin(PTT_OUT);
|
gpio_clearPin(PTT_OUT);
|
||||||
|
|
||||||
|
audio_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
void platform_terminate()
|
void platform_terminate()
|
||||||
|
|
Ładowanie…
Reference in New Issue