no-OS
chibios_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef CHIBIOS_SPI_H_
34 #define CHIBIOS_SPI_H_
35 
36 #include <stdint.h>
37 #include "no_os_spi.h"
38 #include "hal.h"
39 
40 #if (HAL_USE_SPI==TRUE)
41 
48 /*
49  * TO DO: extend SPI for more than 8 byte transfers (?)
50  * 1/2 word configuration
51  */
52 
55  SPIDriver *hspi;
57  SPIConfig *spicfg;
58 };
59 
66  SPIDriver *hspi;
68  SPIConfig *spicfg;
69 };
70 
74 extern const struct no_os_spi_platform_ops chibios_spi_ops;
75 
76 #endif // HAL_USE_SPI==TRUE
77 
78 #endif // CHIBIOS_SPI_H_
chibios_spi_ops
const struct no_os_spi_platform_ops chibios_spi_ops
chibios platform specific SPI platform ops structure
Definition: chibios_spi.c:141
chibios_spi_init_param
Structure holding the initialization parameters for chibios platform specific SPI parameters.
Definition: chibios_spi.h:53
no_os_alloc.h
chibios_spi_desc
chibios platform specific SPI descriptor
Definition: chibios_spi.h:64
chibios_spi_desc::spicfg
SPIConfig * spicfg
Definition: chibios_spi.h:68
no_os_spi.h
Header file of SPI Interface.
chibios_spi_init_param::spicfg
SPIConfig * spicfg
Definition: chibios_spi.h:57
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:222
chibios_spi_remove
int32_t chibios_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: chibios_spi.c:96
no_os_calloc
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
chibios_spi_write_and_read
int32_t chibios_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: chibios_spi.c:118
chibios_spi_init
int32_t chibios_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: chibios_spi.c:48
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
chibios_spi.h
Header file for the chibios spi driver.
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
no_os_free
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
chibios_spi_desc::hspi
SPIDriver * hspi
Definition: chibios_spi.h:66
chibios_spi_ops
const struct no_os_spi_platform_ops chibios_spi_ops
chibios specific SPI platform ops structure
Definition: chibios_spi.c:141
chibios_spi_init_param::hspi
SPIDriver * hspi
Definition: chibios_spi.h:55
no_os_util.h
Header file of utility functions.
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:224
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:158
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:140