precision-converters-firmware
Loading...
Searching...
No Matches
Macros | Functions | Variables
app_config_stm32.h File Reference

Header file for STM32 platform configurations. More...

#include <stdint.h>
#include "stm32_hal.h"
#include "stm32_i2c.h"
#include "stm32_irq.h"
#include "stm32_gpio_irq.h"
#include "stm32_gpio.h"
#include "stm32_uart.h"
#include "stm32_dma.h"
#include "stm32_pwm.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 TIMER_ID(x)   x
 
#define TIMER_CHANNEL(x)   x
 
#define AD405x_DMA_NUM_CHANNELS   2
 
#define uart_extra_init_params   stm32_uart_extra_init_params
 
#define vcom_extra_init_params   stm32_vcom_extra_init_params
 
#define i2c_extra_init_params   stm32_i2c_extra_init_params
 
#define cnv_extra_init_params   stm32_gpio_cnv_extra_init_params
 
#define pwm_extra_init_params   stm32_pwm_cnv_extra_init_params
 
#define pwm_gpio_extra_init_params   stm32_pwm_gpio_extra_init_params
 
#define gp0_extra_init_params   stm32_gpio_gp0_extra_init_params
 
#define gp1_extra_init_params   stm32_gpio_gp1_extra_init_params
 
#define trigger_gpio_irq_extra_params   stm32_gpio_irq_extra_init_params
 
#define dma_extra_init_params   stm32_dma_extra_init_params
 
#define cs_extra_init_params   stm32_cs_extra_init_params
 
#define tx_trigger_extra_init_params   stm32_tx_trigger_extra_init_params
 
#define gpio_ops   stm32_gpio_ops
 
#define i2c_ops   stm32_i2c_ops
 
#define uart_ops   stm32_uart_ops
 
#define vcom_ops   stm32_usb_uart_ops
 
#define pwm_ops   stm32_pwm_ops
 
#define trigger_gpio_irq_ops   stm32_gpio_irq_ops
 
#define dma_ops   STM32_DMA_OPS
 
#define MAX_SPI_SCLK   22500000
 
#define MAX_SPI_SCLK_45MHz   45000000
 
#define SAMPLING_RATE_SPI_INTR   62500
 
#define CONV_TRIGGER_DUTY_CYCLE_NSEC(x)   (x / 10)
 
#define SAMPLING_RATE_SPI_DMA   (1000000)
 
#define SAMPLING_RATE_I3C_INTR   (30000)
 
#define SAMPLING_RATE_I3C_DMA   (140000)
 

Functions

void stm32_system_init (void)
 Initialize the STM32 system peripherals.
 
void stm32_system_init_post_verification (void)
 Initialize the STM32 system peripherals after the device has been verified.
 
void stm32_timer_enable (void)
 Starts the timer signal generation for PWM.
 
void stm32_timer_stop (void)
 Stop generating timer signals.
 
void stm32_cs_output_gpio_config (bool is_gpio)
 Configures the chip select pin as output mode.
 
void stm32_config_spi_data_frame_format (bool is_16_bit)
 
void stm32_config_cnv_prescalar (void)
 Configures the prescalar according to the operating mode.
 
int stm32_abort_dma_transfer (void)
 Abort DMA Transfers.
 
void update_buff (uint8_t *local_buf, uint8_t *buf_start_addr)
 Update buffer index.
 
void halfcmplt_callback (DMA_HandleTypeDef *hdma)
 Callback function to flag the capture of Half the number of requested samples.
 
void receivecomplete_callback (DMA_HandleTypeDef *hdma)
 Callback function to flag the transfer of number of requested samples.
 
__weak unsigned int ux_device_stack_tasks_run (void)
 Dummy function for USBx middleware used in STM32H563.
 

Variables

I2C_HandleTypeDef hi2c1
 
DMA_HandleTypeDef AD405x_TxDMA_HANDLE
 
DMA_HandleTypeDef AD405x_RxDMA_HANDLE
 
UART_HandleTypeDef UART_HANDLE
 
volatile bool data_ready
 
struct stm32_uart_init_param stm32_uart_extra_init_params
 
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
 
struct stm32_i2c_init_param stm32_i2c_extra_init_params
 
struct stm32_gpio_init_param stm32_pwm_gpio_extra_init_params
 
struct stm32_gpio_init_param stm32_gpio_cnv_extra_init_params
 
struct stm32_gpio_init_param stm32_gpio_gp0_extra_init_params
 
struct stm32_gpio_init_param stm32_gpio_gp1_extra_init_params
 
struct stm32_gpio_init_param stm32_cs_pwm_gpio_extra_init_params
 
struct stm32_gpio_irq_init_param stm32_gpio_irq_extra_init_params
 
struct stm32_pwm_init_param stm32_pwm_cnv_extra_init_params
 
struct stm32_pwm_init_param stm32_dma_extra_init_params
 
struct stm32_pwm_init_param stm32_cs_extra_init_params
 
struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
 
struct stm32_dma_init_param stm32_spi_dma_extra_init_params
 
uint32_t rxdma_ndtr
 
volatile int dma_cycle_count
 

Detailed Description

Header file for STM32 platform configurations.

Copyright (c) 2023-2025 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

◆ AD405x_DMA_NUM_CHANNELS

#define AD405x_DMA_NUM_CHANNELS   2

◆ cnv_extra_init_params

#define cnv_extra_init_params   stm32_gpio_cnv_extra_init_params

◆ CONV_TRIGGER_DUTY_CYCLE_NSEC

#define CONV_TRIGGER_DUTY_CYCLE_NSEC (   x)    (x / 10)

◆ cs_extra_init_params

#define cs_extra_init_params   stm32_cs_extra_init_params

◆ dma_extra_init_params

#define dma_extra_init_params   stm32_dma_extra_init_params

◆ dma_ops

#define dma_ops   STM32_DMA_OPS

◆ gp0_extra_init_params

#define gp0_extra_init_params   stm32_gpio_gp0_extra_init_params

◆ gp1_extra_init_params

#define gp1_extra_init_params   stm32_gpio_gp1_extra_init_params

◆ gpio_ops

#define gpio_ops   stm32_gpio_ops

◆ i2c_extra_init_params

#define i2c_extra_init_params   stm32_i2c_extra_init_params

◆ i2c_ops

#define i2c_ops   stm32_i2c_ops

◆ MAX_SPI_SCLK

#define MAX_SPI_SCLK   22500000

◆ MAX_SPI_SCLK_45MHz

#define MAX_SPI_SCLK_45MHz   45000000

◆ pwm_extra_init_params

#define pwm_extra_init_params   stm32_pwm_cnv_extra_init_params

◆ pwm_gpio_extra_init_params

#define pwm_gpio_extra_init_params   stm32_pwm_gpio_extra_init_params

◆ pwm_ops

#define pwm_ops   stm32_pwm_ops

◆ SAMPLING_RATE_I3C_DMA

#define SAMPLING_RATE_I3C_DMA   (140000)

◆ SAMPLING_RATE_I3C_INTR

#define SAMPLING_RATE_I3C_INTR   (30000)

◆ SAMPLING_RATE_SPI_DMA

#define SAMPLING_RATE_SPI_DMA   (1000000)

◆ SAMPLING_RATE_SPI_INTR

#define SAMPLING_RATE_SPI_INTR   62500

◆ TIMER_CHANNEL

#define TIMER_CHANNEL (   x)    x

◆ TIMER_ID

#define TIMER_ID (   x)    x

◆ trigger_gpio_irq_extra_params

#define trigger_gpio_irq_extra_params   stm32_gpio_irq_extra_init_params

◆ trigger_gpio_irq_ops

#define trigger_gpio_irq_ops   stm32_gpio_irq_ops

◆ tx_trigger_extra_init_params

#define tx_trigger_extra_init_params   stm32_tx_trigger_extra_init_params

◆ uart_extra_init_params

#define uart_extra_init_params   stm32_uart_extra_init_params

◆ uart_ops

#define uart_ops   stm32_uart_ops

◆ vcom_extra_init_params

#define vcom_extra_init_params   stm32_vcom_extra_init_params

◆ vcom_ops

#define vcom_ops   stm32_usb_uart_ops

Function Documentation

◆ halfcmplt_callback()

void halfcmplt_callback ( DMA_HandleTypeDef *  hdma)

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

Parameters
hdma- DMA Handler (Unused)
Returns
None

◆ receivecomplete_callback()

void receivecomplete_callback ( DMA_HandleTypeDef *  hdma)

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

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

Parameters
hdma[in]- DMA Handler (Unused)
Returns
None
Parameters
hdma- DMA handler (Unused)
Returns
None

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

Parameters
hdma- DMA handler (Unused)
Returns
None

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

Parameters
hdma- DMA Handler (Unused)
Returns
None

◆ stm32_abort_dma_transfer()

int stm32_abort_dma_transfer ( void  )

Abort DMA Transfers.

Returns
None

◆ stm32_config_cnv_prescalar()

void stm32_config_cnv_prescalar ( void  )

Configures the prescalar according to the operating mode.

Returns
None
Here is the caller graph for this function:

◆ stm32_config_spi_data_frame_format()

void stm32_config_spi_data_frame_format ( bool  is_16_bit)

◆ stm32_cs_output_gpio_config()

void stm32_cs_output_gpio_config ( bool  is_gpio)

Configures the chip select pin as output mode.

Parameters
is_gpio[in]Mode of the Pin
Returns
None
Here is the caller graph for this function:

◆ stm32_system_init()

void stm32_system_init ( void  )

Initialize the STM32 system peripherals.

Returns
None

◆ stm32_system_init_post_verification()

void stm32_system_init_post_verification ( void  )

Initialize the STM32 system peripherals after the device has been verified.

Returns
None
Here is the caller graph for this function:

◆ stm32_timer_enable()

void stm32_timer_enable ( void  )

Starts the timer signal generation for PWM.

Returns
0 in case of success, negative error code otherwise

Starts the timer signal generation for PWM.

Returns
None

◆ stm32_timer_stop()

void stm32_timer_stop ( void  )

Stop generating timer signals.

Returns
0 in case of success, negative error code otherwise

Stop generating timer signals.

Returns
None
None

◆ update_buff()

void update_buff ( uint8_t *  local_buf,
uint8_t *  buf_start_addr 
)

Update buffer index.

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

◆ ux_device_stack_tasks_run()

__weak unsigned int ux_device_stack_tasks_run ( void  )

Dummy function for USBx middleware used in STM32H563.

Returns
0
Here is the caller graph for this function:

Variable Documentation

◆ AD405x_RxDMA_HANDLE

DMA_HandleTypeDef AD405x_RxDMA_HANDLE
extern

◆ AD405x_TxDMA_HANDLE

DMA_HandleTypeDef AD405x_TxDMA_HANDLE
extern

◆ data_ready

volatile bool data_ready
extern

◆ dma_cycle_count

volatile int dma_cycle_count
extern

◆ hi2c1

I2C_HandleTypeDef hi2c1
extern

◆ rxdma_ndtr

uint32_t rxdma_ndtr
extern

◆ stm32_cs_extra_init_params

struct stm32_pwm_init_param stm32_cs_extra_init_params
extern

◆ stm32_cs_pwm_gpio_extra_init_params

struct stm32_gpio_init_param stm32_cs_pwm_gpio_extra_init_params
extern

◆ stm32_dma_extra_init_params

struct stm32_pwm_init_param stm32_dma_extra_init_params
extern

◆ stm32_gpio_cnv_extra_init_params

struct stm32_gpio_init_param stm32_gpio_cnv_extra_init_params
extern

◆ stm32_gpio_gp0_extra_init_params

struct stm32_gpio_init_param stm32_gpio_gp0_extra_init_params
extern

◆ stm32_gpio_gp1_extra_init_params

struct stm32_gpio_init_param stm32_gpio_gp1_extra_init_params
extern

◆ stm32_gpio_irq_extra_init_params

struct stm32_gpio_irq_init_param stm32_gpio_irq_extra_init_params
extern

◆ stm32_i2c_extra_init_params

struct stm32_i2c_init_param stm32_i2c_extra_init_params
extern

◆ stm32_pwm_cnv_extra_init_params

struct stm32_pwm_init_param stm32_pwm_cnv_extra_init_params
extern

◆ stm32_pwm_gpio_extra_init_params

struct stm32_gpio_init_param stm32_pwm_gpio_extra_init_params
extern

◆ stm32_spi_dma_extra_init_params

struct stm32_dma_init_param stm32_spi_dma_extra_init_params
extern

◆ stm32_tx_trigger_extra_init_params

struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
extern

◆ stm32_uart_extra_init_params

struct stm32_uart_init_param stm32_uart_extra_init_params
extern

◆ stm32_vcom_extra_init_params

struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
extern

◆ UART_HANDLE

UART_HandleTypeDef UART_HANDLE
extern