Unify spi_master headers (#24857)
* Move default config to .c file * Explicitly define PAL modes for boards with custom init * Unify spi_master headers
This commit is contained in:
parent
0747f887d6
commit
ee63d39058
12 changed files with 183 additions and 175 deletions
|
|
@ -15,8 +15,49 @@
|
|||
*/
|
||||
|
||||
#include "spi_master.h"
|
||||
#include "chibios_config.h"
|
||||
#include <ch.h>
|
||||
#include <hal.h>
|
||||
|
||||
#include "timer.h"
|
||||
#ifndef SPI_DRIVER
|
||||
# define SPI_DRIVER SPID2
|
||||
#endif
|
||||
|
||||
#ifndef SPI_SCK_PIN
|
||||
# define SPI_SCK_PIN B13
|
||||
#endif
|
||||
|
||||
#ifndef SPI_SCK_PAL_MODE
|
||||
# ifdef USE_GPIOV1
|
||||
# define SPI_SCK_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_SCK_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MOSI_PIN
|
||||
# define SPI_MOSI_PIN B15
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MOSI_PAL_MODE
|
||||
# ifdef USE_GPIOV1
|
||||
# define SPI_MOSI_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_MOSI_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MISO_PIN
|
||||
# define SPI_MISO_PIN B14
|
||||
#endif
|
||||
|
||||
#ifndef SPI_MISO_PAL_MODE
|
||||
# ifdef USE_GPIOV1
|
||||
# define SPI_MISO_PAL_MODE PAL_MODE_ALTERNATE_PUSHPULL
|
||||
# else
|
||||
# define SPI_MISO_PAL_MODE 5
|
||||
# endif
|
||||
#endif
|
||||
|
||||
static bool spiStarted = false;
|
||||
#if SPI_SELECT_MODE == SPI_SELECT_MODE_NONE
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue