Go to the documentation of this file.
42 #ifdef HAL_TIM_MODULE_ENABLED
65 #ifdef HAL_TIM_MODULE_ENABLED
98 #ifdef HAL_TIM_MODULE_ENABLED
110 #endif // STM32_SPI_H_
Structure holding the initialization parameters for stm32 platform specific SPI parameters.
Definition: stm32_spi.h:51
int32_t stm32_spi_altrnate_cs_enable(struct no_os_spi_desc *desc, bool enable)
enable CS gpio alternate function
Definition: stm32_spi.c:301
void * extra
Definition: no_os_gpio.h:106
uint32_t timeout
Definition: ad413x.c:49
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
Structure containing the init parameters needed by the PWM generator.
Definition: no_os_pwm.h:66
enum no_os_gpio_pull_up pull
Definition: no_os_gpio.h:85
Platform independent function definitions and data types for the DMA API.
uint32_t device_id
Definition: no_os_spi.h:196
bool stm32_spi_dma_done
Definition: stm32_spi.h:93
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:48
stm32 platform specific SPI descriptor
Definition: stm32_spi.h:76
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:150
GPIO_TypeDef * port
Definition: stm32_gpio.h:59
Header file of SPI Interface.
Initialization parameter for the DMA controller.
Definition: no_os_dma.h:171
uint32_t id
Definition: no_os_dma.h:109
int32_t no_os_pwm_remove(struct no_os_pwm_desc *desc)
Free the resources allocated by no_os_pwm_init().
Definition: no_os_pwm.c:79
int32_t stm32_spi_dma_transfer_sync(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Configure and start a series of transfers using DMA. Wait for the completion before returning.
Definition: stm32_spi.c:685
Definition: no_os_spi.h:100
uint32_t irq_num
Definition: no_os_dma.h:115
Header file of Delay functions.
struct stm32_dma_channel * tx_ch_xfer
Definition: stm32_spi.h:97
uint32_t mode
Definition: stm32_gpio.h:46
@ DEV_TO_MEM
Definition: no_os_dma.h:52
Header file for the stm32 spi driver.
struct no_os_dma_ch * rxdma_ch
Definition: stm32_spi.h:88
int32_t port
Definition: no_os_gpio.h:81
int32_t stm32_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: stm32_spi.c:450
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
int32_t number
Definition: no_os_gpio.h:83
Structure holding the initialization parameters for stm32 platform.
Definition: stm32_gpio.h:44
struct stm32_dma_channel * txdma_ch
Definition: stm32_spi.h:63
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
void(* stm32_spi_dma_user_cb)(void *ctx)
Definition: stm32_spi.h:94
SPI_HandleTypeDef hspi
Definition: stm32_spi.h:78
@ NO_OS_PULL_NONE
Definition: no_os_gpio.h:66
const struct no_os_gpio_platform_ops * platform_ops
Definition: no_os_gpio.h:87
DMA_HandleTypeDef * hdma
Definition: stm32_dma.h:66
uint32_t alternate
Definition: stm32_spi.h:57
int no_os_dma_config_xfer(struct no_os_dma_desc *, struct no_os_dma_xfer_desc *, uint32_t, struct no_os_dma_ch *)
Acquire a channel and configure the list of transfers.
Definition: no_os_dma.c:242
uint8_t * tx_buff
Definition: no_os_spi.h:102
uint32_t device_id
Definition: no_os_spi.h:142
struct stm32_dma_channel * rxdma_ch
Definition: stm32_spi.h:61
uint8_t chip_select
Definition: no_os_spi.h:146
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
uint8_t chip_select
Definition: no_os_spi.h:200
uint32_t irq_num
Definition: stm32_spi.h:64
int32_t no_os_pwm_enable(struct no_os_pwm_desc *desc)
Enable PWM signal generation.
Definition: no_os_pwm.c:98
int32_t stm32_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: stm32_spi.c:158
uint32_t alternate
Definition: stm32_spi.h:82
struct stm32_dma_channel * rx_ch_xfer
Definition: stm32_spi.h:96
Describes the state of a DMA channel.
Definition: no_os_dma.h:107
uint8_t * rx_buff
Definition: no_os_spi.h:104
struct no_os_dma_ch * txdma_ch
Definition: stm32_spi.h:90
uint8_t * dst
Definition: no_os_dma.h:75
int32_t no_os_pwm_disable(struct no_os_pwm_desc *desc)
Disable PWM signal generation.
Definition: no_os_pwm.c:115
STM32 DMA Channels.
Definition: stm32_dma.h:64
const struct no_os_spi_platform_ops stm32_spi_ops
stm32 specific SPI platform ops structure
Definition: stm32_spi.c:711
void stm32_spi_dma_callback(struct no_os_dma_xfer_desc *old_xfer, struct no_os_dma_xfer_desc *next_xfer, void *ctx)
Definition: stm32_spi.c:598
int32_t stm32_config_dma_and_start(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void(*callback)(struct no_os_dma_xfer_desc *old_xfer, struct no_os_dma_xfer_desc *next_xfer, void *ctx), void *ctx)
Configure and start a series of transfers using DMA.
Definition: stm32_spi.c:479
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:204
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
It's used to setup a generic DMA transfer.
Definition: no_os_dma.h:71
struct no_os_dma_init_param * dma_init
Definition: stm32_spi.h:59
void * xfer_complete_ctx
Definition: no_os_dma.h:89
int32_t stm32_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: stm32_spi.c:270
void(* xfer_complete_cb)(struct no_os_dma_xfer_desc *, struct no_os_dma_xfer_desc *, void *)
Definition: no_os_dma.h:82
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
uint32_t chip_select_port
Definition: stm32_spi.h:53
int no_os_dma_init(struct no_os_dma_desc **, struct no_os_dma_init_param *)
Initialize the DMA controller.
Definition: no_os_dma.c:90
int no_os_dma_xfer_start(struct no_os_dma_desc *, struct no_os_dma_ch *)
Acquire a channel and configure the list of transfers.
Definition: no_os_dma.c:356
Structure representing an PWM generator device.
Definition: no_os_pwm.h:93
uint32_t bytes_number
Definition: no_os_spi.h:106
void * extra
Definition: no_os_spi.h:212
int32_t no_os_pwm_init(struct no_os_pwm_desc **desc, const struct no_os_pwm_init_param *param)
Initialize the PWM peripheral.
Definition: no_os_pwm.c:51
int32_t no_os_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: no_os_gpio.c:49
void * stm32_spi_dma_user_ctx
Definition: stm32_spi.h:95
uint32_t max_speed_hz
Definition: no_os_spi.h:144
Header file of PWM Interface.
Header file for stm32 gpio specifics.
enum no_os_dma_xfer_type xfer_type
Definition: no_os_dma.h:79
#define NO_OS_BIT(x)
Definition: no_os_util.h:45
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
int no_os_dma_remove(struct no_os_dma_desc *)
Remove resources allocated for the DMA controller.
Definition: no_os_dma.c:143
struct no_os_dma_desc * dma_desc
Definition: stm32_spi.h:86
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
#define NULL
Definition: wrapper.h:64
const struct no_os_spi_platform_ops stm32_spi_ops
stm32 platform specific SPI platform ops structure
Definition: stm32_spi.c:711
uint8_t * src
Definition: no_os_dma.h:73
void * extra
Definition: no_os_dma.h:120
const struct no_os_gpio_platform_ops stm32_gpio_ops
stm32 platform specific GPIO platform ops structure
Definition: stm32_gpio.c:389
int no_os_dma_xfer_abort(struct no_os_dma_desc *, struct no_os_dma_ch *)
Abort the ongoing and any other future transfers scheduled for a channel.
Definition: no_os_dma.c:384
uint32_t speed
Definition: stm32_gpio.h:48
void * extra
Definition: no_os_gpio.h:89
Header file of GPIO Interface.
@ MEM_TO_DEV
Definition: no_os_dma.h:51
uint32_t max_speed_hz
Definition: no_os_spi.h:198
uint32_t alternate
Definition: stm32_gpio.h:50
int32_t stm32_spi_dma_transfer_async(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len, void(*callback)(void *), void *ctx)
Configure and start a series of transfers using DMA. Don't Wait for the completion before returning.
Definition: stm32_spi.c:663
struct no_os_dma_ch * channels
Definition: no_os_dma.h:142
Header file of utility functions.
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:47
void * extra
Definition: no_os_spi.h:158
uint32_t input_clock
Definition: stm32_spi.h:80
stm32 platform specific gpio descriptor
Definition: stm32_gpio.h:57
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
struct no_os_gpio_desc * chip_select
Definition: stm32_spi.h:84
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
int32_t number
Definition: no_os_gpio.h:100
uint32_t length
Definition: no_os_dma.h:77
struct no_os_gpio_init_param csip
Definition: stm32_spi.h:92
uint32_t(* get_input_clock)(void)
Definition: stm32_spi.h:55
int32_t stm32_spi_transfer(struct no_os_spi_desc *desc, struct no_os_spi_msg *msgs, uint32_t len)
Write/read multiple messages to/from SPI.
Definition: stm32_spi.c:336
Error macro definition for ARM Compiler.
@ NO_OS_DMA_IRQ
Definition: no_os_irq.h:92
Platform independent function definitions and data types for the DMA API.
struct stm32_gpio_init_param csip_extra
Definition: stm32_spi.h:91
Implementation of stm32 pwm driver.
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
enum no_os_irq_peripheral periph
Definition: no_os_dma.h:97
Describes the state of the DMA controller.
Definition: no_os_dma.h:136