no-OS
pico_i2c.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef _PICO_I2C_H_
34 #define _PICO_I2C_H_
35 
36 /******************************************************************************/
37 /***************************** Include Files **********************************/
38 /******************************************************************************/
39 
40 #include "no_os_i2c.h"
41 #include "hardware/i2c.h"
42 
43 /******************************************************************************/
44 /*************************** Types Declarations *******************************/
45 /******************************************************************************/
46 
51 struct pico_i2c_desc {
53  i2c_inst_t *i2c_instance;
54 };
55 
59 enum i2c_sda_gp {
60  /* I2C0 available configurations */
67  /* I2C1 available configurations */
74 };
75 
79 enum i2c_scl_gp {
80  /* I2C0 available configurations */
87  /* I2C1 available configurations */
94 };
95 
104 };
105 
109 extern const struct no_os_i2c_platform_ops pico_i2c_ops;
110 
111 #endif
i2c_scl_gp
i2c_scl_gp
Available GP config for I2C SCL.
Definition: pico_i2c.h:79
no_os_alloc.h
PICO_I2C_MAX_INSTANCES
#define PICO_I2C_MAX_INSTANCES
Definition: pico_i2c.c:47
I2C0_SCL_GP9
@ I2C0_SCL_GP9
Definition: pico_i2c.h:83
I2C0_SDA_GP12
@ I2C0_SDA_GP12
Definition: pico_i2c.h:64
I2C0_SCL_GP21
@ I2C0_SCL_GP21
Definition: pico_i2c.h:86
I2C0_SCL_GP1
@ I2C0_SCL_GP1
Definition: pico_i2c.h:81
I2C1_SCL_GP19
@ I2C1_SCL_GP19
Definition: pico_i2c.h:92
I2C0_SDA_GP16
@ I2C0_SDA_GP16
Definition: pico_i2c.h:65
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:230
I2C0_SCL_GP13
@ I2C0_SCL_GP13
Definition: pico_i2c.h:84
pico_i2c_desc::i2c_instance
i2c_inst_t * i2c_instance
Definition: pico_i2c.h:53
pico_i2c_init_param
Additional I2C config parameters.
Definition: pico_i2c.h:99
i2c_sda_gp
i2c_sda_gp
Available GP config for I2c SDA.
Definition: pico_i2c.h:59
I2C1_SDA_GP26
@ I2C1_SDA_GP26
Definition: pico_i2c.h:73
I2C0_SCL_GP5
@ I2C0_SCL_GP5
Definition: pico_i2c.h:82
no_os_i2c_desc::device_id
uint32_t device_id
Definition: no_os_i2c.h:105
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
I2C1_SDA_GP2
@ I2C1_SDA_GP2
Definition: pico_i2c.h:68
pico_i2c_desc
pico platform specific I2C descriptor
Definition: pico_i2c.h:51
I2C0_SDA_GP0
@ I2C0_SDA_GP0
Definition: pico_i2c.h:61
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:109
no_os_error.h
Error codes definition.
I2C0_SCL_GP17
@ I2C0_SCL_GP17
Definition: pico_i2c.h:85
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:91
no_os_i2c_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_i2c.h:107
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:121
I2C0_SDA_GP8
@ I2C0_SDA_GP8
Definition: pico_i2c.h:63
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:136
I2C1_SCL_GP27
@ I2C1_SCL_GP27
Definition: pico_i2c.h:93
pico_i2c_init_param::i2c_scl_pin
enum i2c_scl_gp i2c_scl_pin
Definition: pico_i2c.h:103
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
I2C1_SDA_GP6
@ I2C1_SDA_GP6
Definition: pico_i2c.h:69
no_os_i2c_desc
Structure holding I2C address descriptor.
Definition: no_os_i2c.h:101
I2C1_SCL_GP11
@ I2C1_SCL_GP11
Definition: pico_i2c.h:90
I2C1_SDA_GP10
@ I2C1_SDA_GP10
Definition: pico_i2c.h:70
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:76
I2C1_SCL_GP7
@ I2C1_SCL_GP7
Definition: pico_i2c.h:89
no_os_i2c.h
Header file of I2C Interface.
pico_i2c.h
Header file for the pico i2c driver.
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
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:198
pico_i2c_init_param::i2c_sda_pin
enum i2c_sda_gp i2c_sda_pin
Definition: pico_i2c.h:101
pico_i2c_ops
const struct no_os_i2c_platform_ops pico_i2c_ops
pico specific I2C platform ops structure
Definition: pico_i2c.c:230
I2C1_SCL_GP3
@ I2C1_SCL_GP3
Definition: pico_i2c.h:88
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:160
I2C0_SDA_GP4
@ I2C0_SDA_GP4
Definition: pico_i2c.h:62
no_os_util.h
Header file of utility functions.
no_os_i2c_desc::extra
void * extra
Definition: no_os_i2c.h:113
I2C1_SDA_GP14
@ I2C1_SDA_GP14
Definition: pico_i2c.h:71
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:72
I2C0_SDA_GP20
@ I2C0_SDA_GP20
Definition: pico_i2c.h:66