Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
i2c_log.h
00001 /******************************************************************************* 00002 ################################################################################ 00003 # (C) STMicroelectronics 2014 00004 # 00005 # This program is free software; you can redistribute it and/or modify it under 00006 # the terms of the GNU General Public License version 2 and only version 2 as 00007 # published by the Free Software Foundation. 00008 # 00009 # This program is distributed in the hope that it will be useful, but WITHOUT 00010 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00011 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00012 # details. 00013 # 00014 # You should have received a copy of the GNU General Public License along with 00015 # this program; if not, write to the Free Software Foundation, Inc., 00016 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 # 00018 #------------------------------------------------------------------------------ 00019 # Imaging Division 00020 ################################################################################ 00021 ********************************************************************************/ 00022 00023 /*! 00024 *\file i2c_log.h 00025 *\brief I2C logging functionality. 00026 */ 00027 00028 #include "platform.h" 00029 00030 /*! 00031 * \brief Function to Start logging all I2C activities 00032 * 00033 * All I2C access activity will be logged once this function is called. 00034 * This function shall be called when debug level is set to I2C_LOG_LEVEL. 00035 * \retval none 00036 */ 00037 void i2c_log_start(); 00038 00039 /*! 00040 * \brief Function to Stop logging all I2C activities 00041 * 00042 * All I2C access activity will stop to be logged once this function is called. 00043 * This function shall be called when debug level is set to I2C_LOG_LEVEL. 00044 * \retval none 00045 */ 00046 void i2c_log_end(); 00047 00048 /*! 00049 *\brief Function to output an I2C read transaction for a single byte to log file. 00050 * 00051 *\param[in] value data value read. 00052 *\param[in] regOffset I2C register identifier. 00053 *\retval none 00054 */ 00055 void i2c_log_outputReadByteMsg(uint8_t value, uint32_t regOffset); 00056 00057 /*! 00058 *\brief Function to output an I2C read transaction for a single word to log file. 00059 * 00060 *\param[in] value data value read. 00061 *\param[in] regOffset I2C register identifier. 00062 *\retval none 00063 */ 00064 void i2c_log_outputReadWordMsg(uint16_t value, uint32_t regOffset); 00065 00066 /*! 00067 *\brief Function to output an I2C read transaction for a single int to log file. 00068 * 00069 *\param[in] value data value read. 00070 *\param[in] regOffset I2C register identifier. 00071 *\retval none 00072 */ 00073 void i2c_log_outputReadIntMsg(uint32_t value, uint32_t regOffset); 00074 00075 /*! 00076 *\brief Function to output an I2C read transaction for an array of bytes to log file. 00077 * 00078 *\param[in] data data values read. 00079 *\param[in] regOffset I2C register identifier. 00080 *\param[in] size size of the data buffer. 00081 *\retval none 00082 */ 00083 void i2c_log_outputReadMsg(uint8_t *data, uint32_t regOffset, int32_t size); 00084 00085 /*! 00086 *\brief Function to output an I2C write transaction for a single byte to log file. 00087 * 00088 *\param[in] data data value written. 00089 *\param[in] regOffset I2C register identifier. 00090 *\retval none 00091 */ 00092 void i2c_log_outputWriteByteMsg(uint8_t data, uint32_t regOffset); 00093 00094 /*! 00095 *\brief Function to output an I2C write transaction for a single byte to log file. 00096 * 00097 *\param[in] data data value written. 00098 *\param[in] regOffset I2C register identifier. 00099 *\retval none 00100 */ 00101 void i2c_log_outputWriteWordMsg(uint16_t data, uint32_t regOffset); 00102 00103 /*! 00104 *\brief Function to output an I2C write transaction for a single byte to log file. 00105 * 00106 *\param[in] data data value written. 00107 *\param[in] regOffset I2C register identifier. 00108 *\retval none 00109 */ 00110 void i2c_log_outputWriteintMsg(uint32_t data, uint32_t regOffset); 00111 00112 /*! 00113 *\brief Function to output an I2C write transaction for an array of bytes to log file. 00114 * 00115 *\param[in] value data values written. 00116 *\param[in] regOffset I2C register identifier. 00117 *\param[in] size size of the data buffer. 00118 *\retval none 00119 */ 00120 void i2c_log_outputWriteMsg(uint8_t *value, uint32_t regOffset, int32_t size); 00121 00122
Generated on Tue Jul 12 2022 22:19:50 by
1.7.2