no-OS
pico_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
39 #ifndef _PICO_I2C_H_
40 #define _PICO_I2C_H_
41 
42 /******************************************************************************/
43 /***************************** Include Files **********************************/
44 /******************************************************************************/
45 
46 #include "no_os_i2c.h"
47 #include "hardware/i2c.h"
48 
49 /******************************************************************************/
50 /*************************** Types Declarations *******************************/
51 /******************************************************************************/
52 
57 struct pico_i2c_desc {
59  i2c_inst_t *i2c_instance;
60 };
61 
65 enum i2c_sda_gp {
66  /* I2C0 available configurations */
73  /* I2C1 available configurations */
80 };
81 
85 enum i2c_scl_gp {
86  /* I2C0 available configurations */
93  /* I2C1 available configurations */
100 };
101 
110 };
111 
115 extern const struct no_os_i2c_platform_ops pico_i2c_ops;
116 
117 #endif
i2c_scl_gp
i2c_scl_gp
Available GP config for I2C SCL.
Definition: pico_i2c.h:85
PICO_I2C_MAX_INSTANCES
#define PICO_I2C_MAX_INSTANCES
Definition: pico_i2c.c:52
I2C0_SCL_GP9
@ I2C0_SCL_GP9
Definition: pico_i2c.h:89
I2C0_SDA_GP12
@ I2C0_SDA_GP12
Definition: pico_i2c.h:70
I2C0_SCL_GP21
@ I2C0_SCL_GP21
Definition: pico_i2c.h:92
I2C0_SCL_GP1
@ I2C0_SCL_GP1
Definition: pico_i2c.h:87
I2C1_SCL_GP19
@ I2C1_SCL_GP19
Definition: pico_i2c.h:98
I2C0_SDA_GP16
@ I2C0_SDA_GP16
Definition: pico_i2c.h:71
no_os_i2c_init_param::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:70
pico_i2c_ops
const struct no_os_i2c_platform_ops pico_i2c_ops
pico platform specific I2C platform ops structure
Definition: pico_i2c.c:235
I2C0_SCL_GP13
@ I2C0_SCL_GP13
Definition: pico_i2c.h:90
pico_i2c_desc::i2c_instance
i2c_inst_t * i2c_instance
Definition: pico_i2c.h:59
pico_i2c_init_param
Additional I2C config parameters.
Definition: pico_i2c.h:105
i2c_sda_gp
i2c_sda_gp
Available GP config for I2c SDA.
Definition: pico_i2c.h:65
I2C1_SDA_GP26
@ I2C1_SDA_GP26
Definition: pico_i2c.h:79
I2C0_SCL_GP5
@ I2C0_SCL_GP5
Definition: pico_i2c.h:88
no_os_i2c_desc::device_id
uint32_t device_id
Definition: no_os_i2c.h:83
I2C1_SDA_GP2
@ I2C1_SDA_GP2
Definition: pico_i2c.h:74
pico_i2c_desc
pico platform specific I2C descriptor
Definition: pico_i2c.h:57
I2C0_SDA_GP0
@ I2C0_SDA_GP0
Definition: pico_i2c.h:67
no_os_i2c_init_param::extra
void * extra
Definition: no_os_i2c.h:74
no_os_i2c_desc::slave_address
uint8_t slave_address
Definition: no_os_i2c.h:87
no_os_error.h
Error codes definition.
I2C0_SCL_GP17
@ I2C0_SCL_GP17
Definition: pico_i2c.h:91
no_os_i2c_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:68
I2C1_SCL_GP15
@ I2C1_SCL_GP15
Definition: pico_i2c.h:97
no_os_i2c_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:85
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:99
I2C0_SDA_GP8
@ I2C0_SDA_GP8
Definition: pico_i2c.h:69
pico_i2c_remove
int32_t pico_i2c_remove(struct no_os_i2c_desc *desc)
Free the resources allocated by no_os_i2c_init().
Definition: pico_i2c.c:141
I2C1_SCL_GP27
@ I2C1_SCL_GP27
Definition: pico_i2c.h:99
pico_i2c_init_param::i2c_scl_pin
enum i2c_scl_gp i2c_scl_pin
Definition: pico_i2c.h:109
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
I2C1_SDA_GP6
@ I2C1_SDA_GP6
Definition: pico_i2c.h:75
no_os_i2c_desc
Structure holding I2C descriptor.
Definition: no_os_i2c.h:81
I2C1_SCL_GP11
@ I2C1_SCL_GP11
Definition: pico_i2c.h:96
I2C1_SDA_GP10
@ I2C1_SDA_GP10
Definition: pico_i2c.h:76
pico_i2c_init
int32_t pico_i2c_init(struct no_os_i2c_desc **desc, const struct no_os_i2c_init_param *param)
Initialize the I2C communication peripheral.
Definition: pico_i2c.c:81
I2C1_SCL_GP7
@ I2C1_SCL_GP7
Definition: pico_i2c.h:95
no_os_i2c.h
Header file of I2C Interface.
pico_i2c.h
Header file for the pico i2c driver.
no_os_i2c_init_param
Structure holding the parameters for I2C initialization.
Definition: no_os_i2c.h:64
pico_i2c_read
int32_t pico_i2c_read(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C read transaction as master.
Definition: pico_i2c.c:203
pico_i2c_init_param::i2c_sda_pin
enum i2c_sda_gp i2c_sda_pin
Definition: pico_i2c.h:107
pico_i2c_ops
const struct no_os_i2c_platform_ops pico_i2c_ops
pico specific I2C platform ops structure
Definition: pico_i2c.c:235
I2C1_SCL_GP3
@ I2C1_SCL_GP3
Definition: pico_i2c.h:94
pico_i2c_write
int32_t pico_i2c_write(struct no_os_i2c_desc *desc, uint8_t *data, uint8_t bytes_number, uint8_t stop_bit)
I2C write transaction as master.
Definition: pico_i2c.c:165
I2C0_SDA_GP4
@ I2C0_SDA_GP4
Definition: pico_i2c.h:68
no_os_util.h
Header file of utility functions.
no_os_i2c_desc::extra
void * extra
Definition: no_os_i2c.h:91
I2C1_SDA_GP14
@ I2C1_SDA_GP14
Definition: pico_i2c.h:77
no_os_i2c_init_param::device_id
uint32_t device_id
Definition: no_os_i2c.h:66
I2C1_SDA_GP18
@ I2C1_SDA_GP18
Definition: pico_i2c.h:78
I2C0_SDA_GP20
@ I2C0_SDA_GP20
Definition: pico_i2c.h:72