no-OS
i2c_extra.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef I2C_EXTRA_H_
40 #define I2C_EXTRA_H_
41 
42 /******************************************************************************/
43 /*************************** Types Declarations *******************************/
44 /******************************************************************************/
45 
50 enum i2c_type {
53 } i2c_type;
54 
62  enum i2c_type type;
64  uint32_t id;
66 
73  enum i2c_type type;
75  uint32_t id;
77 
81 extern const struct no_os_i2c_platform_ops altera_i2c_ops;
82 
83 /******************************************************************************/
84 /************************ Functions Declarations ******************************/
85 /******************************************************************************/
86 
87 /* Initialize the I2C communication peripheral. */
88 int32_t altera_i2c_init(struct no_os_i2c_desc **desc,
89  const struct no_os_i2c_init_param *param);
90 
91 /* Free the resources allocated by no_os_i2c_init(). */
92 int32_t altera_i2c_remove(struct no_os_i2c_desc *desc);
93 
94 /* I2C Write data */
95 int32_t altera_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data,
96  uint8_t bytes_number, uint8_t stop_bit);
97 
98 /* I2C Read data. */
99 int32_t altera_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data,
100  uint8_t bytes_number, uint8_t stop_bit);
101 
102 #endif /* I2C_EXTRA_H_ */
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
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
i2c_type
i2c_type
Altera platform architecture types.
Definition: i2c_extra.h:50
altera_i2c_desc::type
enum i2c_type type
Definition: i2c_extra.h:73
altera_i2c_desc::id
uint32_t id
Definition: i2c_extra.h:75
altera_i2c_desc
struct altera_i2c_desc altera_i2c_desc
altera_i2c_init_param::id
uint32_t id
Definition: i2c_extra.h:64
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
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_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:99
altera_i2c_init_param::type
enum i2c_type type
Definition: i2c_extra.h:62
altera_i2c_desc
Altera platform specific I2C descriptor.
Definition: i2c_extra.h:71
no_os_i2c_desc
Structure holding I2C descriptor.
Definition: no_os_i2c.h:81
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
NIOS_II_I2C
@ NIOS_II_I2C
Definition: i2c_extra.h:52
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_i2c_init_param
struct altera_i2c_init_param altera_i2c_init_param
altera_i2c_init_param
Structure holding the initialization parameters for Altera platform specific I2C parameters.
Definition: i2c_extra.h:60