mikroSDK Reference Manual
hal_spi_master_config_t Struct Reference

HAL SPI Master init configuration structure, consisted of the following fields : More...

Data Fields

uint8_t default_write_data
 
hal_pin_name_t sck
 
hal_pin_name_t miso
 
hal_pin_name_t mosi
 
uint32_t speed
 
hal_spi_master_mode_t mode
 

Detailed Description

User needs to specifiy values herein.

Note
Take into consideration that any value can be changed explicitly by the user.

Example

// SPI Master configuration structure.
static hal_spi_master_config_t hal_spi_master_cfg;
// Populate structure to default init values.
hal_spi_master_configure_default(&hal_spi_master_cfg);
// Specify desired SPI Serial Clock pin.
hal_spi_master_cfg.sck = MIKROBUS_1_SCK;
// Specify desired SPI Master-In Slave-Out pin.
hal_spi_master_cfg.miso = MIKROBUS_1_MISO;
// Specify desired SPI Master-Out Slave-In pin.
hal_spi_master_cfg.mosi = MIKROBUS_1_MOSI;
// Specify desired SPI transfer rate.
hal_spi_master_cfg.speed = 100000;
// Specify desired SPI Mode.
hal_spi_master_cfg.mode = SPI_MASTER_MODE_0;

Field Documentation

◆ default_write_data

uint8_t hal_spi_master_config_t::default_write_data

SPI Master default write data.

◆ sck

hal_pin_name_t hal_spi_master_config_t::sck

SCK pin name.

◆ miso

hal_pin_name_t hal_spi_master_config_t::miso

MISO pin name.

◆ mosi

hal_pin_name_t hal_spi_master_config_t::mosi

MOSI pin name.

◆ speed

uint32_t hal_spi_master_config_t::speed

SPI transfer rate.

◆ mode

hal_spi_master_mode_t hal_spi_master_config_t::mode

SPI mode. See hal_spi_master_mode_t for valid values.

hal_spi_master_config_t
HAL SPI Master init configuration structure, consisted of the following fields :
Definition: hal_spi_master.h:123
hal_spi_master_config_t::speed
uint32_t speed
Definition: hal_spi_master.h:129
SPI_MASTER_MODE_0
Definition: drv_spi_master.h:71
hal_spi_master_config_t::miso
hal_pin_name_t miso
Definition: hal_spi_master.h:127
hal_spi_master_config_t::mode
hal_spi_master_mode_t mode
Definition: hal_spi_master.h:130
hal_spi_master_configure_default
void hal_spi_master_configure_default(hal_spi_master_config_t *config)
Configure SPI Master configuration structure with default values.
hal_spi_master_config_t::sck
hal_pin_name_t sck
Definition: hal_spi_master.h:126
hal_spi_master_config_t::mosi
hal_pin_name_t mosi
Definition: hal_spi_master.h:128