added SPI config struct to TOUCHPADDriver
This commit is contained in:
parent
aae3722857
commit
c5e9fa504f
3 changed files with 7 additions and 15 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
||||
/*===========================================================================*/
|
||||
|
|
Loading…
Add table
Reference in a new issue