no-OS
altera_spi.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef ALTERA_SPI_H_
34 #define ALTERA_SPI_H_
35 
36 #include "no_os_spi.h"
37 
38 /******************************************************************************/
39 /*************************** Types Declarations *******************************/
40 /******************************************************************************/
41 
46 enum spi_type {
49 };
50 
58  enum spi_type type;
60  uint32_t base_address;
61 };
62 
69  enum spi_type type;
71  uint32_t base_address;
72 };
73 
77 extern const struct no_os_spi_platform_ops altera_spi_ops;
78 
79 #endif /* ALTERA_SPI_H_ */
no_os_alloc.h
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:196
no_os_spi.h
Header file of SPI Interface.
altera_spi_desc
Altera platform specific SPI descriptor.
Definition: altera_spi.h:67
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:222
NIOS_II_SPI
@ NIOS_II_SPI
Definition: altera_spi.h:48
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
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
altera_spi_ops
const struct no_os_spi_platform_ops altera_spi_ops
Altera platform specific SPI platform ops structure.
Definition: altera_spi.c:158
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:142
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:146
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:200
no_os_error.h
Error codes definition.
altera_spi_init_param
Structure holding the initialization parameters for Altera platform specific SPI parameters.
Definition: altera_spi.h:56
altera_spi_desc::type
enum spi_type type
Definition: altera_spi.h:69
altera_spi_write_and_read
int32_t altera_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: altera_spi.c:112
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
altera_spi_ops
const struct no_os_spi_platform_ops altera_spi_ops
Altera specific SPI platform ops structure.
Definition: altera_spi.c:158
altera_spi_remove
int32_t altera_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: altera_spi.c:95
spi_type
spi_type
Altera platform architecture types.
Definition: altera_spi.h:46
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
no_os_malloc
void * no_os_malloc(size_t size)
Allocate memory and return a pointer to it.
Definition: chibios_alloc.c:43
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
altera_spi_init_param::base_address
uint32_t base_address
Definition: altera_spi.h:60
altera_spi.h
altera_spi_desc::base_address
uint32_t base_address
Definition: altera_spi.h:71
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
altera_spi_init_param::type
enum spi_type type
Definition: altera_spi.h:58
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:202
altera_spi_init
int32_t altera_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: altera_spi.c:58
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140