openbcm

Git mirror of https://github.com/Broadcom-Network-Switching-Software/OpenBCM
git clone git://git.finwo.net/mirror/broadcom/openbcm
Log | Files | Refs | README

utils_i2c_mem.h (1338B)


      1 /* 
      2  * This license is set out in https://raw.githubusercontent.com/Broadcom-Network-Switching-Software/OpenBCM/master/Legal/LICENSE file.
      3  * 
      4  * Copyright 2007-2020 Broadcom Inc. All rights reserved.
      5 */
      6 
      7 
      8 #ifndef __UTILS_I2C_MEM_H_INCLUDED__
      9 /* { */
     10 #define __UTILS_I2C_MEM_H_INCLUDED__
     11 
     12 #ifdef  __cplusplus
     13 extern "C" {
     14 #endif
     15 
     16 
     17 #define I2C_MEM_MAX_IC2_BUFF_SIZE  32
     18 
     19 
     20 #define I2C_MEM_ERR_BASE 6660
     21 
     22 #define I2C_MEM_ERR_01 (I2C_MEM_ERR_BASE + 1)
     23 #define I2C_MEM_ERR_02 (I2C_MEM_ERR_BASE + 2)
     24 #define I2C_MEM_ERR_03 (I2C_MEM_ERR_BASE + 3)
     25 #define I2C_MEM_ERR_04 (I2C_MEM_ERR_BASE + 4)
     26 #define I2C_MEM_ERR_05 (I2C_MEM_ERR_BASE + 5)
     27 #define I2C_MEM_ERR_06 (I2C_MEM_ERR_BASE + 6)
     28 #define I2C_MEM_ERR_07 (I2C_MEM_ERR_BASE + 7)
     29 #define I2C_MEM_ERR_08 (I2C_MEM_ERR_BASE + 8)
     30 #define I2C_MEM_ERR_09 (I2C_MEM_ERR_BASE + 9)
     31 #define I2C_MEM_ERR_10 (I2C_MEM_ERR_BASE + 10)
     32 
     33 /*
     34  * }
     35  */
     36 
     37 
     38 int
     39   utils_i2c_mem_read(
     40     unsigned char device_address,/*7 bits*/
     41     unsigned char i2c_data[I2C_MEM_MAX_IC2_BUFF_SIZE],
     42     unsigned short  i2c_data_len,
     43     unsigned int  silent
     44   );
     45 
     46 
     47 int
     48   utils_i2c_mem_write(
     49     unsigned char device_address,/*7 bits*/
     50     unsigned char i2c_data[I2C_MEM_MAX_IC2_BUFF_SIZE],
     51     unsigned short  i2c_data_len,
     52     unsigned int  silent
     53   );
     54 
     55 
     56 #ifdef  __cplusplus
     57 }
     58 #endif
     59 
     60 
     61 /* } __UTILS_I2C_MEM_H_INCLUDED__*/
     62 #endif
     63 
     64 
     65