HF-AS5047U Driver  0.1.0-dev
HF-AS5047U C++ Driver
Loading...
Searching...
No Matches
AS5047U_TestConfig::SPIParams Struct Reference

SPI Communication Parameters. More...

#include <esp32_as5047u_test_config.hpp>

Static Public Attributes

static constexpr uint32_t FREQUENCY = 1000000
 4MHz SPI frequency (conservative default)
 
static constexpr uint8_t MODE = 1
 SPI Mode 1 (CPOL=0, CPHA=1)
 
static constexpr uint8_t QUEUE_SIZE = 1
 Transaction queue size.
 
static constexpr uint8_t CS_ENA_PRETRANS = 1
 CS asserted N clock cycles before transaction.
 
static constexpr uint8_t CS_ENA_POSTTRANS = 1
 
static constexpr uint8_t SPI_HOST_ID = 2
 SPI host: 2 = SPI2_HOST, 3 = SPI3_HOST. Try 3 if SCLK does not toggle on your board.
 

Detailed Description

SPI Communication Parameters.

The AS5047U supports SPI frequencies up to 10MHz.

SPI Mode: CPOL=0, CPHA=1 (Mode 1) Data format: 16-bit frames (default) or 24-bit frames (SPI_24 mode)

AS5047U SPI timing (per datasheet):

  • Maximum SPI clock: 10 MHz
  • CS setup time (tCSS): 350ns min before first SCLK edge
  • CS hold time (tCSH): 50ns min after last SCLK edge
  • CS high time between frames (tCSmin): 350ns min

cs_ena_pretrans and cs_ena_posttrans are in clock cycles. At 4MHz: 1 cycle = 250ns, so 2 cycles = 500ns (above 350ns minimum)

Member Data Documentation

◆ CS_ENA_POSTTRANS

constexpr uint8_t AS5047U_TestConfig::SPIParams::CS_ENA_POSTTRANS = 1
staticconstexpr

CS held N clock cycles after transaction

◆ CS_ENA_PRETRANS

constexpr uint8_t AS5047U_TestConfig::SPIParams::CS_ENA_PRETRANS = 1
staticconstexpr

CS asserted N clock cycles before transaction.

◆ FREQUENCY

constexpr uint32_t AS5047U_TestConfig::SPIParams::FREQUENCY = 1000000
staticconstexpr

4MHz SPI frequency (conservative default)

◆ MODE

constexpr uint8_t AS5047U_TestConfig::SPIParams::MODE = 1
staticconstexpr

SPI Mode 1 (CPOL=0, CPHA=1)

◆ QUEUE_SIZE

constexpr uint8_t AS5047U_TestConfig::SPIParams::QUEUE_SIZE = 1
staticconstexpr

Transaction queue size.

◆ SPI_HOST_ID

constexpr uint8_t AS5047U_TestConfig::SPIParams::SPI_HOST_ID = 2
staticconstexpr

SPI host: 2 = SPI2_HOST, 3 = SPI3_HOST. Try 3 if SCLK does not toggle on your board.


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