Add platform files for linux build

replace/fdc62436304f798aaab675140fcca5e81b0a77f9
Fred 2020-10-23 09:51:29 +02:00 zatwierdzone przez Niccolò Izzo
rodzic 3022d88637
commit 1d0fff3489
4 zmienionych plików z 150 dodań i 0 usunięć

Wyświetl plik

@ -0,0 +1,33 @@
/***************************************************************************
* Copyright (C) 2020 by Frederik Saraci IU2NRO *
* *
* 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 "delays.h"
#include <unistd.h>
/**
* Implementation of the delay functions for x86_64.
*/
void delayUs(unsigned int useconds)
{
usleep(useconds);
}
void delayMs(unsigned int mseconds)
{
usleep(mseconds*1000);
}

Wyświetl plik

@ -0,0 +1,54 @@
/***************************************************************************
* Copyright (C) 2020 by Frederik Saraci IU2NRO *
* *
* 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 "gpio.h"
void gpio_setMode(void *port, uint8_t pin, enum Mode mode)
{
printf("gpio_setMode(%s, %u, %u)\n", (char*) port, pin, mode);
}
void gpio_setAlternateFunction(void *port, uint8_t pin, uint8_t afNum)
{
printf("gpio_setAlternateFunction(%s, %u, %u)\n", (char*) port, pin, afNum);
}
void gpio_setOutputSpeed(void *port, uint8_t pin, enum Speed spd)
{
printf("gpio_setOutputSpeed(%s, %u, %u)\n", (char*) port, pin, spd);
}
void gpio_setPin(void *port, uint8_t pin)
{
printf("gpio_setPin(%s, %u)\n", (char*) port, pin);
}
void gpio_clearPin(void *port, uint8_t pin)
{
printf("gpio_clearPin(%s, %u)\n", (char*) port, pin);
}
void gpio_togglePin(void *port, uint8_t pin)
{
printf("gpio_togglePin(%s, %u)\n", (char*) port, pin);
}
uint8_t gpio_readPin(const void *port, uint8_t pin)
{
printf("gpio_readPin(%s, %u)\n", (char*) port, pin);
return 1;
}

Wyświetl plik

@ -0,0 +1,29 @@
/***************************************************************************
* Copyright (C) 2020 by Frederik Saraci IU2NRO *
* *
* 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/> *
***************************************************************************/
#define GPIOA "PA"
#define GPIOB "PB"
#define GPIOC "PC"
#define GPIOD "PD"
#define GPIOE "PE"
#define GPIOF "PF"
#define GPIOG "PG"
#define GPIOH "PH"
#define GPIOI "PI"
#define GPIOJ "PJ"
#define GPIOK "PK"

Wyświetl plik

@ -0,0 +1,34 @@
/***************************************************************************
* Copyright (C) 2020 by Frederik Saraci IU2NRO *
* *
* 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 "platform.h"
#include "gpio.h"
void platform_init()
{
printf("Platform init\n");
}
void platform_terminate()
{
printf("Platform terminate\n");
}
void platform_setBacklightLevel(uint8_t level)
{
printf("platform_setBacklightLevel(%u)\n", level);
}