diff --git a/meson.build b/meson.build index 33f73b1c..4788d7a9 100644 --- a/meson.build +++ b/meson.build @@ -163,6 +163,7 @@ linux_src = src + ['platform/targets/linux/emulator/emulator.c', 'platform/drivers/display/display_libSDL.c', 'platform/drivers/keyboard/keyboard_linux.c', 'platform/drivers/NVM/nvmem_linux.c', + 'platform/drivers/GPS/GPS_linux.c', 'platform/mcu/x86_64/drivers/gpio.c', 'platform/mcu/x86_64/drivers/delays.c', 'platform/mcu/x86_64/drivers/rtc.c', diff --git a/platform/drivers/GPS/GPS_linux.c b/platform/drivers/GPS/GPS_linux.c new file mode 100644 index 00000000..49d99fa9 --- /dev/null +++ b/platform/drivers/GPS/GPS_linux.c @@ -0,0 +1,60 @@ +/*************************************************************************** + * 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 +#include + +void gps_init(const uint16_t baud) +{ + ; +} + +void gps_terminate() +{ + ; +} + +void gps_enable() +{ + ; +} + +void gps_disable() +{ + ; +} + +bool gps_detect(uint16_t timeout) +{ + return true; +} + +int gps_getNmeaSentence(char *buf, const size_t maxLength) +{ + OS_ERR os_err; + + // Emulate GPS device by sending NMEA sentence every 1s + OSTimeDlyHMSM(0u, 0u, 1u, 0u, OS_OPT_TIME_HMSM_STRICT, &os_err); + char *nmea_sample = "$GPRMC,083703.000,A,4229.7596,N,00912.5377,E,0.15,92.15,040221,,,A*51"; + strncpy(buf, nmea_sample, maxLength); +} +