no-OS
altera_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef ALTERA_I2C_H_
34 #define ALTERA_I2C_H_
35 
36 /******************************************************************************/
37 /*************************** Types Declarations *******************************/
38 /******************************************************************************/
39 
44 enum i2c_type {
47 } i2c_type;
48 
56  enum i2c_type type;
58  uint32_t id;
60 
67  enum i2c_type type;
69  uint32_t id;
71 
75 extern const struct no_os_i2c_platform_ops altera_i2c_ops;
76 
77 /******************************************************************************/
78 /************************ Functions Declarations ******************************/
79 /******************************************************************************/
80 
81 /* Initialize the I2C communication peripheral. */
82 int32_t altera_i2c_init(struct no_os_i2c_desc **desc,
83  const struct no_os_i2c_init_param *param);
84 
85 /* Free the resources allocated by no_os_i2c_init(). */
86 int32_t altera_i2c_remove(struct no_os_i2c_desc *desc);
87 
88 /* I2C Write data */
89 int32_t altera_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data,
90  uint8_t bytes_number, uint8_t stop_bit);
91 
92 /* I2C Read data. */
93 int32_t altera_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data,
94  uint8_t bytes_number, uint8_t stop_bit);
95 
96 #endif /* ALTERA_I2C_H_ */
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:67
NIOS_II_I2C
@ NIOS_II_I2C
Definition: altera_i2c.h:46
altera_i2c_desc::type
enum i2c_type type
Definition: altera_i2c.h:67
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:105
altera_i2c_desc::id
uint32_t id
Definition: altera_i2c.h:69
altera_i2c_desc
struct altera_i2c_desc altera_i2c_desc
altera_i2c_init_param
struct altera_i2c_init_param altera_i2c_init_param
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:139
no_os_i2c_init_param::extra
void * extra
Definition: no_os_i2c.h:74
altera_i2c_ops
const struct no_os_i2c_platform_ops altera_i2c_ops
Altera platform specific I2C platform ops structure.
Definition: altera_i2c.c:50
no_os_error.h
Error codes definition.
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:67
altera_i2c_init_param::id
uint32_t id
Definition: altera_i2c.h:58
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:121
altera_i2c_init_param::type
enum i2c_type type
Definition: altera_i2c.h:56
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:123
altera_i2c.h
altera_i2c_desc
Altera platform specific I2C descriptor.
Definition: altera_i2c.h:65
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
no_os_i2c.h
Header file of I2C Interface.
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
i2c_type
i2c_type
Altera platform architecture types.
Definition: altera_i2c.h:44
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:86
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:139
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:105
altera_i2c_ops
const struct no_os_i2c_platform_ops altera_i2c_ops
Altera platform specific i2c platform ops structure.
Definition: altera_i2c.c:50
altera_i2c_init_param
Structure holding the initialization parameters for Altera platform specific I2C parameters.
Definition: altera_i2c.h:54
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:86