Cascoda SDK
Cascoda SDK for building software to run with CA-821x transceivers
hal_spi_master_config_t Struct Reference

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

#include <baremetal/mikrosdk-lib/hal/include/hal_spi_master.h>

Public Attributes

uint8_t default_write_data
 SPI Master default write data. More...
 
hal_pin_name_t sck
 SCK pin name. More...
 
hal_pin_name_t miso
 MISO pin name. More...
 
hal_pin_name_t mosi
 MOSI pin name. More...
 
uint32_t speed
 SPI transfer rate. More...
 
hal_spi_master_mode_t mode
 SPI mode. More...
 

Detailed Description

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

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;
void hal_spi_master_configure_default(hal_spi_master_config_t *config)
Configure SPI Master configuration structure with default values.
Definition: hal_spi_master.c:146
HAL SPI Master init configuration structure, consisted of the following fields :
Definition: hal_spi_master.h:122
uint32_t speed
SPI transfer rate.
Definition: hal_spi_master.h:127
hal_pin_name_t mosi
MOSI pin name.
Definition: hal_spi_master.h:126
hal_pin_name_t sck
SCK pin name.
Definition: hal_spi_master.h:124
hal_pin_name_t miso
MISO pin name.
Definition: hal_spi_master.h:125
hal_spi_master_mode_t mode
SPI mode.
Definition: hal_spi_master.h:128

Member Data Documentation

◆ default_write_data

uint8_t hal_spi_master_config_t::default_write_data

SPI Master default write data.

◆ miso

hal_pin_name_t hal_spi_master_config_t::miso

MISO pin name.

◆ mode

hal_spi_master_mode_t hal_spi_master_config_t::mode

SPI mode.

See hal_spi_master_mode_t for valid values.

◆ mosi

hal_pin_name_t hal_spi_master_config_t::mosi

MOSI pin name.

◆ sck

hal_pin_name_t hal_spi_master_config_t::sck

SCK pin name.

◆ speed

uint32_t hal_spi_master_config_t::speed

SPI transfer rate.


The documentation for this struct was generated from the following file: