openMMC
Open Source Modular MMC for AMCs
Loading...
Searching...
No Matches
i2c_mapping.c File Reference
#include "i2c.h"
#include "i2c_mapping.h"
#include "port.h"
Include dependency graph for i2c_mapping.c:

Functions

bool i2c_set_mux_bus (uint8_t bus_id, i2c_mux_state_t *i2c_mux, int8_t new_state)
 Change I2C bus mux state.
 
uint8_t i2c_get_mux_bus (uint8_t bus_id, i2c_mux_state_t *i2c_mux)
 Read I2C bus mux state.
 

Variables

i2c_mux_state_t i2c_mux [I2C_MUX_CNT]
 
i2c_bus_mapping_t i2c_bus_map [I2C_BUS_CNT]
 
i2c_chip_mapping_t i2c_chip_map [I2C_CHIP_CNT]
 

Function Documentation

◆ i2c_get_mux_bus()

uint8_t i2c_get_mux_bus ( uint8_t bus_id,
i2c_mux_state_t * i2c_mux )

Read I2C bus mux state.

Parameters
bus_idTarget bus ID
i2c_muxPointer to bus mux structure
Returns
Bus current state

◆ i2c_set_mux_bus()

bool i2c_set_mux_bus ( uint8_t bus_id,
i2c_mux_state_t * i2c_mux,
int8_t new_state )

Change I2C bus mux state.

Parameters
bus_idTarget bus ID
i2c_muxPointer to bus mux structure
new_stateNew bus mux state
Return values
trueBus was successfuly changed to the desired mux setting
falseBus could not be changed to the desired mux setting

Variable Documentation

◆ i2c_bus_map

Initial value:
= {
[I2C_BUS_UNKNOWN_ID] = { I2C1, -1, 0 },
[I2C_BUS_TEMP_SENSORS_ID] = { I2C1, 0, 1 },
[I2C_BUS_RTCE_ID] = { I2C1, 1, 1 },
[I2C_BUS_PORT2_ID] = { I2C1, 2, 1 },
[I2C_BUS_POWER_ID] = { I2C1, 3, 1 },
[I2C_BUS_CLOCK_ID] = { I2C1, 4, 1 },
[I2C_BUS_RTM_ID] = { I2C1, 5, 1 },
[I2C_BUS_FMC2_ID] = { I2C1, 6, 1 },
[I2C_BUS_FMC1_ID] = { I2C1, 7, 1 },
[I2C_BUS_MUX_ID] = { I2C1, -1, 1 },
[I2C_BUS_MCP_ID] = { I2C2, -1, 1 }
}
@ I2C_BUS_CLOCK_ID
Definition i2c_mapping.h:29
@ I2C_BUS_RTM_ID
Definition i2c_mapping.h:28
@ I2C_BUS_FMC1_ID
Definition i2c_mapping.h:25
@ I2C_BUS_UNKNOWN_ID
Definition i2c_mapping.h:24
@ I2C_BUS_FMC2_ID
Definition i2c_mapping.h:26
@ I2C_BUS_PORT2_ID
Definition i2c_mapping.h:14
@ I2C_BUS_TEMP_SENSORS_ID
Definition i2c_mapping.h:12
@ I2C_BUS_MCP_ID
Definition i2c_mapping.h:21
@ I2C_BUS_POWER_ID
Definition i2c_mapping.h:15
@ I2C_BUS_RTCE_ID
Definition i2c_mapping.h:13
@ I2C_BUS_MUX_ID
Definition i2c_mapping.h:20

◆ i2c_chip_map

◆ i2c_mux

Initial value:
= {
{ I2C1, -1, 0 },
{ I2C2, -1, 0 }
}