aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/spi_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/spi_lld.c')
-rw-r--r--os/hal/templates/spi_lld.c55
1 files changed, 53 insertions, 2 deletions
diff --git a/os/hal/templates/spi_lld.c b/os/hal/templates/spi_lld.c
index 71014ebc9..d25a91ae4 100644
--- a/os/hal/templates/spi_lld.c
+++ b/os/hal/templates/spi_lld.c
@@ -39,6 +39,13 @@
/* Driver exported variables. */
/*===========================================================================*/
+/**
+ * @brief SPI1 driver identifier.
+ */
+#if PLATFORM_SPI_USE_SPI1 || defined(__DOXYGEN__)
+SPIDriver SPID1;
+#endif
+
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
@@ -62,6 +69,10 @@
*/
void spi_lld_init(void) {
+#if PLATFORM_SPI_USE_SPI1
+ /* Driver initialization.*/
+ spiObjectInit(&SPID1);
+#endif /* PLATFORM_SPI_USE_SPI1 */
}
/**
@@ -74,9 +85,15 @@ void spi_lld_init(void) {
void spi_lld_start(SPIDriver *spip) {
if (spip->state == SPI_STOP) {
- /* Clock activation.*/
+ /* Enables the pehipheral.*/
+#if PLATFORM_SPI_USE_SPI1
+ if (&SPID1 == spip) {
+
+ }
+#endif /* PLATFORM_SPI_USE_SPI1 */
}
- /* Configuration.*/
+ /* Configures the peripheral.*/
+
}
/**
@@ -88,6 +105,16 @@ void spi_lld_start(SPIDriver *spip) {
*/
void spi_lld_stop(SPIDriver *spip) {
+ if (spip->state == SPI_READY) {
+ /* Resets the peripheral.*/
+
+ /* Disables the peripheral.*/
+#if PLATFORM_SPI_USE_SPI1
+ if (&SPID1 == spip) {
+
+ }
+#endif /* PLATFORM_SPI_USE_SPI1 */
+ }
}
/**
@@ -99,6 +126,8 @@ void spi_lld_stop(SPIDriver *spip) {
*/
void spi_lld_select(SPIDriver *spip) {
+ (void)spip;
+
}
/**
@@ -111,6 +140,8 @@ void spi_lld_select(SPIDriver *spip) {
*/
void spi_lld_unselect(SPIDriver *spip) {
+ (void)spip;
+
}
/**
@@ -126,6 +157,9 @@ void spi_lld_unselect(SPIDriver *spip) {
*/
void spi_lld_ignore(SPIDriver *spip, size_t n) {
+ (void)spip;
+ (void)n;
+
}
/**
@@ -146,6 +180,11 @@ void spi_lld_ignore(SPIDriver *spip, size_t n) {
void spi_lld_exchange(SPIDriver *spip, size_t n,
const void *txbuf, void *rxbuf) {
+ (void)spip;
+ (void)n;
+ (void)txbuf;
+ (void)rxbuf;
+
}
/**
@@ -163,6 +202,10 @@ void spi_lld_exchange(SPIDriver *spip, size_t n,
*/
void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
+ (void)spip;
+ (void)n;
+ (void)txbuf;
+
}
/**
@@ -180,6 +223,10 @@ void spi_lld_send(SPIDriver *spip, size_t n, const void *txbuf) {
*/
void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
+ (void)spip;
+ (void)n;
+ (void)rxbuf;
+
}
/**
@@ -196,6 +243,10 @@ void spi_lld_receive(SPIDriver *spip, size_t n, void *rxbuf) {
*/
uint16_t spi_lld_polled_exchange(SPIDriver *spip, uint16_t frame) {
+ (void)spip;
+ (void)frame;
+
+ return 0;
}
#endif /* HAL_USE_SPI */