precision-converters-firmware
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 "app_config.h"
#include "stm32_tdm_support.h"
#include "ad4170_iio.h"
#include "no_os_pwm.h"
Include dependency graph for app_config_stm32.c:

Functions

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

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_tdm_init_param stm32_tdm_extra_init_params
 
struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
 
struct stm32_i2c_init_param stm32_i2c_extra_init_params
 
struct stm32_dma_channel txdma_channel
 
struct stm32_dma_channel rxdma_channel
 
struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
 
uint32_t rxdma_ndtr
 
uint32_t dma_cycle_count = 0
 
uint8_t * iio_buf_start_idx
 
uint8_t * dma_buf_start_idx
 
uint8_t * iio_buf_current_idx
 
uint8_t * dma_buf_current_idx
 
struct stm32_spi_desc * sdesc
 

Detailed Description

Application configurations module for STM32 platform.

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.

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

◆ HAL_RCC_GetSysClockFreq_app()

uint32_t HAL_RCC_GetSysClockFreq_app ( )

Return the peripheral frequency.

Returns
Peripheral frequency in Hz

◆ stm32_abort_dma_transfer()

void stm32_abort_dma_transfer ( void  )

Abort DMA Transfers.

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  )

Disable Timer signals.

Stop generating timer signals.

Returns
None

◆ tim8_config()

void tim8_config ( void  )

Configure Tx Trigger timer.

Configure Tx Trigger timer for slave mode operation, one-pulse mode and to generate DMA requests.

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

◆ dma_buf_current_idx

uint8_t* dma_buf_current_idx

◆ dma_buf_start_idx

uint8_t* dma_buf_start_idx

◆ dma_cycle_count

uint32_t dma_cycle_count = 0

◆ iio_buf_current_idx

uint8_t* iio_buf_current_idx

◆ iio_buf_start_idx

uint8_t* iio_buf_start_idx

◆ rxdma_channel

struct stm32_dma_channel rxdma_channel
Initial value:
= {
.hdma = &hdma_spi1_rx,
.mem_increment = true,
.mem_data_alignment = DATA_ALIGN_BYTE,
.per_data_alignment = DATA_ALIGN_BYTE,
.dma_mode = DMA_CIRCULAR_MODE,
}
DMA_HandleTypeDef hdma_spi1_rx
#define AD469x_RxDMA_CHANNEL_NUM
Definition app_config_stm32.h:94

◆ rxdma_ndtr

uint32_t rxdma_ndtr

◆ sdesc

struct stm32_spi_desc* sdesc

◆ stm32_csb_gpio_extra_init_params

struct stm32_gpio_init_param stm32_csb_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_OUTPUT_PP,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
}

◆ stm32_dig_aux1_gpio_extra_init_params

struct stm32_gpio_init_param stm32_dig_aux1_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_INPUT,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
}

◆ stm32_dig_aux2_gpio_extra_init_params

struct stm32_gpio_init_param stm32_dig_aux2_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_INPUT,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
}

◆ stm32_i2c_extra_init_params

struct stm32_i2c_init_param stm32_i2c_extra_init_params
Initial value:
= {
.i2c_timing = I2C_TIMING
}
#define I2C_TIMING
Definition app_config_stm32.h:60

◆ stm32_spi_extra_init_params

struct stm32_spi_init_param stm32_spi_extra_init_params
Initial value:
= {
.chip_select_port = STM32_SPI_CS_PORT,
.get_input_clock = HAL_RCC_GetSysClockFreq_app
}
#define STM32_SPI_CS_PORT
Definition app_config_stm32.h:56
uint32_t HAL_RCC_GetSysClockFreq_app()
Return the peripheral frequency.
Definition app_config_stm32.c:38

◆ stm32_sync_inb_gpio_extra_init_params

struct stm32_gpio_init_param stm32_sync_inb_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_OUTPUT_PP,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
}

◆ stm32_tdm_extra_init_params

struct stm32_tdm_init_param stm32_tdm_extra_init_params
Initial value:
= {
.base = STM32_SAI_BASE,
}
#define STM32_SAI_BASE
Definition app_config_stm32.h:132

◆ stm32_trigger_gpio_extra_init_params

struct stm32_gpio_init_param stm32_trigger_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_INPUT,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
}

◆ stm32_tx_trigger_extra_init_params

struct stm32_pwm_init_param stm32_tx_trigger_extra_init_params
Initial value:
= {
.prescaler = TIMER_8_PRESCALER,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = TIMER_CHANNEL_1,
.complementary_channel = false,
.get_timer_clock = HAL_RCC_GetPCLK1Freq,
.clock_divider = TIMER_8_CLK_DIVIDER,
.trigger_output = PWM_TRGO_UPDATE,
.dma_enable = true,
.repetitions = BYTES_PER_SAMPLE - 1,
.onepulse_enable = true
}
#define BYTES_PER_SAMPLE
Definition ad2s1210_iio.c:67
#define TIMER_8_CLK_DIVIDER
Definition app_config_stm32.h:81
#define TIMER_CHANNEL_1
Definition app_config_stm32.h:82
#define TIMER_8_PRESCALER
Definition app_config_stm32.h:80

◆ stm32_uart_extra_init_params

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

◆ txdma_channel

struct stm32_dma_channel txdma_channel
Initial value:
= {
.hdma = &hdma_tim8_ch1,
.mem_increment = false,
.mem_data_alignment = DATA_ALIGN_BYTE,
.per_data_alignment = DATA_ALIGN_BYTE,
.dma_mode = DMA_CIRCULAR_MODE
}
DMA_HandleTypeDef hdma_tim8_ch1
#define AD469x_TxDMA_CHANNEL_NUM
Definition app_config_stm32.h:93