Macros
SPI Private Macros
Peripheral Driver » HAL Driver » SPI » Defines

## Macros
#define | IS_SPI_DIRECTION(__MODE__)
| Check if SPI Direction Mode is valid. More...
#define | IS_SPI_DATASIZE(__DATASIZE__)
| Check if SPI Data Size is valid. More...
#define | IS_SPI_CPOL(__CPOL__)
| Check if SPI Clock Polarity is valid. More...
#define | IS_SPI_CPHA(__CPHA__)
| Check if SPI Clock Phase is valid. More...
#define | IS_SPI_BAUDRATE_PRESCALER(__PRESCALER__) ((__PRESCALER__) <= 0xFFFF)
| Check if SPI BaudRate Prescaler is valid. More...
#define | IS_SPI_TIMODE(__MODE__)
| Check if SPI TI Mode is valid. More...
#define | IS_SPI_SLAVE(__SLAVE__)
| Check if SPI Slave Select is valid. More...
#define | IS_SPI_RX_SAMPLE_DLY(__DLY__) (((__DLY__) >= 0) && ((__DLY__) <= 7))
| Check if SPI Receive Sample Delay Value is valid. More...
#define | IS_SPI_FIFO_THRESHOLD(__THR__) (((__THR__) >= 0) && ((__THR__) <= 7))
| Check if SPI FIFO Threshold is valid. More...

## Detailed Description

## Macro Definition Documentation

## ◆ IS_SPI_BAUDRATE_PRESCALER

#define IS_SPI_BAUDRATE_PRESCALER | ( |  | __PRESCALER__ | ) | ((__PRESCALER__) <= 0xFFFF)

Check if SPI BaudRate Prescaler is valid.

Parameters

  <strong>PRESCALER</strong> | SPI BaudRate Prescaler.

Return values

  SET | (PRESCALER is valid) or RESET (PRESCALER is invalid)

Definition at line 497 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_CPHA

#define IS_SPI_CPHA | ( |  | __CPHA__ | ) |

Value:
(((__CPHA__) == SPI_PHASE_1EDGE) || \
((__CPHA__) == SPI_PHASE_2EDGE))

Check if SPI Clock Phase is valid.

Parameters

  <strong>CPHA</strong> | SPI Clock Phase.

Return values

  SET | (CPHA is valid) or RESET (CPHA is invalid)

Definition at line 490 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_CPOL

#define IS_SPI_CPOL | ( |  | __CPOL__ | ) |

Value:
(((__CPOL__) == SPI_POLARITY_LOW) || \
((__CPOL__) == SPI_POLARITY_HIGH))

Check if SPI Clock Polarity is valid.

Parameters

  <strong>CPOL</strong> | SPI Clock Polarity.

Return values

  SET | (CPOL is valid) or RESET (CPOL is invalid)

Definition at line 483 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_DATASIZE

#define IS_SPI_DATASIZE | ( |  | __DATASIZE__ | ) |

Value:
(((__DATASIZE__) >= SPI_DATASIZE_4BIT) && \
((__DATASIZE__) <= SPI_DATASIZE_32BIT))

Check if SPI Data Size is valid.

Parameters

  <strong>DATASIZE</strong> | SPI Data Size.

Return values

  SET | (DATASIZE is valid) or RESET (DATASIZE is invalid)

Definition at line 476 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_DIRECTION

#define IS_SPI_DIRECTION | ( |  | __MODE__ | ) |

Value:
(((__MODE__) == SPI_DIRECTION_FULL_DUPLEX) || \
((__MODE__) == SPI_DIRECTION_SIMPLEX_TX) || \
((__MODE__) == SPI_DIRECTION_SIMPLEX_RX) || \
((__MODE__) == SPI_DIRECTION_READ_EEPROM))

Check if SPI Direction Mode is valid.

Parameters

  <strong>MODE</strong> | SPI Direction Mode.

Return values

  SET | (MODE is valid) or RESET (MODE is invalid)

Definition at line 467 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_FIFO_THRESHOLD

#define IS_SPI_FIFO_THRESHOLD | ( |  | __THR__ | ) | (((__THR__) >= 0) && ((__THR__) <= 7))

Check if SPI FIFO Threshold is valid.

Parameters

  <strong>THR</strong> | SPI FIFO Threshold.

Return values

  SET | (THR is valid) or RESET (THR is invalid)

Definition at line 525 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_RX_SAMPLE_DLY

#define IS_SPI_RX_SAMPLE_DLY | ( |  | __DLY__ | ) | (((__DLY__) >= 0) && ((__DLY__) <= 7))

Check if SPI Receive Sample Delay Value is valid.

Parameters

  <strong>DLY</strong> | SPI Receive Sample Delay Value

Return values

  SET | (DLY is valid) or RESET (DLY is invalid)

Definition at line 518 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_SLAVE

#define IS_SPI_SLAVE | ( |  | __SLAVE__ | ) |

Value:
(((__SLAVE__) == SPI_SLAVE_SELECT_0) || \
((__SLAVE__) == SPI_SLAVE_SELECT_1) || \
((__SLAVE__) == SPI_SLAVE_SELECT_ALL))

Check if SPI Slave Select is valid.

Parameters

  <strong>SLAVE</strong> | SPI Slave Select.

Return values

  SET | (SLAVE is valid) or RESET (SLAVE is invalid)

Definition at line 510 of file gr55xx_hal_spi.h.

## ◆ IS_SPI_TIMODE

#define IS_SPI_TIMODE | ( |  | __MODE__ | ) |

Value:
(((__MODE__) == SPI_TIMODE_DISABLE) || \
((__MODE__) == SPI_TIMODE_ENABLE))

Check if SPI TI Mode is valid.

Parameters

  <strong>MODE</strong> | SPI TI Mode.

Return values

  SET | (MODE is valid) or RESET (MODE is invalid)

Definition at line 503 of file gr55xx_hal_spi.h.

SPI_DIRECTION_SIMPLEX_TX
#define SPI_DIRECTION_SIMPLEX_TX
Simplex Tx: Transmit only
Definition: gr55xx_hal_spi.h:221
SPI_POLARITY_HIGH
#define SPI_POLARITY_HIGH
Inactive state of CLK is high.
Definition: gr55xx_hal_spi.h:274
SPI_SLAVE_SELECT_1
#define SPI_SLAVE_SELECT_1
SPIM Select Slave 1
Definition: gr55xx_hal_spi.h:295
SPI_SLAVE_SELECT_ALL
#define SPI_SLAVE_SELECT_ALL
SPIM Select All Slave
Definition: gr55xx_hal_spi.h:296
SPI_DIRECTION_FULL_DUPLEX
#define SPI_DIRECTION_FULL_DUPLEX
Full Duplex: Transmit & Receive
Definition: gr55xx_hal_spi.h:220
SPI_DATASIZE_32BIT
#define SPI_DATASIZE_32BIT
32-bit serial data transfer
Definition: gr55xx_hal_spi.h:267
SPI_PHASE_2EDGE
#define SPI_PHASE_2EDGE
CLK toggles in middle of first data bit.
Definition: gr55xx_hal_spi.h:281
SPI_PHASE_1EDGE
#define SPI_PHASE_1EDGE
CLK toggles at start of first data bit
Definition: gr55xx_hal_spi.h:280
SPI_POLARITY_LOW
#define SPI_POLARITY_LOW
Inactive state of CLK is low
Definition: gr55xx_hal_spi.h:273
SPI_DIRECTION_READ_EEPROM
#define SPI_DIRECTION_READ_EEPROM
Read EEPROM
Definition: gr55xx_hal_spi.h:223
SPI_TIMODE_ENABLE
#define SPI_TIMODE_ENABLE
SPI TI mode enable
Definition: gr55xx_hal_spi.h:288
SPI_TIMODE_DISABLE
#define SPI_TIMODE_DISABLE
SPI TI mode disable.
Definition: gr55xx_hal_spi.h:287
SPI_DATASIZE_4BIT
#define SPI_DATASIZE_4BIT
4-bit serial data transfer
Definition: gr55xx_hal_spi.h:239
SPI_SLAVE_SELECT_0
#define SPI_SLAVE_SELECT_0
SPIM Select Slave 0
Definition: gr55xx_hal_spi.h:294
SPI_DIRECTION_SIMPLEX_RX
#define SPI_DIRECTION_SIMPLEX_RX
Simplex Rx: Receive only
Definition: gr55xx_hal_spi.h:222