#include "FreeRTOS.h"
#include "semphr.h"
#include <stdint.h>
#include <stdbool.h>
Go to the source code of this file.
◆ i2c_bus_mapping_t
◆ i2c_chip_mapping_t
I2C Chips information regarding the bus and slave address. 
 
 
◆ i2c_mux_state_t
◆ i2c_get_mux_bus()
Read I2C bus mux state. 
- Parameters
 - 
  
    | bus_id | Target bus ID  | 
    | i2c_mux | Pointer to bus mux structure | 
  
   
- Returns
 - Bus current state 
 
 
 
◆ i2c_give()
      
        
          | void i2c_give  | 
          ( | 
          uint8_t |           i2c_interface | ) | 
           | 
        
      
 
Release the previously gained I2C bus. 
- Parameters
 - 
  
    | i2c_interface | Physical I2C bus ID  | 
  
   
 
 
◆ i2c_init()
Initialize peripheral I2C buses. 
This function initializes all buses listed on the i2c_mux table, configuring the controller hardware and creating a binary semaphore for each. 
 
 
◆ 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_id | Target bus ID  | 
    | i2c_mux | Pointer to bus mux structure  | 
    | new_state | New bus mux state | 
  
   
- Return values
 - 
  
    | true | Bus was successfuly changed to the desired mux setting  | 
    | false | Bus could not be changed to the desired mux setting  | 
  
   
 
 
◆ i2c_take_by_busid()
      
        
          | bool i2c_take_by_busid  | 
          ( | 
          uint8_t |           bus_id,  | 
        
        
           | 
           | 
          uint8_t * |           i2c_interface,  | 
        
        
           | 
           | 
          uint32_t |           timeout ) | 
        
      
 
Take control over an I2C bus given a bus id. 
- Parameters
 - 
  
    | [in] | bus_id | Bus ID to take control  | 
    | [out] | i2c_interface | Pointer to variable that will hold the I2C physical bus ID  | 
    | [in] | timeout | Limit time to perform this operation | 
  
   
- Return values
 - 
  
    | true | Bus was successfuly gained  | 
    | false | Could not gain bus  | 
  
   
 
 
◆ i2c_take_by_chipid()
      
        
          | bool i2c_take_by_chipid  | 
          ( | 
          uint8_t |           chip_id,  | 
        
        
           | 
           | 
          uint8_t * |           i2c_address,  | 
        
        
           | 
           | 
          uint8_t * |           i2c_interface,  | 
        
        
           | 
           | 
          TickType_t |           timeout ) | 
        
      
 
Take control over an I2C bus given a chip id. 
- Parameters
 - 
  
    | [in] | chip_id | Chip ID to communicate  | 
    | [out] | i2c_address | Pointer to variable that will hold the chip slave address  | 
    | [out] | i2c_interface | Pointer to variable that will hold the I2C physical bus ID  | 
    | [in] | timeout | Limit time to perform this operation | 
  
   
- Return values
 - 
  
    | true | Bus was successfuly gained  | 
    | false | Could not gain bus  |