STM32F0xx Standard Peripherals Firmware Library
|
STM32F0xx_StdPeriph_Examples/I2C/I2C_WakeUpFromStop/main.h
Go to the documentation of this file.
00001 /** 00002 ****************************************************************************** 00003 * @file I2C/I2C_WakeUpFromStop/main.h 00004 * @author MCD Application Team 00005 * @version V1.4.0 00006 * @date 24-July-2014 00007 * @brief Header for main.c module 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 /* Includes ------------------------------------------------------------------*/ 00033 #include "stm32f0xx.h" 00034 #include "stm32f0xx_i2c_cpal.h" 00035 #ifdef USE_STM320518_EVAL 00036 #include "stm320518_eval.h" 00037 #include "stm320518_eval_lcd.h" 00038 #else 00039 #include "stm32072b_eval.h" 00040 #include "stm32072b_eval_lcd.h" 00041 #endif /* USE_STM320518_EVAL */ 00042 00043 00044 /* Exported types ------------------------------------------------------------*/ 00045 typedef enum {FAILED = 1, PASSED = !FAILED} TestStatus; 00046 00047 /* Exported constants --------------------------------------------------------*/ 00048 00049 /* Uncomment the line below if you will use the I2C peripheral as a Master*/ 00050 #define I2C_MASTER 00051 /* Uncomment the line below if you will use the I2C peripheral as a Slave*/ 00052 //#define I2C_SLAVE 00053 00054 /* Configure I2C TIMING by defining the value of TIMINGR Register */ 00055 #define MASTER_I2C_TIMING 0x10420F13 00056 #define SLAVE_I2C_TIMING 0x10420F13 00057 00058 /* Define the used Devices */ 00059 #define MASTERSTRUCTURE I2C1_DevStructure 00060 #define SLAVESTRUCTURE I2C1_DevStructure 00061 00062 /* Configure the OA1 address of the slave device */ 00063 #define OWNADDRESS ((uint8_t)0xCD) 00064 00065 00066 #define BUFFSIZE (countof(BufferTX)-1) 00067 00068 #define MEASSAGE_EMPTY (uint8_t*)" " 00069 #define MESSAGE1 (uint8_t*)"---STM32 CPAL Lib---" 00070 #define MESSAGE2 (uint8_t*)"I2C WakeUp From Stop" 00071 #define MESSAGE3 (uint8_t*)"-------READY--------" 00072 #define MESSAGE4 (uint8_t*)" Press SEL to start " 00073 #define MESSAGE5 (uint8_t*)" Tansfer " 00074 #define MESSAGE6 (uint8_t*)" Transfer Complete " 00075 #define MESSAGE7 (uint8_t*)" Entering Stop Mode " 00076 #define MESSAGE8 (uint8_t*)" Device in Stop Mode" 00077 #define MESSAGE9 (uint8_t*)" WakeUp From Stop " 00078 #define MESSAGE10 (uint8_t*)" Slave Not yet Ready" 00079 #define MESSAGE11 (uint8_t*)" Error occurred " 00080 #define MESSAGE12 (uint8_t*)" Timeout occurred " 00081 00082 /* Exported macro ------------------------------------------------------------*/ 00083 #define countof(a) (sizeof(a) / sizeof(*(a))) 00084 00085 /* Exported functions ------------------------------------------------------- */ 00086 void TimingDelay_Decrement(void); 00087 void Delay(__IO uint32_t nTime); 00088 00089 #endif /* __MAIN_H */ 00090 00091 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/