precision-converters-firmware
Functions | Variables
app_config_stm32.c File Reference

Application configurations module for STM32 platform. More...

#include "app_config_stm32.h"
#include "no_os_error.h"
#include "no_os_util.h"
Include dependency graph for app_config_stm32.c:

Functions

void stm32_system_init (void)
 Initialize the STM32 system peripherals. More...
 
void EXTI15_10_IRQHandler (void)
 This function handles the LDAC GPIO interrupt event. More...
 
void TIM4_IRQHandler (void)
 This function handles the timer interrupt event which is used to stop the spi dma transfer. More...
 
int32_t stm32_spi_dma_enable (struct stm32_spi_desc *spidesc, struct iio_device_data *iio_dev_data, uint16_t num_of_bytes_transfer, uint8_t start_addr)
 Enables SPI DMA to move data from iio buffer to SPI TX buffer. More...
 
int32_t stm32_spi_dma_disable (struct stm32_spi_desc *spidesc)
 Disable SPI DMA which move data from iio buffer to SPI TX buffer. More...
 

Variables

struct stm32_uart_init_param stm32_uart_init_params
 
struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
 
struct stm32_spi_init_param stm32_spi_init_params
 
struct stm32_spi_init_param stm32_spi_init_params_without_sw_csb
 
struct stm32_gpio_init_param stm32_gpio_ldac_init_params
 
struct stm32_gpio_init_param stm32_spi_dma_tx_stop_pwm_gpio_init_params
 
struct stm32_gpio_init_param stm32_gpio_reset_init_params
 
struct stm32_pwm_init_param stm32_ldac_pwm_init_params
 
struct stm32_pwm_init_param stm32_spi_dma_tx_stop_pwm_init_params
 
uint32_t spi_dma_tx_stop_pwm_frequency [NUMBER_OF_CHANNELS] = { 3214285,319182 }
 

Detailed Description

Application configurations module for STM32 platform.

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

Function Documentation

◆ EXTI15_10_IRQHandler()

void EXTI15_10_IRQHandler ( void  )

This function handles the LDAC GPIO interrupt event.

Returns
None

◆ stm32_spi_dma_disable()

int32_t stm32_spi_dma_disable ( struct stm32_spi_desc *  spidesc)

Disable SPI DMA which move data from iio buffer to SPI TX buffer.

Parameters
desc[in]-Pointer to ad3552r device descriptor
Returns
0 in case of success, negative error code otherwise

◆ stm32_spi_dma_enable()

int32_t stm32_spi_dma_enable ( struct stm32_spi_desc *  spidesc,
struct iio_device_data *  iio_dev_data,
uint16_t  num_of_bytes_transfer,
uint8_t  start_addr 
)

Enables SPI DMA to move data from iio buffer to SPI TX buffer.

Parameters
desc[in]-Pointer to ad3552r device descriptor
iio_dev_data[in]-Pointer to IIO device data structure
num_of_bytes_transfer[in]-number of bytes to transfer for each ldac cycle.
start_addr[in]-starting address need to be transferred in streaming mode of ad3552r
Returns
0 in case of success, negative error code otherwise

◆ stm32_system_init()

void stm32_system_init ( void  )

Initialize the STM32 system peripherals.

Returns
None
Here is the caller graph for this function:

◆ TIM4_IRQHandler()

void TIM4_IRQHandler ( void  )

This function handles the timer interrupt event which is used to stop the spi dma transfer.

Returns
None

Variable Documentation

◆ spi_dma_tx_stop_pwm_frequency

uint32_t spi_dma_tx_stop_pwm_frequency[NUMBER_OF_CHANNELS] = { 3214285,319182 }

◆ stm32_gpio_ldac_init_params

struct stm32_gpio_init_param stm32_gpio_ldac_init_params
Initial value:
= {
.mode = GPIO_MODE_AF_PP,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
.alternate = GPIO_AF9_TIM12
}

◆ stm32_gpio_reset_init_params

struct stm32_gpio_init_param stm32_gpio_reset_init_params
Initial value:
= {
.mode = GPIO_MODE_OUTPUT_PP
}

◆ stm32_ldac_pwm_init_params

struct stm32_pwm_init_param stm32_ldac_pwm_init_params
Initial value:
= {
.prescaler = LDAC_PWM_PRESCALER,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = LDAC_PWM_CHANNEL,
.get_timer_clock = HAL_RCC_GetPCLK1Freq,
.clock_divider = LDAC_PWM_CLK_DIVIDER
}
#define LDAC_PWM_PRESCALER
Definition: app_config_stm32.h:105
#define LDAC_PWM_CLK_DIVIDER
Definition: app_config_stm32.h:65
#define LDAC_PWM_CHANNEL
Definition: app_config_stm32.h:64

◆ stm32_spi_dma_tx_stop_pwm_gpio_init_params

struct stm32_gpio_init_param stm32_spi_dma_tx_stop_pwm_gpio_init_params
Initial value:
= {
.mode = GPIO_MODE_AF_PP,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
.alternate = GPIO_AF2_TIM4
}

◆ stm32_spi_dma_tx_stop_pwm_init_params

struct stm32_pwm_init_param stm32_spi_dma_tx_stop_pwm_init_params
Initial value:
= {
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.get_timer_clock = HAL_RCC_GetPCLK1Freq,
}
#define SPI_DMA_TX_STOP_PWM_CLK_DIVIDER
Definition: app_config_stm32.h:71
#define SPI_DMA_TX_STOP_PWM_PRESCALER
Definition: app_config_stm32.h:69
#define SPI_DMA_TX_STOP_PWM_CHANNEL
Definition: app_config_stm32.h:70

◆ stm32_spi_init_params

struct stm32_spi_init_param stm32_spi_init_params
Initial value:
= {
.chip_select_port = STM32_SPI_CS_PORT,
.get_input_clock = HAL_RCC_GetPCLK2Freq
}
#define STM32_SPI_CS_PORT
Definition: app_config_stm32.h:54

◆ stm32_spi_init_params_without_sw_csb

struct stm32_spi_init_param stm32_spi_init_params_without_sw_csb
Initial value:
= {
.chip_select_port = STM32_SPI_CS_PORT,
.get_input_clock = HAL_RCC_GetPCLK2Freq
}

◆ stm32_trigger_gpio_irq_init_params

struct stm32_gpio_irq_init_param stm32_trigger_gpio_irq_init_params
Initial value:
= {
}
#define GPIO_TRIGGER_INT_PORT
Definition: app_config_stm32.h:47

◆ stm32_uart_init_params

struct stm32_uart_init_param stm32_uart_init_params
Initial value:
= {
.huart = APP_UART_HANDLE
}
#define APP_UART_HANDLE
Definition: app_config_stm32.h:39