aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTectu <joel@unormal.org>2012-08-09 12:54:22 +0200
committerTectu <joel@unormal.org>2012-08-09 12:54:22 +0200
commitc5e9fa504f425f0fa11054bee85b2dd50a75b48c (patch)
treeda56f09ac1023755054e1f953ce47e8b21ec3760
parentaae3722857ce4e11f2843c5c58655d48a243a48a (diff)
downloaduGFX-c5e9fa504f425f0fa11054bee85b2dd50a75b48c.tar.gz
uGFX-c5e9fa504f425f0fa11054bee85b2dd50a75b48c.tar.bz2
uGFX-c5e9fa504f425f0fa11054bee85b2dd50a75b48c.zip
added SPI config struct to TOUCHPADDriver
-rw-r--r--halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c8
-rw-r--r--halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c8
-rw-r--r--halext/include/touchpad_lld.h6
3 files changed, 7 insertions, 15 deletions
diff --git a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c b/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c
index 85db56e7..a5265995 100644
--- a/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c
+++ b/halext/drivers/touchpad/touchpadADS7843/touchpad_lld.c
@@ -59,12 +59,6 @@
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
-static const SPIConfig spicfg = {
- NULL,
- TP_CS_PORT,
- TP_CS,
- SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0,
-};
/*===========================================================================*/
/* Driver local functions. */
@@ -86,7 +80,7 @@ static const SPIConfig spicfg = {
* @notapi
*/
void tp_lld_init(TOUCHPADDriver *tp) {
- spiStart(tp->spid, &spicfg);
+ spiStart(tp->spid, tp->spicfg);
}
/**
diff --git a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c b/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c
index 00f6336c..a222a6aa 100644
--- a/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c
+++ b/halext/drivers/touchpad/touchpadXPT2046/touchpad_lld.c
@@ -59,12 +59,6 @@
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
-static const SPIConfig spicfg = {
- NULL,
- TP_CS_PORT,
- TP_CS,
- SPI_CR1_BR_2 | SPI_CR1_BR_1 | SPI_CR1_BR_0,
-};
/*===========================================================================*/
/* Driver local functions. */
@@ -86,7 +80,7 @@ static const SPIConfig spicfg = {
* @notapi
*/
void tp_lld_init(TOUCHPADDriver *tp) {
- spiStart(tp->spid, &spicfg);
+ spiStart(tp->spid, tp->spicfg);
}
/**
diff --git a/halext/include/touchpad_lld.h b/halext/include/touchpad_lld.h
index c0339e05..45a561d3 100644
--- a/halext/include/touchpad_lld.h
+++ b/halext/include/touchpad_lld.h
@@ -61,9 +61,13 @@ typedef struct TOUCHPADDriver TOUCHPADDriver;
struct TOUCHPADDriver {
/*
* @brief Pointer to SPI driver.
- * @note SPI driver must be enabled in mcu- and halconf.h
*/
SPIDriver *spid;
+
+ /*
+ * @brief SPI configuration.
+ */
+ SPIConfig *spicfg;
};
/*===========================================================================*/