precision-converters-firmware
Macros | Functions | Variables
app_config_stm32.h File Reference

Header file for STM32 platform configurations. More...

#include "main.h"
#include "stm32_spi.h"
#include "stm32_i2c.h"
#include "stm32_uart.h"
#include "stm32_gpio.h"
#include "app_config.h"
#include "stm32_gpio_irq.h"
#include "stm32_tdm.h"
Include dependency graph for app_config_stm32.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HW_CARRIER_NAME   NUCLEO-H563ZI
 
#define STM32_SPI_ID   1
 
#define STM32_SPI_CS_PORT   3
 
#define SPI_CSB   14
 
#define STM32_I2C_ID   1
 
#define APP_UART_HANDLE   &huart3
 
#define DIG_AUX_1   14
 
#define DIG_AUX_2   12
 
#define SYNC_INB   14
 
#define LED_GPO   LED1_GREEN_Pin
 
#define DIG_AUX_1_PORT   6
 
#define DIG_AUX_2_PORT   6
 
#define SYNC_INB_PORT   4
 
#define GPIO_TRIGGER_INT_PORT   EXTI_GPIOG
 
#define I2C_TIMING   0x00000E14
 
#define TDM_DATA_SIZE   32
 
#define TDM_SLOTS_PER_FRAME   1
 
#define TDM_FS_ACTIVE_LENGTH   8
 
#define TDM_N_SAMPLES_DMA_READ   800
 
#define TDM_DMA_READ_SIZE   TDM_N_SAMPLES_DMA_READ * TDM_SLOTS_PER_FRAME/2
 
#define STM32_SAI_BASE   SAI1_Block_A
 
#define FS_CONFIG_VALUE   20
 
#define TICKER_INTERRUPT_PERIOD_uSEC   (0)
 
#define AD4170_MAX_SPI_SPEED   22500000
 

Functions

void tim8_config (void)
 Configure Tx Trigger timer. More...
 
void stm32_timer_stop (void)
 Stops generating timer signals. More...
 
void stm32_system_init (void)
 Initialize the STM32 system peripherals. More...
 
void stm32_abort_dma_transfer (void)
 Abort ongoing SPI RX DMA transfer. More...
 
void ad4170_dma_rx_cplt (SAI_HandleTypeDef *hsai)
 SAI DMA Receive Complete Callback function. More...
 
void ad4170_dma_rx_half_cplt (SAI_HandleTypeDef *hsai)
 SAI DMA Receive Half Complete Callback function. More...
 
void ad4170_spi_dma_rx_cplt_callback (DMA_HandleTypeDef *hdma)
 Callback function to flag the capture of number of requested samples. More...
 
void ad4170_spi_dma_rx_half_cplt_callback (DMA_HandleTypeDef *hdma)
 Callback function to flag the capture of Half the number of requested samples. More...
 
void update_buff (uint32_t *local_buf, uint32_t *buf_start_addr)
 Update buffer index. More...
 
void tim8_init (struct no_os_pwm_desc *pwm_desc)
 Initialize Tx trigger advanced PWM parameters. More...
 

Variables

struct stm32_spi_init_param stm32_spi_extra_init_params
 
struct stm32_uart_init_param stm32_uart_extra_init_params
 
struct stm32_gpio_init_param stm32_trigger_gpio_extra_init_params
 
struct stm32_gpio_init_param stm32_dig_aux1_gpio_extra_init_params
 
struct stm32_gpio_init_param stm32_dig_aux2_gpio_extra_init_params
 
struct stm32_gpio_init_param stm32_sync_inb_gpio_extra_init_params
 
struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
 
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
 
struct stm32_tdm_init_param stm32_tdm_extra_init_params
 
struct stm32_i2c_init_param stm32_i2c_extra_init_params
 
UART_HandleTypeDef huart3
 
bool data_capture_operation
 
struct iio_device_data * ad4170_iio_dev_data
 
uint8_t num_of_active_channels
 
volatile bool tdm_read_started
 
volatile struct iio_device_data * iio_dev_data_g
 
uint32_t nb_of_samples_g
 
volatile uint32_t * buff_start_addr
 
int32_t data_read
 
uint32_t rxdma_ndtr
 
volatile bool ad4170_dma_buff_full
 
uint32_t dma_cycle_count
 
struct stm32_spi_desc * sdesc
 

Detailed Description

Header file for STM32 platform configurations.

Copyright (c) 2023-24 Analog Devices, Inc. All rights reserved.

This software is proprietary to Analog Devices, Inc. and its licensors. By using this software you agree to the terms of the associated Analog Devices Software License Agreement.

Macro Definition Documentation

◆ AD4170_MAX_SPI_SPEED

#define AD4170_MAX_SPI_SPEED   22500000

◆ APP_UART_HANDLE

#define APP_UART_HANDLE   &huart3

◆ DIG_AUX_1

#define DIG_AUX_1   14

◆ DIG_AUX_1_PORT

#define DIG_AUX_1_PORT   6

◆ DIG_AUX_2

#define DIG_AUX_2   12

◆ DIG_AUX_2_PORT

#define DIG_AUX_2_PORT   6

◆ FS_CONFIG_VALUE

#define FS_CONFIG_VALUE   20

◆ GPIO_TRIGGER_INT_PORT

#define GPIO_TRIGGER_INT_PORT   EXTI_GPIOG

◆ HW_CARRIER_NAME

#define HW_CARRIER_NAME   NUCLEO-H563ZI

◆ I2C_TIMING

#define I2C_TIMING   0x00000E14

◆ LED_GPO

#define LED_GPO   LED1_GREEN_Pin

◆ SPI_CSB

#define SPI_CSB   14

◆ STM32_I2C_ID

#define STM32_I2C_ID   1

◆ STM32_SAI_BASE

#define STM32_SAI_BASE   SAI1_Block_A

◆ STM32_SPI_CS_PORT

#define STM32_SPI_CS_PORT   3

◆ STM32_SPI_ID

#define STM32_SPI_ID   1

◆ SYNC_INB

#define SYNC_INB   14

◆ SYNC_INB_PORT

#define SYNC_INB_PORT   4

◆ TDM_DATA_SIZE

#define TDM_DATA_SIZE   32

◆ TDM_DMA_READ_SIZE

#define TDM_DMA_READ_SIZE   TDM_N_SAMPLES_DMA_READ * TDM_SLOTS_PER_FRAME/2

◆ TDM_FS_ACTIVE_LENGTH

#define TDM_FS_ACTIVE_LENGTH   8

◆ TDM_N_SAMPLES_DMA_READ

#define TDM_N_SAMPLES_DMA_READ   800

◆ TDM_SLOTS_PER_FRAME

#define TDM_SLOTS_PER_FRAME   1

◆ TICKER_INTERRUPT_PERIOD_uSEC

#define TICKER_INTERRUPT_PERIOD_uSEC   (0)

Function Documentation

◆ ad4170_dma_rx_cplt()

void ad4170_dma_rx_cplt ( SAI_HandleTypeDef *  hsai)

SAI DMA Receive Complete Callback function.

Parameters
hsai- pointer to a SAI_HandleTypeDef structure
Returns
None

◆ ad4170_dma_rx_half_cplt()

void ad4170_dma_rx_half_cplt ( SAI_HandleTypeDef *  hsai)

SAI DMA Receive Half Complete Callback function.

Parameters
hsai- pointer to a SAI_HandleTypeDef structure
Returns
None

◆ ad4170_spi_dma_rx_cplt_callback()

void ad4170_spi_dma_rx_cplt_callback ( DMA_HandleTypeDef *  hdma)

Callback function to flag the capture of number of requested samples.

Parameters
hdma- DMA handler (Unused)
Returns
None

◆ ad4170_spi_dma_rx_half_cplt_callback()

void ad4170_spi_dma_rx_half_cplt_callback ( DMA_HandleTypeDef *  hdma)

Callback function to flag the capture of Half the number of requested samples.

Parameters
hdma- DMA Handler (Unused)
Returns
None

◆ stm32_abort_dma_transfer()

void stm32_abort_dma_transfer ( void  )

Abort ongoing SPI RX DMA transfer.

Returns
None

Abort ongoing SPI RX DMA transfer.

Returns
None

◆ stm32_system_init()

void stm32_system_init ( void  )

Initialize the STM32 system peripherals.

Returns
None

◆ stm32_timer_stop()

void stm32_timer_stop ( void  )

Stops generating timer signals.

Returns
None

Stops generating timer signals.

Returns
None

◆ tim8_config()

void tim8_config ( void  )

Configure Tx Trigger timer.

Returns
None

◆ tim8_init()

void tim8_init ( struct no_os_pwm_desc *  pwm_desc)

Initialize Tx trigger advanced PWM parameters.

Parameters
pwm_desc[in,out]
Returns
None

◆ update_buff()

void update_buff ( uint32_t *  local_buf,
uint32_t *  buf_start_addr 
)

Update buffer index.

Parameters
local_buf[out]- Local Buffer
buf_start_addr[out]- Buffer start addr
Returns
None

Variable Documentation

◆ ad4170_dma_buff_full

volatile bool ad4170_dma_buff_full
extern

◆ ad4170_iio_dev_data

struct iio_device_data* ad4170_iio_dev_data
extern

◆ buff_start_addr

volatile uint32_t* buff_start_addr
extern

◆ data_capture_operation

bool data_capture_operation
extern

◆ data_read

int32_t data_read
extern

◆ dma_cycle_count

uint32_t dma_cycle_count
extern

◆ huart3

UART_HandleTypeDef huart3
extern

◆ iio_dev_data_g

volatile struct iio_device_data* iio_dev_data_g
extern

◆ nb_of_samples_g

uint32_t nb_of_samples_g
extern

◆ num_of_active_channels

uint8_t num_of_active_channels
extern

◆ rxdma_ndtr

uint32_t rxdma_ndtr
extern

◆ sdesc

struct stm32_spi_desc* sdesc
extern

◆ stm32_csb_gpio_extra_init_params

struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
extern

◆ stm32_dig_aux1_gpio_extra_init_params

struct stm32_gpio_init_param stm32_dig_aux1_gpio_extra_init_params
extern

◆ stm32_dig_aux2_gpio_extra_init_params

struct stm32_gpio_init_param stm32_dig_aux2_gpio_extra_init_params
extern

◆ stm32_i2c_extra_init_params

struct stm32_i2c_init_param stm32_i2c_extra_init_params
extern

◆ stm32_spi_extra_init_params

struct stm32_spi_init_param stm32_spi_extra_init_params
extern

◆ stm32_sync_inb_gpio_extra_init_params

struct stm32_gpio_init_param stm32_sync_inb_gpio_extra_init_params
extern

◆ stm32_tdm_extra_init_params

struct stm32_tdm_init_param stm32_tdm_extra_init_params
extern

◆ stm32_trigger_gpio_extra_init_params

struct stm32_gpio_init_param stm32_trigger_gpio_extra_init_params
extern

◆ stm32_trigger_gpio_irq_init_params

struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
extern

◆ stm32_uart_extra_init_params

struct stm32_uart_init_param stm32_uart_extra_init_params
extern

◆ tdm_read_started

volatile bool tdm_read_started
extern