Prusa MINI Firmware overview
SPI Private Macros
Collaboration diagram for SPI Private Macros:

Macros

#define SPI_1LINE_TX(__HANDLE__)   ((__HANDLE__)->Instance->CR1 |= SPI_CR1_BIDIOE)
 Set the SPI transmit-only mode. More...
 
#define SPI_1LINE_RX(__HANDLE__)   ((__HANDLE__)->Instance->CR1 &= (~SPI_CR1_BIDIOE))
 Set the SPI receive-only mode. More...
 
#define SPI_RESET_CRC(__HANDLE__)
 Reset the CRC calculation of the SPI. More...
 
#define IS_SPI_MODE(MODE)
 
#define IS_SPI_DIRECTION(MODE)
 
#define IS_SPI_DIRECTION_2LINES(MODE)   ((MODE) == SPI_DIRECTION_2LINES)
 
#define IS_SPI_DIRECTION_2LINES_OR_1LINE(MODE)
 
#define IS_SPI_DATASIZE(DATASIZE)
 
#define IS_SPI_CPOL(CPOL)
 
#define IS_SPI_CPHA(CPHA)
 
#define IS_SPI_NSS(NSS)
 
#define IS_SPI_BAUDRATE_PRESCALER(PRESCALER)
 
#define IS_SPI_FIRST_BIT(BIT)
 
#define IS_SPI_TIMODE(MODE)
 
#define IS_SPI_CRC_CALCULATION(CALCULATION)
 
#define IS_SPI_CRC_POLYNOMIAL(POLYNOMIAL)   (((POLYNOMIAL) >= 0x01U) && ((POLYNOMIAL) <= 0xFFFFU))
 

Detailed Description

Macro Definition Documentation

◆ SPI_1LINE_TX

#define SPI_1LINE_TX (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 |= SPI_CR1_BIDIOE)

Set the SPI transmit-only mode.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ SPI_1LINE_RX

#define SPI_1LINE_RX (   __HANDLE__)    ((__HANDLE__)->Instance->CR1 &= (~SPI_CR1_BIDIOE))

Set the SPI receive-only mode.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ SPI_RESET_CRC

#define SPI_RESET_CRC (   __HANDLE__)
Value:
do{(__HANDLE__)->Instance->CR1 &= (uint16_t)(~SPI_CR1_CRCEN);\
(__HANDLE__)->Instance->CR1 |= SPI_CR1_CRCEN;}while(0U)

Reset the CRC calculation of the SPI.

Parameters
<strong>HANDLE</strong>specifies the SPI Handle. This parameter can be SPI where x: 1, 2, or 3 to select the SPI peripheral.
Return values
None

◆ IS_SPI_MODE

#define IS_SPI_MODE (   MODE)
Value:
(((MODE) == SPI_MODE_SLAVE) || \
((MODE) == SPI_MODE_MASTER))

◆ IS_SPI_DIRECTION

#define IS_SPI_DIRECTION (   MODE)
Value:
(((MODE) == SPI_DIRECTION_2LINES) || \
((MODE) == SPI_DIRECTION_2LINES_RXONLY) || \
((MODE) == SPI_DIRECTION_1LINE))

◆ IS_SPI_DIRECTION_2LINES

#define IS_SPI_DIRECTION_2LINES (   MODE)    ((MODE) == SPI_DIRECTION_2LINES)

◆ IS_SPI_DIRECTION_2LINES_OR_1LINE

#define IS_SPI_DIRECTION_2LINES_OR_1LINE (   MODE)
Value:
(((MODE) == SPI_DIRECTION_2LINES) || \
((MODE) == SPI_DIRECTION_1LINE))

◆ IS_SPI_DATASIZE

#define IS_SPI_DATASIZE (   DATASIZE)
Value:
(((DATASIZE) == SPI_DATASIZE_16BIT) || \
((DATASIZE) == SPI_DATASIZE_8BIT))

◆ IS_SPI_CPOL

#define IS_SPI_CPOL (   CPOL)
Value:
(((CPOL) == SPI_POLARITY_LOW) || \
((CPOL) == SPI_POLARITY_HIGH))

◆ IS_SPI_CPHA

#define IS_SPI_CPHA (   CPHA)
Value:
(((CPHA) == SPI_PHASE_1EDGE) || \
((CPHA) == SPI_PHASE_2EDGE))

◆ IS_SPI_NSS

#define IS_SPI_NSS (   NSS)
Value:
(((NSS) == SPI_NSS_SOFT) || \
((NSS) == SPI_NSS_HARD_INPUT) || \
((NSS) == SPI_NSS_HARD_OUTPUT))

◆ IS_SPI_BAUDRATE_PRESCALER

#define IS_SPI_BAUDRATE_PRESCALER (   PRESCALER)
Value:
(((PRESCALER) == SPI_BAUDRATEPRESCALER_2) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_4) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_8) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_16) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_32) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_64) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_128) || \
((PRESCALER) == SPI_BAUDRATEPRESCALER_256))

◆ IS_SPI_FIRST_BIT

#define IS_SPI_FIRST_BIT (   BIT)
Value:
(((BIT) == SPI_FIRSTBIT_MSB) || \
((BIT) == SPI_FIRSTBIT_LSB))

◆ IS_SPI_TIMODE

#define IS_SPI_TIMODE (   MODE)
Value:
(((MODE) == SPI_TIMODE_DISABLE) || \
((MODE) == SPI_TIMODE_ENABLE))

◆ IS_SPI_CRC_CALCULATION

#define IS_SPI_CRC_CALCULATION (   CALCULATION)
Value:
(((CALCULATION) == SPI_CRCCALCULATION_DISABLE) || \
((CALCULATION) == SPI_CRCCALCULATION_ENABLE))

◆ IS_SPI_CRC_POLYNOMIAL

#define IS_SPI_CRC_POLYNOMIAL (   POLYNOMIAL)    (((POLYNOMIAL) >= 0x01U) && ((POLYNOMIAL) <= 0xFFFFU))
SPI_FIRSTBIT_MSB
#define SPI_FIRSTBIT_MSB
Definition: stm32f4xx_hal_spi.h:251
SPI_BAUDRATEPRESCALER_2
#define SPI_BAUDRATEPRESCALER_2
Definition: stm32f4xx_hal_spi.h:236
SPI_FIRSTBIT_LSB
#define SPI_FIRSTBIT_LSB
Definition: stm32f4xx_hal_spi.h:252
SPI_POLARITY_HIGH
#define SPI_POLARITY_HIGH
Definition: stm32f4xx_hal_spi.h:209
SPI_DIRECTION_2LINES
#define SPI_DIRECTION_2LINES
Definition: stm32f4xx_hal_spi.h:189
SPI_BAUDRATEPRESCALER_16
#define SPI_BAUDRATEPRESCALER_16
Definition: stm32f4xx_hal_spi.h:239
SPI_BAUDRATEPRESCALER_256
#define SPI_BAUDRATEPRESCALER_256
Definition: stm32f4xx_hal_spi.h:243
SPI_TIMODE_DISABLE
#define SPI_TIMODE_DISABLE
Definition: stm32f4xx_hal_spi.h:260
SPI_BAUDRATEPRESCALER_32
#define SPI_BAUDRATEPRESCALER_32
Definition: stm32f4xx_hal_spi.h:240
SPI_NSS_HARD_INPUT
#define SPI_NSS_HARD_INPUT
Definition: stm32f4xx_hal_spi.h:227
SPI_CRCCALCULATION_DISABLE
#define SPI_CRCCALCULATION_DISABLE
Definition: stm32f4xx_hal_spi.h:269
SPI_MODE_SLAVE
#define SPI_MODE_SLAVE
Definition: stm32f4xx_hal_spi.h:180
SPI_CRCCALCULATION_ENABLE
#define SPI_CRCCALCULATION_ENABLE
Definition: stm32f4xx_hal_spi.h:270
SPI_PHASE_2EDGE
#define SPI_PHASE_2EDGE
Definition: stm32f4xx_hal_spi.h:218
SPI_NSS_SOFT
#define SPI_NSS_SOFT
Definition: stm32f4xx_hal_spi.h:226
SPI_BAUDRATEPRESCALER_4
#define SPI_BAUDRATEPRESCALER_4
Definition: stm32f4xx_hal_spi.h:237
SPI_BAUDRATEPRESCALER_64
#define SPI_BAUDRATEPRESCALER_64
Definition: stm32f4xx_hal_spi.h:241
SPI_BAUDRATEPRESCALER_128
#define SPI_BAUDRATEPRESCALER_128
Definition: stm32f4xx_hal_spi.h:242
SPI_PHASE_1EDGE
#define SPI_PHASE_1EDGE
Definition: stm32f4xx_hal_spi.h:217
SPI_DATASIZE_16BIT
#define SPI_DATASIZE_16BIT
Definition: stm32f4xx_hal_spi.h:200
SPI_POLARITY_LOW
#define SPI_POLARITY_LOW
Definition: stm32f4xx_hal_spi.h:208
SPI_DIRECTION_1LINE
#define SPI_DIRECTION_1LINE
Definition: stm32f4xx_hal_spi.h:191
SPI_MODE_MASTER
#define SPI_MODE_MASTER
Definition: stm32f4xx_hal_spi.h:181
SPI_TIMODE_ENABLE
#define SPI_TIMODE_ENABLE
Definition: stm32f4xx_hal_spi.h:261
SPI_NSS_HARD_OUTPUT
#define SPI_NSS_HARD_OUTPUT
Definition: stm32f4xx_hal_spi.h:228
SPI_BAUDRATEPRESCALER_8
#define SPI_BAUDRATEPRESCALER_8
Definition: stm32f4xx_hal_spi.h:238
SPI_DATASIZE_8BIT
#define SPI_DATASIZE_8BIT
Definition: stm32f4xx_hal_spi.h:199
SPI_DIRECTION_2LINES_RXONLY
#define SPI_DIRECTION_2LINES_RXONLY
Definition: stm32f4xx_hal_spi.h:190