Skip to content

Commit

Permalink
drivers: spi: allow cpus to override spi_conf_t and spi_speed_t [WIP,…
Browse files Browse the repository at this point in the history
… TEMPORARY]
  • Loading branch information
basilfx committed Feb 28, 2016
1 parent f346a84 commit ab31473
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/include/periph/spi.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ typedef enum {
} spi_t;

/**
* @brief The SPI mode is defined by the four possible combinations of clock polarity and
* clock phase.
* @brief The SPI mode is defined by the four possible combinations of clock
* polarity and clock phase.
* @{
*/
#ifndef HAVE_SPI_CONF_T
typedef enum {
/**
* The first data bit is sampled by the receiver on the first SCK edge. The
Expand All @@ -84,20 +86,26 @@ typedef enum {
*/
SPI_CONF_SECOND_FALLING = 3
} spi_conf_t;
#endif
/** @} */

/**
* @brief Define a set of pre-defined SPI clock speeds.
*
* The actual speed of the bus can vary to some extend, as the combination of CPU clock and
* available prescale values on certain platforms may not make the exact values possible.
* @{
*/
#ifndef HAVE_SPI_SPEED_T
typedef enum {
SPI_SPEED_100KHZ = 0, /**< drive the SPI bus with 100KHz */
SPI_SPEED_400KHZ, /**< drive the SPI bus with 400KHz */
SPI_SPEED_1MHZ, /**< drive the SPI bus with 1MHz */
SPI_SPEED_5MHZ, /**< drive the SPI bus with 5MHz */
SPI_SPEED_10MHZ /**< drive the SPI bus with 10MHz */
} spi_speed_t;
#endif
/** @} */

/**
* @brief Initialize the given SPI device to work in master mode
Expand Down

0 comments on commit ab31473

Please sign in to comment.