no-OS
Variables
parameters.c File Reference

Definition of STM32 platform data used by eval-ad738x project. More...

#include "parameters.h"
#include "stm32_dma.h"
#include "no_os_pwm.h"
Include dependency graph for parameters.c:

Variables

DMA_HandleTypeDef hdma_tim8_ch1
 
DMA_HandleTypeDef hdma_spi1_rx
 
struct stm32_uart_init_param uart_extra_ip
 
struct no_os_dma_init_param dma_init
 
struct stm32_dma_channel txdma_channel
 
struct stm32_dma_channel rxdma_channel
 
struct stm32_pwm_init_param trigger_pwm_extra_init_params
 
struct stm32_pwm_init_param cs_pwm_extra_init_params
 
struct no_os_pwm_init_param cs_pwm_init
 
struct stm32_pwm_init_param tx_pwm_extra_init_params
 
struct no_os_pwm_init_param tx_pwm_init
 
struct stm32_spi_init_param spi_extra_ip
 

Detailed Description

Definition of STM32 platform data used by eval-ad738x project.

Author
Axel Haslam (ahasl.nosp@m.am@b.nosp@m.aylib.nosp@m.re.c.nosp@m.om)

Copyright 2024(c) Analog Devices, Inc. Copyright 2024(c) BayLibre, SAS.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  3. Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Variable Documentation

◆ cs_pwm_extra_init_params

struct stm32_pwm_init_param cs_pwm_extra_init_params
Initial value:
= {
.prescaler = 1,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = 1,
.complementary_channel = false,
.get_timer_clock = HAL_RCC_GetPCLK1Freq,
.clock_divider = 2,
.onepulse_enable = true,
.trigger_enable = true,
.trigger_source = PWM_TS_ITR0,
.trigger_output = PWM_TRGO_ENABLE,
}

◆ cs_pwm_init

struct no_os_pwm_init_param cs_pwm_init
Initial value:
= {
.id = 2,
.period_ns = CS_PWM_PERIOD_NS,
.duty_cycle_ns = CS_PWM_DUTY_NS,
.platform_ops = &stm32_pwm_ops,
}

◆ dma_init

struct no_os_dma_init_param dma_init
Initial value:
= {
.id = 0,
.num_ch = 2,
.platform_ops = &stm32_dma_ops,
}

◆ hdma_spi1_rx

DMA_HandleTypeDef hdma_spi1_rx

◆ hdma_tim8_ch1

DMA_HandleTypeDef hdma_tim8_ch1

◆ rxdma_channel

struct stm32_dma_channel rxdma_channel
Initial value:
= {
.hdma = &hdma_spi1_rx,
.ch_num = DMA_CHANNEL_3,
.mem_increment = true,
.mem_data_alignment = DATA_ALIGN_BYTE,
.per_data_alignment = DATA_ALIGN_BYTE,
.dma_mode = DMA_NORMAL_MODE,
}

◆ spi_extra_ip

struct stm32_spi_init_param spi_extra_ip
Initial value:
= {
.chip_select_port = SPI_CS_PORT,
.get_input_clock = HAL_RCC_GetPCLK2Freq,
.dma_init = &dma_init,
.txdma_ch = &txdma_channel,
.rxdma_ch = &rxdma_channel,
.irq_num = DMA2_Stream0_IRQn,
.pwm_init = &cs_pwm_init,
.tx_pwm_init = &tx_pwm_init,
.alternate = GPIO_AF1_TIM1,
}

◆ trigger_pwm_extra_init_params

struct stm32_pwm_init_param trigger_pwm_extra_init_params
Initial value:
= {
.prescaler = 1,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = 3,
.complementary_channel = false,
.get_timer_clock = HAL_RCC_GetPCLK2Freq,
.clock_divider = 2,
.trigger_output = PWM_TRGO_UPDATE,
}

◆ tx_pwm_extra_init_params

struct stm32_pwm_init_param tx_pwm_extra_init_params
Initial value:
= {
.prescaler = 1,
.timer_autoreload = true,
.mode = TIM_OC_PWM1,
.timer_chn = 1,
.complementary_channel = false,
.get_timer_clock = HAL_RCC_GetPCLK2Freq,
.clock_divider = 2,
.onepulse_enable = true,
.trigger_enable = true,
.trigger_source = PWM_TS_ITR0,
.dma_enable = true,
.repetitions = TX_PWM_REPS,
}

◆ tx_pwm_init

struct no_os_pwm_init_param tx_pwm_init
Initial value:
= {
.id = 8,
.period_ns = TX_PWM_PERIOD_NS,
.duty_cycle_ns = TX_PWM_DUTY_NS,
.platform_ops = PWM_OPS,
}

◆ txdma_channel

struct stm32_dma_channel txdma_channel
Initial value:
= {
.hdma = &hdma_tim8_ch1,
.ch_num = DMA_CHANNEL_7,
.mem_increment = false,
.mem_data_alignment = DATA_ALIGN_BYTE,
.per_data_alignment = DATA_ALIGN_BYTE,
.dma_mode = DMA_CIRCULAR_MODE
}

◆ uart_extra_ip

struct stm32_uart_init_param uart_extra_ip
Initial value:
= {
.huart = &huart5,
}
PWM_TRGO_ENABLE
@ PWM_TRGO_ENABLE
Definition: stm32_pwm.h:70
PWM_TRGO_UPDATE
@ PWM_TRGO_UPDATE
Definition: stm32_pwm.h:71
PWM_OPS
#define PWM_OPS
Definition: parameters.h:112
TX_PWM_PERIOD_NS
#define TX_PWM_PERIOD_NS
Definition: parameters.h:97
tx_pwm_init
struct no_os_pwm_init_param tx_pwm_init
Definition: parameters.c:134
cs_pwm_extra_init_params
struct stm32_pwm_init_param cs_pwm_extra_init_params
Definition: parameters.c:94
SPI_CS_PORT
#define SPI_CS_PORT
Definition: parameters.h:70
cs_pwm_init
struct no_os_pwm_init_param cs_pwm_init
Definition: parameters.c:108
stm32_dma_ops
const struct no_os_dma_platform_ops stm32_dma_ops
stm32 platform specific DMA platform ops structure
Definition: stm32_dma.c:330
TIM_OC_PWM1
@ TIM_OC_PWM1
Definition: stm32_pwm.h:57
hdma_tim8_ch1
DMA_HandleTypeDef hdma_tim8_ch1
stm32_pwm_ops
const struct no_os_pwm_platform_ops stm32_pwm_ops
STM32 platform specific PWM platform ops structure.
Definition: stm32_pwm.c:709
rxdma_channel
struct stm32_dma_channel rxdma_channel
Definition: parameters.c:66
txdma_channel
struct stm32_dma_channel txdma_channel
Definition: parameters.c:57
DMA_CIRCULAR_MODE
@ DMA_CIRCULAR_MODE
Definition: stm32_dma.h:57
NO_OS_PWM_POLARITY_HIGH
@ NO_OS_PWM_POLARITY_HIGH
Definition: no_os_pwm.h:57
tx_pwm_extra_init_params
struct stm32_pwm_init_param tx_pwm_extra_init_params
Definition: parameters.c:119
hdma_spi1_rx
DMA_HandleTypeDef hdma_spi1_rx
DATA_ALIGN_BYTE
@ DATA_ALIGN_BYTE
Definition: stm32_dma.h:46
PWM_TS_ITR0
@ PWM_TS_ITR0
Definition: stm32_pwm.h:62
CS_PWM_DUTY_NS
#define CS_PWM_DUTY_NS
Definition: parameters.h:103
TX_PWM_REPS
#define TX_PWM_REPS
Definition: parameters.h:99
DMA_NORMAL_MODE
@ DMA_NORMAL_MODE
Definition: stm32_dma.h:56
CS_PWM_PERIOD_NS
#define CS_PWM_PERIOD_NS
Definition: parameters.h:102
dma_init
struct no_os_dma_init_param dma_init
Definition: parameters.c:51
huart5
UART_HandleTypeDef huart5
TX_PWM_DUTY_NS
#define TX_PWM_DUTY_NS
Definition: parameters.h:98