rcc 1.0
RCC - RGB LED Color Cube Documentation
Loading...
Searching...
No Matches
SPI_enums.h File Reference

Enumerations for SPI interface configurations and status. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Typedefs

typedef enum SPI_Direction_t SPI_Direction
 Alias for enum SPI_Direction_t representing SPI bit order options.
typedef enum SPI_Edge_t SPI_Polarity
 Alias for enum SPI_Edge_t representing the clock polarity edge.
typedef enum SPI_Edge_t SPI_Phase
 Alias for enum SPI_Edge_t representing the clock phase edge.
typedef enum SPI_Select_t SPI_Select
 Alias for enum SPI_Select_t representing SPI enable states.
typedef enum SPI_Status_t SPI_Status
 Alias for enum SPI_Status_t representing SPI communication status codes.

Enumerations

enum  SPI_Direction_t { SPI_MSB =0 , SPI_LSB }
 Defines the bit order for SPI data transmission. More...
enum  SPI_Edge_t { SPI_Rising =0 , SPI_Falling }
 Defines the clock edge options for SPI polarity and phase. More...
enum  SPI_Select_t { SPI_Disable =0 , SPI_Enable }
 Defines the SPI enable or disable states. More...
enum  SPI_Status_t { SPI_Received = 0 , SPI_Collision , SPI_Master_Abort , SPI_None }
 Represents the status of SPI communication events. More...

Detailed Description

Enumerations for SPI interface configurations and status.

This header file defines enumerations used to represent various configuration parameters and status codes for the SPI (Serial Peripheral Interface) communication protocol. It includes enums for bit order (MSB/LSB), clock edge selections for polarity and phase, SPI enable/disable states, and communication status including reception and collision indicators.

Note
These enums improve code readability by providing meaningful symbolic names for SPI configuration values and status codes, facilitating protocol-compliant and maintainable software design.
Author
g.raf
Date
2025-09-28
Version
1.0 Release
Note
This file is part of a larger project and subject to the license specified in the repository. For updates and the complete revision history, see the GitHub repository.
See also
https://github.com/0x007e/avr-common "AVR Common GitHub Repository"

Typedef Documentation

◆ SPI_Direction

Alias for enum SPI_Direction_t representing SPI bit order options.

◆ SPI_Phase

typedef enum SPI_Edge_t SPI_Phase

Alias for enum SPI_Edge_t representing the clock phase edge.

◆ SPI_Polarity

typedef enum SPI_Edge_t SPI_Polarity

Alias for enum SPI_Edge_t representing the clock polarity edge.

◆ SPI_Select

typedef enum SPI_Select_t SPI_Select

Alias for enum SPI_Select_t representing SPI enable states.

◆ SPI_Status

typedef enum SPI_Status_t SPI_Status

Alias for enum SPI_Status_t representing SPI communication status codes.

Enumeration Type Documentation

◆ SPI_Direction_t

Defines the bit order for SPI data transmission.

This enumeration specifies the order in which bits are transmitted over the SPI bus. Selecting either most significant bit (MSB) first or least significant bit (LSB) first affects how data bytes are shifted out and received on the SPI interface.

Enumerator
SPI_MSB 

Data is transmitted with the most significant bit first

SPI_LSB 

Data is transmitted with the least significant bit first

◆ SPI_Edge_t

enum SPI_Edge_t

Defines the clock edge options for SPI polarity and phase.

This enumeration specifies the clock edges that control when data is sampled and shifted in SPI communication. The edge can be either the rising edge or the falling edge of the clock signal.

Note
Rising edge refers to the transition of the clock signal from low to high, while falling edge refers to the transition from high to low. The choice affects the timing of data clocking and must match the SPI slave device's expectations.
Enumerator
SPI_Rising 

Data is sampled or shifted on the rising clock edge

SPI_Falling 

Data is sampled or shifted on the falling clock edge

◆ SPI_Select_t

Defines the SPI enable or disable states.

This enumeration specifies whether the SPI interface is enabled or disabled. It is used to control the activation state of the SPI bus for managing slave select (SS) signal or SPI operation mode.

Enumerator
SPI_Disable 

SPI interface disabled

SPI_Enable 

SPI interface enabled

◆ SPI_Status_t

Represents the status of SPI communication events.

This enumeration indicates various SPI data reception and error states.

  • SPI_Received signals that data has been successfully received.
  • SPI_Collision indicates a collision error, such as simultaneous data transmission.
  • SPI_None means that no SPI event or status is currently active.
Enumerator
SPI_Received 

Data has been received successfully

SPI_Collision 

Collision detected during SPI communication

SPI_Master_Abort 

Master mode initialization aborted

SPI_None 

No SPI event or status