-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
firmware: tests: mockups: drivers: Initial structure of the SPI wrap …
…functions #69
- Loading branch information
Showing
2 changed files
with
120 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <http:/\/www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* \brief SPI driver wrap implementation. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \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 */ |
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,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 <http://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
/** | ||
* \brief SPI driver wrap definition. | ||
* | ||
* \author Gabriel Mariano Marcelino <[email protected]> | ||
* | ||
* \version 0.2.10 | ||
* | ||
* \date 2024/02/13 | ||
* | ||
* \defgroup spi_wrap SPI Wrap | ||
* \ingroup tests | ||
* \{ | ||
*/ | ||
|
||
#ifndef SPI_WRAP_H_ | ||
#define SPI_WRAP_H_ | ||
|
||
#include <stdint.h> | ||
#include <stdbool.h> | ||
|
||
#include <drivers/spi/spi.h> | ||
|
||
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 */ |