diff --git a/firmware/tests/mockups/drivers/spi_wrap.c b/firmware/tests/mockups/drivers/spi_wrap.c new file mode 100644 index 0000000..1a68fb1 --- /dev/null +++ b/firmware/tests/mockups/drivers/spi_wrap.c @@ -0,0 +1,63 @@ +/* + * spi_wrap.c + * + * Copyright The SLCam Contributors. + * + * This file is part of SLCam. + * + * SLCam 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. + * + * SLCam 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 SLCam. If not, see . + * + */ + +/** + * \brief SPI driver wrap implementation. + * + * \author Gabriel Mariano Marcelino + * + * \version 0.2.10 + * + * \date 2024/02/13 + * + * \addtogroup spi_wrap + * \{ + */ + +#include "spi.h" + +int __wrap_spi_select_slave(spi_port_t port, spi_cs_t cs, bool active) +{ + return -1; +} + +int __wrap_spi_init(spi_port_t port, spi_config_t config) +{ + return -1; +} + +int __wrap_spi_write(spi_port_t port, spi_cs_t cs, uint8_t *data, uint16_t len) +{ + return -1; +} + +int __wrap_spi_read(spi_port_t port, spi_cs_t cs, uint8_t *data, uint16_t len) +{ + return -1; +} + +int __wrap_spi_transfer(spi_port_t port, spi_cs_t cs, uint8_t *wd, uint8_t *rd, uint16_t len) +{ + return -1; +} + +/** \} End of spi_wrap group */ diff --git a/firmware/tests/mockups/drivers/spi_wrap.h b/firmware/tests/mockups/drivers/spi_wrap.h new file mode 100644 index 0000000..cd592dd --- /dev/null +++ b/firmware/tests/mockups/drivers/spi_wrap.h @@ -0,0 +1,57 @@ +/* + * spi_wrap.h + * + * Copyright The SLCam Contributors. + * + * This file is part of SLCam. + * + * SLCam 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. + * + * SLCam 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 SLCam. If not, see . + * + */ + +/** + * \brief SPI driver wrap definition. + * + * \author Gabriel Mariano Marcelino + * + * \version 0.2.10 + * + * \date 2024/02/13 + * + * \defgroup spi_wrap SPI Wrap + * \ingroup tests + * \{ + */ + +#ifndef SPI_WRAP_H_ +#define SPI_WRAP_H_ + +#include +#include + +#include + +int __wrap_spi_init(spi_port_t port, spi_config_t config); + +int __wrap_spi_select_slave(spi_port_t port, spi_cs_t cs, bool active); + +int __wrap_spi_write(spi_port_t port, spi_cs_t cs, uint8_t *data, uint16_t len); + +int __wrap_spi_read(spi_port_t port, spi_cs_t cs, uint8_t *data, uint16_t len); + +int __wrap_spi_transfer(spi_port_t port, spi_cs_t cs, uint8_t *wd, uint8_t *rd, uint16_t len); + +#endif /* SPI_WRAP_H_ */ + +/** \} End of spi_wrap group */