STM8S/A Standard Peripherals Firmware Library
|
I2C/I2C_TwoBoards/I2C_DataExchange/Master/main.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file I2C/I2C_TwoBoards/I2C_DataExchange/Master/main.h 00004 * @author MCD Application Team 00005 * @version V2.0.1 00006 * @date 18-November-2011 00007 * @brief Main program header 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2> 00012 * 00013 * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); 00014 * You may not use this file except in compliance with the License. 00015 * You may obtain a copy of the License at: 00016 * 00017 * http://www.st.com/software_license_agreement_liberty_v2 00018 * 00019 * Unless required by applicable law or agreed to in writing, software 00020 * distributed under the License is distributed on an "AS IS" BASIS, 00021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00022 * See the License for the specific language governing permissions and 00023 * limitations under the License. 00024 * 00025 ****************************************************************************** 00026 */ 00027 00028 /* Define to prevent recursive inclusion -------------------------------------*/ 00029 #ifndef __MAIN_H 00030 #define __MAIN_H 00031 00032 /* definition of fast or default standard mode (bus speed up to 400 or 100 kHz) */ 00033 #define FAST_I2C_MODE 00034 00035 #ifdef FAST_I2C_MODE 00036 #define I2C_SPEED 300000 00037 #else 00038 #define I2C_SPEED 100000 00039 #endif 00040 00041 /* definition of 10-bit or default 7-bit slave address */ 00042 /* #define TEN_BITS_ADDRESS */ 00043 00044 #ifdef TEN_BITS_ADDRESS 00045 #define SLAVE_ADDRESS 0x330 00046 #else 00047 #define SLAVE_ADDRESS 0x30 00048 #endif 00049 00050 /* This define is used in master receiver */ 00051 /* Uncomment the line below if you want to use the safe procedure */ 00052 #define SAFE_PROCEDURE 00053 00054 00055 #define BUFFERSIZE 10 00056 00057 00058 typedef enum {FAILED = 0, PASSED = !FAILED} TestStatus; 00059 00060 00061 #endif /* __MAIN_H */ 00062 00063 00064 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/