no-OS
gpio_extra.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef GPIO_EXTRA_H_
40 #define GPIO_EXTRA_H_
41 
42 #include "no_os_gpio.h"
43 
44 /******************************************************************************/
45 /*************************** Types Declarations *******************************/
46 /******************************************************************************/
47 
51 extern const struct no_os_gpio_platform_ops altera_gpio_ops;
52 
57 enum gpio_type {
60 };
61 
71  uint32_t device_id;
73  uint32_t base_address;
74 };
75 
84  uint32_t device_id;
86  uint32_t base_address;
87 };
88 
89 #endif /* GPIO_EXTRA_H_ */
altera_gpio_init_param::base_address
uint32_t base_address
Definition: gpio_extra.h:73
altera_i2c_init
int32_t altera_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: altera_i2c.c:73
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
altera_gpio_get_direction
int32_t altera_gpio_get_direction(struct no_os_gpio_desc *desc, uint8_t *direction)
Get the direction of the specified GPIO.
Definition: altera_gpio.c:162
NIOS_II_GPIO
@ NIOS_II_GPIO
Definition: gpio_extra.h:59
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:134
no_os_spi.h
Header file of SPI Interface.
altera_gpio_desc
Altera platform specific GPIO descriptor.
Definition: gpio_extra.h:80
altera_spi_desc
Altera platform specific SPI descriptor.
Definition: spi_extra.h:73
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:153
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:120
no_os_gpio_init_param::number
int32_t number
Definition: no_os_gpio.h:89
no_os_axi_io_read
int32_t no_os_axi_io_read(uint32_t base, uint32_t offset, uint32_t *data)
AXI IO Altera specific read function.
Definition: axi_io.c:59
no_os_axi_io.h
Header file of AXI IO.
no_os_i2c_init_param::extra
void * extra
Definition: no_os_i2c.h:74
altera_spi_ops
const struct no_os_spi_platform_ops altera_spi_ops
Altera platform specific SPI platform ops structure.
Definition: altera_spi.c:161
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:114
altera_gpio_init_param::device_id
uint32_t device_id
Definition: gpio_extra.h:71
no_os_spi_init_param::chip_select
uint8_t chip_select
Definition: no_os_spi.h:118
altera_i2c_ops
const struct no_os_i2c_platform_ops altera_i2c_ops
Altera platform specific I2C platform ops structure.
Definition: altera_i2c.c:56
no_os_spi_desc::chip_select
uint8_t chip_select
Definition: no_os_spi.h:138
gpio_type
gpio_type
Altera platform architecture types.
Definition: gpio_extra.h:57
no_os_error.h
Error codes definition.
altera_gpio_ops
const struct no_os_gpio_platform_ops altera_gpio_ops
Altera platform specific GPIO platform ops structure.
Definition: altera_gpio.c:258
altera_spi_init_param
Structure holding the initialization parameters for Altera platform specific SPI parameters.
Definition: spi_extra.h:62
altera_spi_desc::type
enum spi_type type
Definition: spi_extra.h:75
altera_gpio_get
int32_t altera_gpio_get(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Obtain the GPIO decriptor.
Definition: altera_gpio.c:61
altera_gpio_init_param::type
enum gpio_type type
Definition: gpio_extra.h:69
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:99
NO_OS_UNUSED_PARAM
#define NO_OS_UNUSED_PARAM(x)
Definition: no_os_util.h:115
altera_gpio_direction_input
int32_t altera_gpio_direction_input(struct no_os_gpio_desc *desc)
Enable the input direction of the specified GPIO.
Definition: altera_gpio.c:131
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:115
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:132
no_os_i2c_platform_ops::i2c_ops_init
int32_t(* i2c_ops_init)(struct no_os_i2c_desc **, const struct no_os_i2c_init_param *)
Definition: no_os_i2c.h:101
NIOS_II_SPI
@ NIOS_II_SPI
Definition: spi_extra.h:54
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:98
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:102
i2c_extra.h
no_os_i2c_desc
Structure holding I2C descriptor.
Definition: no_os_i2c.h:81
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:145
spi_extra.h
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_i2c.h
Header file of I2C Interface.
altera_gpio_init_param
Structure holding the initialization parameters for Altera platform specific GPIO parameters.
Definition: gpio_extra.h:67
altera_gpio_ops
const struct no_os_gpio_platform_ops altera_gpio_ops
Altera platform specific gpio platform ops structure.
Definition: altera_gpio.c:258
altera_gpio_remove
int32_t altera_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: altera_gpio.c:116
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
NULL
#define NULL
Definition: wrapper.h:64
altera_gpio_desc::device_id
uint32_t device_id
Definition: gpio_extra.h:84
altera_gpio_get_value
int32_t altera_gpio_get_value(struct no_os_gpio_desc *desc, uint8_t *value)
Get the value of the specified GPIO.
Definition: altera_gpio.c:225
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:160
altera_gpio_set_value
int32_t altera_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: altera_gpio.c:184
altera_spi_init_param::base_address
uint32_t base_address
Definition: spi_extra.h:66
no_os_axi_io_write
int32_t no_os_axi_io_write(uint32_t base, uint32_t offset, uint32_t data)
AXI IO Altera specific write function.
Definition: axi_io.c:73
no_os_gpio_platform_ops
Structure holding gpio function pointers that point to the platform specific function.
Definition: no_os_gpio.h:133
no_os_gpio_init_param::extra
void * extra
Definition: no_os_gpio.h:95
altera_gpio_direction_output
int32_t altera_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: altera_gpio.c:148
no_os_gpio.h
Header file of GPIO Interface.
altera_i2c_read
int32_t altera_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
Read data from a slave device.
Definition: altera_i2c.c:145
altera_spi_desc::base_address
uint32_t base_address
Definition: spi_extra.h:77
no_os_util.h
Implementation of utility functions.
no_os_gpio_platform_ops::gpio_ops_get
int32_t(* gpio_ops_get)(struct no_os_gpio_desc **, const struct no_os_gpio_init_param *)
Definition: no_os_gpio.h:135
altera_gpio_desc::type
enum gpio_type type
Definition: gpio_extra.h:82
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:155
altera_gpio_desc::base_address
uint32_t base_address
Definition: gpio_extra.h:86
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:125
altera_spi_init_param::type
enum spi_type type
Definition: spi_extra.h:64
no_os_spi_desc::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:140
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:61
no_os_gpio_desc::number
int32_t number
Definition: no_os_gpio.h:106
altera_i2c_write
int32_t altera_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
Write data to a slave device.
Definition: altera_i2c.c:111
altera_gpio_get_optional
int32_t altera_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: altera_gpio.c:100
altera_i2c_init_param
Structure holding the initialization parameters for Altera platform specific I2C parameters.
Definition: i2c_extra.h:60
gpio_extra.h
altera_i2c_remove
int32_t altera_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: altera_i2c.c:92
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:112