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

Source file for STM32 platform configurations. More...

#include <stdbool.h>
#include "app_config.h"
#include "app_config_stm32.h"
#include "ad469x_iio.h"
#include "ad469x.h"
#include "no_os_pwm.h"
Include dependency graph for app_config_stm32.c:

Macros

#define TIM_CCMR_CCS_OUTPUT   0
 
#define TIM_CR2_MMS_COMPARE_PULSE   3
 
#define TIM_SMCR_SMS_TRIGGER   6
 
#define TIM_ITR_SOURCE   0
 

Functions

void receivecomplete_callback (DMA_HandleTypeDef *hdma)
 Callback function to flag the capture of number of requested samples. More...
 
void stm32_system_init (void)
 Initialize the STM32 system peripherals. More...
 
void stm32_timer_enable (void)
 Starts the timer signal generation for PWM and OC channels all at once. More...
 
void stm32_timer_stop (void)
 Disable PWM signals. More...
 
void stm32_abort_dma_transfer (void)
 Abort DMA Transfers. More...
 
void stm32_cs_output_gpio_config (bool is_gpio)
 Configures the chip select pin as output mode. More...
 
void stm32_cnv_output_gpio_config (bool is_gpio)
 Configures the conversion pin as output mode. More...
 
void halfcmplt_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 DMA2_Stream0_IRQHandler (void)
 DMA2 Stream0 IRQ Handler. More...
 

Variables

volatile bool ad469x_conversion_flag
 
struct stm32_uart_init_param stm32_uart_extra_init_params
 
struct stm32_spi_init_param stm32_spi_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_gpio_reset_extra_init_params
 
struct stm32_gpio_irq_init_param stm32_gpio_irq_extra_init_params
 
struct stm32_gpio_init_param stm32_pwm_gpio_extra_init_params
 
struct stm32_pwm_init_param stm32_pwm_cnv_extra_init_params
 
struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
 

Detailed Description

Source file for STM32 platform configurations.

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.

Macro Definition Documentation

◆ TIM_CCMR_CCS_OUTPUT

#define TIM_CCMR_CCS_OUTPUT   0

◆ TIM_CR2_MMS_COMPARE_PULSE

#define TIM_CR2_MMS_COMPARE_PULSE   3

◆ TIM_ITR_SOURCE

#define TIM_ITR_SOURCE   0

◆ TIM_SMCR_SMS_TRIGGER

#define TIM_SMCR_SMS_TRIGGER   6

Function Documentation

◆ DMA2_Stream0_IRQHandler()

void DMA2_Stream0_IRQHandler ( void  )

DMA2 Stream0 IRQ Handler.

Parameters
None
Returns
None

◆ halfcmplt_callback()

void halfcmplt_callback ( DMA_HandleTypeDef *  hdma)

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

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 capture of number of requested samples.

Parameters
hdma- DMA handler (Unused)
Returns
None

◆ stm32_abort_dma_transfer()

void stm32_abort_dma_transfer ( void  )

Abort DMA Transfers.

Abort ongoing SPI RX DMA transfer.

Returns
None

◆ stm32_cnv_output_gpio_config()

void stm32_cnv_output_gpio_config ( bool  is_gpio)

Configures the conversion pin as output mode.

Parameters
is_gpio[in]Mode of the Pin
Returns
None

◆ 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

◆ stm32_system_init()

void stm32_system_init ( void  )

Initialize the STM32 system peripherals.

Returns
None

◆ stm32_timer_enable()

void stm32_timer_enable ( void  )

Starts the timer signal generation for PWM and OC channels all at once.

Returns
None

◆ stm32_timer_stop()

void stm32_timer_stop ( void  )

Disable PWM signals.

Stops generating timer signals.

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

◆ ad469x_conversion_flag

volatile bool ad469x_conversion_flag
extern

◆ stm32_gpio_cnv_extra_init_params

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

◆ stm32_gpio_gp0_extra_init_params

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

◆ stm32_gpio_gp1_extra_init_params

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

◆ stm32_gpio_irq_extra_init_params

struct stm32_gpio_irq_init_param stm32_gpio_irq_extra_init_params
Initial value:
= {
.port_nb = GP0_PORT_NUM,
}
#define GP0_PORT_NUM
Definition: app_config_mbed.h:60

◆ stm32_gpio_reset_extra_init_params

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

◆ stm32_pwm_cnv_extra_init_params

struct stm32_pwm_init_param stm32_pwm_cnv_extra_init_params
Initial value:
= {
.prescaler = TIMER_1_PRESCALER,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = TIMER_CHANNEL_3,
.complementary_channel = false,
.get_timer_clock = HAL_RCC_GetPCLK2Freq,
.clock_divider = TIMER_1_CLK_DIVIDER,
.trigger_enable = false,
.trigger_output = PWM_TRGO_OC1
}
#define TIMER_1_PRESCALER
Definition: app_config_stm32.h:62
#define TIMER_CHANNEL_3
Definition: app_config_stm32.h:74
#define TIMER_1_CLK_DIVIDER
Definition: app_config_stm32.h:68

◆ stm32_pwm_gpio_extra_init_params

struct stm32_gpio_init_param stm32_pwm_gpio_extra_init_params
Initial value:
= {
.mode = GPIO_MODE_AF_PP,
.speed = GPIO_SPEED_FREQ_VERY_HIGH,
.alternate = GPIO_AF1_TIM1
}

◆ stm32_spi_extra_init_params

struct stm32_spi_init_param stm32_spi_extra_init_params
Initial value:
= {
.chip_select_port = SPI_CS_PORT_NUM,
.get_input_clock = HAL_RCC_GetPCLK2Freq,
.alternate = GPIO_AF1_TIM2
}
#define SPI_CS_PORT_NUM
Definition: app_config_stm32.h:47

◆ stm32_uart_extra_init_params

struct stm32_uart_init_param stm32_uart_extra_init_params
Initial value:
= {
.huart = &huart5,
}
UART_HandleTypeDef huart5

◆ stm32_vcom_extra_init_params

struct stm32_usb_uart_init_param stm32_vcom_extra_init_params
Initial value:
= {
.husbdevice = &hUsbDeviceHS,
}
USBD_HandleTypeDef hUsbDeviceHS