I2C Interface

File: csp/interfaces/csp_if_i2c.h

Description: I2C interface.

Defines

CSP_IF_I2C_DEFAULT_NAME
[source]

Default name of I2C interface.

Typedefs

type csp_i2c_interface_data_t
[source]

Interface data (state information).

csp_i2c_driver_tx_t tx_func
[source]

Tx function

Interface Functions

int csp_i2c_add_interface(csp_iface_t *iface)
[source]

Add interface.

Parameters:
  • iface – CSP interface, initialized with name and inteface_data pointing to a valid #csp_i2c_interface_data_t.

Returns:

#CSP_ERR_NONE on success, otherwise an error code.

int csp_i2c_tx(csp_iface_t *iface, uint16_t via, csp_packet_t *packet, int from_me)
[source]

Send CSP packet over I2C (nexthop).

Returns:

#CSP_ERR_NONE on success, otherwise an error code.

void csp_i2c_rx(csp_iface_t *iface, csp_packet_t *frame, void *pxTaskWoken)
[source]

Process received I2C frame.

The received #csp_i2c_frame_t must actually be pointing to an #csp_packet_t.

Called from driver, when a frame has been received.

Parameters:
  • iface – incoming interface.

  • frame – received data, routed on as a #csp_packet_t.

  • pxTaskWoken – Valid reference if called from ISR, otherwise NULL!