no-OS
stm32_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef STM32_SPI_H_
40 #define STM32_SPI_H_
41 
42 #include <stdint.h>
43 #include "no_os_spi.h"
44 #include "stm32_hal.h"
45 
53  GPIO_TypeDef *chip_select_port;
55  uint32_t (*get_input_clock)(void);
56 };
57 
64  SPI_HandleTypeDef hspi;
66  uint32_t input_clock;
69 };
70 
74 extern const struct no_os_spi_platform_ops stm32_spi_ops;
75 
76 #endif // STM32_SPI_H_
stm32_spi_init_param
Structure holding the initialization parameters for stm32 platform specific SPI parameters.
Definition: stm32_spi.h:51
no_os_gpio_desc::extra
void * extra
Definition: no_os_gpio.h:112
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:85
no_os_gpio_init_param::pull
enum no_os_gpio_pull_up pull
Definition: no_os_gpio.h:91
stm32_gpio_init_param::port
GPIO_TypeDef * port
Definition: stm32_gpio.h:52
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:145
NO_OS_SPI_CPOL
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:54
stm32_spi_desc
stm32 platform specific SPI descriptor
Definition: stm32_spi.h:62
no_os_spi_init_param::bit_order
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:131
stm32_gpio_desc::port
GPIO_TypeDef * port
Definition: stm32_gpio.h:65
no_os_spi.h
Header file of SPI Interface.
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:166
stm32_gpio_init_param::mode
uint32_t mode
Definition: stm32_gpio.h:54
stm32_spi.h
Header file for the stm32 spi driver.
stm32_spi_write_and_read
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:251
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:129
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:123
no_os_gpio_init_param::number
int32_t number
Definition: no_os_gpio.h:89
stm32_gpio_init_param
Structure holding the initialization parameters for stm32 platform.
Definition: stm32_gpio.h:50
stm32_spi_desc::hspi
SPI_HandleTypeDef hspi
Definition: stm32_spi.h:64
NO_OS_PULL_NONE
@ NO_OS_PULL_NONE
Definition: no_os_gpio.h:72
no_os_gpio_init_param::platform_ops
const struct no_os_gpio_platform_ops * platform_ops
Definition: no_os_gpio.h:93
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:123
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:127
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:149
stm32_spi_init
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:160
stm32_spi_init_param::chip_select_port
GPIO_TypeDef * chip_select_port
Definition: stm32_spi.h:53
stm32_spi_ops
const struct no_os_spi_platform_ops stm32_spi_ops
stm32 specific SPI platform ops structure
Definition: stm32_spi.c:304
no_os_spi_desc::bit_order
enum no_os_spi_bit_order bit_order
Definition: no_os_spi.h:153
no_os_gpio_remove
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:95
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:143
stm32_spi_remove
int32_t stm32_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: stm32_spi.c:229
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:156
no_os_gpio_get
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:55
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:125
stm32_gpio.h
Header file for stm32 gpio specifics.
NO_OS_BIT
#define NO_OS_BIT(x)
Definition: no_os_util.h:51
NULL
#define NULL
Definition: wrapper.h:64
stm32_spi_ops
const struct no_os_spi_platform_ops stm32_spi_ops
stm32 platform specific SPI platform ops structure
Definition: stm32_spi.c:304
stm32_gpio_ops
const struct no_os_gpio_platform_ops stm32_gpio_ops
stm32 platform specific GPIO platform ops structure
Definition: stm32_gpio.c:346
stm32_gpio_init_param::speed
uint32_t speed
Definition: stm32_gpio.h:56
no_os_gpio_init_param::extra
void * extra
Definition: no_os_gpio.h:95
no_os_gpio.h
Header file of GPIO Interface.
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:147
no_os_util.h
Header file of utility functions.
NO_OS_SPI_CPHA
#define NO_OS_SPI_CPHA
Definition: no_os_spi.h:53
no_os_spi_platform_ops::init
int32_t(* init)(struct no_os_spi_desc **, const struct no_os_spi_init_param *)
Definition: no_os_spi.h:168
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:134
stm32_spi_desc::input_clock
uint32_t input_clock
Definition: stm32_spi.h:66
stm32_gpio_desc
stm32 platform specific gpio descriptor
Definition: stm32_gpio.h:63
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:151
stm32_spi_desc::chip_select
struct no_os_gpio_desc * chip_select
Definition: stm32_spi.h:68
no_os_gpio_direction_output
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:124
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:106
stm32_hal.h
stm32_spi_init_param::get_input_clock
uint32_t(* get_input_clock)(void)
Definition: stm32_spi.h:55
errno.h
Error macro definition for ARM Compiler.
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:121