From e1f9cb9d9294fa75f1711c8c4de2fdd60e8b1f79 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Thu, 19 May 2011 16:06:45 -0400 Subject: spi.h: Naming anonymous enums. Named spi_mode, spi_baud_rate, spi_cfg_flag, spi_interrupt. --- libmaple/spi.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libmaple/spi.h') diff --git a/libmaple/spi.h b/libmaple/spi.h index 37ca6ef..1aabfcc 100644 --- a/libmaple/spi.h +++ b/libmaple/spi.h @@ -237,7 +237,7 @@ void spi_gpio_cfg(uint8 as_master, * idle state of the clock line, and clock phase (CPHA), which * determines which clock edge triggers data capture. */ -typedef enum { +typedef enum spi_mode { SPI_MODE_0, /**< Clock line idles low (0), data capture on first clock transition. */ SPI_MODE_1, /**< Clock line idles low (0), data capture on second @@ -252,7 +252,7 @@ typedef enum { * @brief SPI baud rate configuration, as a divisor of f_PCLK, the * PCLK clock frequency. */ -typedef enum { +typedef enum spi_baud_rate { SPI_BAUD_PCLK_DIV_2 = SPI_CR1_BR_PCLK_DIV_2, /**< f_PCLK/2 */ SPI_BAUD_PCLK_DIV_4 = SPI_CR1_BR_PCLK_DIV_4, /**< f_PCLK/4 */ SPI_BAUD_PCLK_DIV_8 = SPI_CR1_BR_PCLK_DIV_8, /**< f_PCLK/8 */ @@ -268,7 +268,7 @@ typedef enum { * @see spi_master_enable() * @see spi_slave_enable() */ -typedef enum { +typedef enum spi_cfg_flag { SPI_BIDIMODE = SPI_CR1_BIDIMODE, /**< Bidirectional mode enable */ SPI_BIDIOE = SPI_CR1_BIDIOE, /**< Output enable in bidirectional mode */ @@ -328,7 +328,7 @@ static inline void spi_peripheral_disable_all(void) { } /** Available SPI interrupts */ -typedef enum { +typedef enum spi_interrupt { SPI_TXE_INTERRUPT = SPI_CR2_TXEIE, /**< TX buffer empty interrupt */ SPI_RXNE_INTERRUPT = SPI_CR2_RXNEIE, /**< RX buffer not empty interrupt */ SPI_ERR_INTERRUPT = SPI_CR2_ERRIE /**< -- cgit v1.2.3