2 ******************************************************************************
3 * @file stm32l0xx_hal_comp.h
4 * @author MCD Application Team
6 * @date 06-February-2015
7 * @brief Header file of COMP HAL module.
8 ******************************************************************************
11 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
13 * Redistribution and use in source and binary forms, with or without modification,
14 * are permitted provided that the following conditions are met:
15 * 1. Redistributions of source code must retain the above copyright notice,
16 * this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright notice,
18 * this list of conditions and the following disclaimer in the documentation
19 * and/or other materials provided with the distribution.
20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 ******************************************************************************
38 /* Define to prevent recursive inclusion -------------------------------------*/
39 #ifndef __STM32L0xx_HAL_COMP_H
40 #define __STM32L0xx_HAL_COMP_H
46 /* Includes ------------------------------------------------------------------*/
47 #include "stm32l0xx_hal_def.h"
49 /** @addtogroup STM32L0xx_HAL_Driver
53 /** @defgroup COMP COMP
57 /* Exported types ------------------------------------------------------------*/
59 /** @defgroup COMP_Exported_Types COMP Exported Types
63 /** @defgroup COMP_Init COMP init configuration structure
67 * @brief COMP Init structure definition
73 uint32_t InvertingInput; /*!< Selects the inverting input of the comparator.
74 This parameter can be a value of @ref COMP_InvertingInput */
76 uint32_t NonInvertingInput; /*!< Selects the non inverting input of the comparator.
77 This parameter can be a value of @ref COMP_NonInvertingInput */
79 uint32_t LPTIMConnection; /*!< Selects if the COMP connection to the LPTIM is established or not.
80 This parameter can be a value of @ref COMP_LPTIMConnection */
82 uint32_t OutputPol; /*!< Selects the output polarity of the comparator.
83 This parameter can be a value of @ref COMP_OutputPolarity */
85 uint32_t Mode; /*!< Selects the operating comsumption mode of the comparator
86 to adjust the speed/consumption.
87 This parameter can be a value of @ref COMP_Mode */
89 uint32_t WindowMode; /*!< Selects the window mode of the comparator 2.
90 This parameter can be a value of @ref COMP_WindowMode */
92 uint32_t TriggerMode; /*!< Selects the trigger mode of the comparator (interrupt mode).
93 This parameter can be a value of @ref COMP_TriggerMode */
101 /** @defgroup COMP_state COMP state definition
105 * @brief HAL State structures definition
109 HAL_COMP_STATE_RESET = 0x00, /*!< COMP not yet initialized or disabled */
110 HAL_COMP_STATE_READY = 0x01, /*!< COMP initialized and ready for use */
111 HAL_COMP_STATE_READY_LOCKED = 0x11, /*!< COMP initialized but the configuration is locked */
112 HAL_COMP_STATE_BUSY = 0x02, /*!< COMP is running */
113 HAL_COMP_STATE_BUSY_LOCKED = 0x12 /*!< COMP is running and the configuration is locked */
114 }HAL_COMP_StateTypeDef;
119 /** @defgroup COMP_handle COMP handler
123 * @brief COMP Handle Structure definition
127 COMP_TypeDef *Instance; /*!< Register base address */
128 COMP_InitTypeDef Init; /*!< COMP required parameters */
129 HAL_LockTypeDef Lock; /*!< Locking object */
130 __IO HAL_COMP_StateTypeDef State; /*!< COMP communication state */
131 } COMP_HandleTypeDef;
140 /* Exported constants --------------------------------------------------------*/
141 /** @defgroup COMP_Exported_Constants COMP Exported Constants
145 /** @defgroup COMP_OutputPolarity COMP output polarity definitions
148 #define COMP_OUTPUTPOL_NONINVERTED ((uint32_t)0x00000000) /*!< COMP output on GPIO isn't inverted */
149 #define COMP_OUTPUTPOL_INVERTED COMP_CSR_COMPxPOLARITY /*!< COMP output on GPIO is inverted */
150 #define IS_COMP_OUTPUTPOL(POL) (((POL) == COMP_OUTPUTPOL_NONINVERTED) || \
151 ((POL) == COMP_OUTPUTPOL_INVERTED))
157 /** @defgroup COMP_InvertingInput COMP inverting input definitions
161 /* Inverting Input specific to COMP1 */
162 #define COMP_INVERTINGINPUT_VREFINT ((uint32_t)0x00000000) /*!< VREFINT connected to comparator1 inverting input */
163 #define COMP_INVERTINGINPUT_IO1 ((uint32_t)0x00000010) /*!< I/O1 connected to comparator inverting input (PA0) for COMP1 and (PA2) for COMP2*/
164 #define COMP_INVERTINGINPUT_DAC1 ((uint32_t)0x00000020) /*!< DAC1_OUT (PA4) connected to comparator inverting input */
165 #define COMP_INVERTINGINPUT_IO2 ((uint32_t)0x00000030) /*!< I/O2 (PA5) connected to comparator inverting input */
167 /* Inverting Input specific to COMP2 */
168 #define COMP_INVERTINGINPUT_1_4VREFINT ((uint32_t)0x00000040) /*!< 1/4 VREFINT connected to comparator inverting input */
169 #define COMP_INVERTINGINPUT_1_2VREFINT ((uint32_t)0x00000050) /*!< 1/2 VREFINT connected to comparator inverting input */
170 #define COMP_INVERTINGINPUT_3_4VREFINT ((uint32_t)0x00000060) /*!< 3/4 VREFINT connected to comparator inverting input */
171 #define COMP_INVERTINGINPUT_IO3 ((uint32_t)0x00000070) /*!< I/O3 (PB3) for COMP2 connected to comparator inverting input */
174 #define IS_COMP_INVERTINGINPUT(INPUT) (((INPUT) == COMP_INVERTINGINPUT_VREFINT) || \
175 ((INPUT) == COMP_INVERTINGINPUT_IO1) || \
176 ((INPUT) == COMP_INVERTINGINPUT_DAC1) || \
177 ((INPUT) == COMP_INVERTINGINPUT_IO2) || \
178 ((INPUT) == COMP_INVERTINGINPUT_1_4VREFINT) || \
179 ((INPUT) == COMP_INVERTINGINPUT_1_2VREFINT) || \
180 ((INPUT) == COMP_INVERTINGINPUT_3_4VREFINT) || \
181 ((INPUT) == COMP_INVERTINGINPUT_IO3))
188 /** @defgroup COMP_NonInvertingInput COMP non inverting input definitions
192 #define COMP_NONINVERTINGINPUT_IO1 ((uint32_t)0x00000000) /*!< I/O1 (PA3) connected to comparator non inverting input */
193 #define COMP_NONINVERTINGINPUT_IO2 ((uint32_t)0x00000100) /*!< I/O2 (PB4) connected to comparator non inverting input */
194 #define COMP_NONINVERTINGINPUT_IO3 ((uint32_t)0x00000200) /*!< I/O3 (PB5) connected to comparator non inverting input */
195 #define COMP_NONINVERTINGINPUT_IO4 ((uint32_t)0x00000300) /*!< I/O1 (PB6) connected to comparator non inverting input */
196 #define COMP_NONINVERTINGINPUT_IO5 ((uint32_t)0x00000400) /*!< I/O3 (PB7) connected to comparator non inverting input */
197 #define COMP_NONINVERTINGINPUT_IO6 ((uint32_t)0x00000500) /*!< I/O3 (PB7) connected to comparator non inverting input */
198 #define COMP_NONINVERTINGINPUT_IO7 ((uint32_t)0x00000600) /*!< I/O3 (PB7) connected to comparator non inverting input */
199 #define COMP_NONINVERTINGINPUT_IO8 ((uint32_t)0x00000700) /*!< I/O3 (PB7) connected to comparator non inverting input */
201 #define IS_COMP_NONINVERTINGINPUT(INPUT) (((INPUT) == COMP_NONINVERTINGINPUT_IO1) || \
202 ((INPUT) == COMP_NONINVERTINGINPUT_IO2) || \
203 ((INPUT) == COMP_NONINVERTINGINPUT_IO3) || \
204 ((INPUT) == COMP_NONINVERTINGINPUT_IO4) || \
205 ((INPUT) == COMP_NONINVERTINGINPUT_IO5) || \
206 ((INPUT) == COMP_NONINVERTINGINPUT_IO6) || \
207 ((INPUT) == COMP_NONINVERTINGINPUT_IO7) || \
208 ((INPUT) == COMP_NONINVERTINGINPUT_IO8))
214 /** @defgroup COMP_Mode COMP mode definition
217 /* Please refer to the electrical characteristics in the device datasheet for
218 the power consumption values */
219 #define COMP_MODE_HIGHSPEED COMP_CSR_COMP2SPEED /*!< High Speed */
220 #define COMP_MODE_LOWSPEED ((uint32_t)0x00000000) /*!< Low Speed */
222 #define IS_COMP_MODE(SPEED) (((SPEED) == COMP_MODE_HIGHSPEED) || \
223 ((SPEED) == COMP_MODE_LOWSPEED))
228 /** @defgroup COMP_WindowMode COMP window mode definition
231 #define COMP_WINDOWMODE_DISABLE ((uint32_t)0x00000000) /*!< Window mode disabled (Plus input of comparator 1 connected to PA1)*/
232 #define COMP_WINDOWMODE_ENABLE COMP_CSR_COMP1WM /*!< Window mode enabled: Plus input of comparator 1 shorted with Plus input of comparator 2 */
233 #define IS_COMP_WINDOWMODE(WINDOWMODE) (((WINDOWMODE) == COMP_WINDOWMODE_DISABLE) || \
234 ((WINDOWMODE) == COMP_WINDOWMODE_ENABLE))
236 #if defined (STM32L072xx) || defined (STM32L073xx) || defined (STM32L082xx) || defined (STM32L083xx)
237 #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) (((INSTANCE) == COMP1) ||\
238 ((INSTANCE) == COMP2))
240 #define IS_COMP_WINDOWMODE_INSTANCE(INSTANCE) ((INSTANCE) == COMP1)
246 /** @defgroup COMP_LPTIMConnection COMP Low power timer connection definition
249 #define COMP_LPTIMCONNECTION_DISABLED ((uint32_t)0x00000000) /*!< COMPx signal is gated */
250 #define COMP_LPTIMCONNECTION_ENABLED COMP_CSR_COMP1LPTIM1IN1 /*!< COMPx signal is connected to LPTIM */
251 #define IS_COMP_LPTIMCONNECTION(LPTIMCONNECTION) (((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_DISABLED) || \
252 ((LPTIMCONNECTION) == COMP_LPTIMCONNECTION_ENABLED))
258 /** @defgroup COMP_OutputLevel COMP output level definition
261 /* When output polarity is not inverted, comparator output is low when
262 the non-inverting input is at a lower voltage than the inverting input*/
263 #define COMP_OUTPUTLEVEL_LOW ((uint32_t)0x00000000)
264 /* When output polarity is not inverted, comparator output is high when
265 the non-inverting input is at a higher voltage than the inverting input */
266 #define COMP_OUTPUTLEVEL_HIGH COMP_CSR_COMPxOUTVALUE
271 /* CSR register Mask */
272 #define COMP_CSR_UPDATE_PARAMETERS_MASK ((uint32_t)0xC0008779)
274 #define COMP_LOCK_DISABLE ((uint32_t)0x00000000)
275 #define COMP_LOCK_ENABLE COMP_CSR_COMPxLOCK
277 #define COMP_STATE_BIT_LOCK ((uint32_t)0x10)
279 /** @defgroup COMP_TriggerMode COMP trigger mode definition
282 #define COMP_TRIGGERMODE_IT_RISING ((uint32_t)0x00000001) /*!< External Interrupt Mode with Rising edge trigger detection */
283 #define COMP_TRIGGERMODE_IT_FALLING ((uint32_t)0x00000002) /*!< External Interrupt Mode with Falling edge trigger detection */
284 #define COMP_TRIGGERMODE_IT_RISING_FALLING ((uint32_t)0x00000003) /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
285 #define IS_COMP_TRIGGERMODE(MODE) (((MODE) == COMP_TRIGGERMODE_IT_RISING) || \
286 ((MODE) == COMP_TRIGGERMODE_IT_FALLING) || \
287 ((MODE) == COMP_TRIGGERMODE_IT_RISING_FALLING))
292 /** @defgroup COMP_ExtiLineEvent COMP EXTI line definition
296 #define COMP_EXTI_LINE_COMP2 ((uint32_t)0x00400000) /*!< External interrupt line 22 Connected to COMP2 */
297 #define COMP_EXTI_LINE_COMP1 ((uint32_t)0x00200000) /*!< External interrupt line 21 Connected to COMP1 */
307 /* Exported macro ------------------------------------------------------------*/
308 /** @brief Reset COMP handle state
309 * @param __HANDLE__: COMP handle.
313 /** @defgroup COMP_Exported_Macro COMP Exported Macro
317 * @brief Reset the state machine associated to the handler
318 * @param __HANDLE__: COMP handle.
322 #define __HAL_COMP_RESET_HANDLE_STATE(__HANDLE__) ((__HANDLE__)->State = HAL_COMP_STATE_RESET)
325 * @brief Enables the specified comparator
326 * @param __HANDLE__: COMP handle.
329 #define __HAL_COMP_ENABLE(__HANDLE__) ((__HANDLE__)->Instance->CSR |= (COMP_CSR_COMPxEN))
332 * @brief Disables the specified comparator
333 * @param __HANDLE__: COMP handle.
336 #define __HAL_COMP_DISABLE(__HANDLE__) ((__HANDLE__)->Instance->CSR &= ~(COMP_CSR_COMPxEN))
339 * @brief Lock the specified comparator configuration
340 * @param __HANDLE__: COMP handle.
343 #define __HAL_COMP_LOCK(__HANDLE__) ((__HANDLE__)->Instance->CSR |= COMP_CSR_COMPxLOCK)
345 /** @brief Checks whether the specified COMP flag is set or not.
346 * @param __HANDLE__: COMP handle.
347 * @param __FLAG__: specifies the flag to check.
348 * This parameter can be one of the following values:
349 * @arg COMP_FLAG_LOCK: lock flag
350 * @retval The new state of __FLAG__ (TRUE or FALSE).
352 #define __HAL_COMP_GET_FLAG(__HANDLE__, __FLAG__) (((__HANDLE__)->Instance->CSR & (__FLAG__)) == (__FLAG__))
355 * @brief Enable the Exti Line rising edge trigger.
357 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
358 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE() SET_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
361 * @brief Disable the Exti Line rising edge trigger.
363 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP1)
364 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE() CLEAR_BIT(EXTI->RTSR, COMP_EXTI_LINE_COMP2)
367 * @brief Enable the Exti Line falling edge trigger.
370 #define __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
371 #define __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE() SET_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
374 * @brief Disable the Exti Line falling edge trigger.
376 #define __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP1)
377 #define __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE() CLEAR_BIT(EXTI->FTSR, COMP_EXTI_LINE_COMP2)
380 * @brief Enable the COMP1 EXTI line rising & falling edge trigger.
383 #define __HAL_COMP_COMP1_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
384 __HAL_COMP_COMP1_EXTI_ENABLE_RISING_EDGE(); \
385 __HAL_COMP_COMP1_EXTI_ENABLE_FALLING_EDGE(); \
389 * @brief Disable the COMP1 EXTI line rising & falling edge trigger.
392 #define __HAL_COMP_COMP1_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
393 __HAL_COMP_COMP1_EXTI_DISABLE_RISING_EDGE(); \
394 __HAL_COMP_COMP1_EXTI_DISABLE_FALLING_EDGE(); \
398 * @brief Enable the COMP2 EXTI line rising & falling edge trigger.
401 #define __HAL_COMP_COMP2_EXTI_ENABLE_RISING_FALLING_EDGE() do { \
402 __HAL_COMP_COMP2_EXTI_ENABLE_RISING_EDGE(); \
403 __HAL_COMP_COMP2_EXTI_ENABLE_FALLING_EDGE(); \
407 * @brief Disable the COMP2 EXTI line rising & falling edge trigger.
410 #define __HAL_COMP_COMP2_EXTI_DISABLE_RISING_FALLING_EDGE() do { \
411 __HAL_COMP_COMP2_EXTI_DISABLE_RISING_EDGE(); \
412 __HAL_COMP_COMP2_EXTI_DISABLE_FALLING_EDGE(); \
416 * @brief Get the specified EXTI line for a comparator instance
417 * @param __INSTANCE__: specifies the COMP instance.
418 * @retval value of @ref COMP_ExtiLineEvent
420 #define COMP_GET_EXTI_LINE(__INSTANCE__) (((__INSTANCE__) == COMP1) ? COMP_EXTI_LINE_COMP1 : \
421 COMP_EXTI_LINE_COMP2)
424 * @brief Enable the COMP Exti Line.
428 #define __HAL_COMP_COMP1_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
429 #define __HAL_COMP_COMP2_EXTI_ENABLE_IT() SET_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
432 * @brief Disable the COMP Exti Line.
436 #define __HAL_COMP_COMP1_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP1)
437 #define __HAL_COMP_COMP2_EXTI_DISABLE_IT() CLEAR_BIT(EXTI->IMR, COMP_EXTI_LINE_COMP2)
440 * @brief Generate a software interrupt on the COMP EXTI line.
443 #define __HAL_COMP_COMP1_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP1)
444 #define __HAL_COMP_COMP2_EXTI_GENERATE_SWIT() SET_BIT(EXTI->SWIER, COMP_EXTI_LINE_COMP2)
448 * @brief Enable the COMP EXTI Line in event mode
451 #define __HAL_COMP_COMP1_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
452 #define __HAL_COMP_COMP2_EXTI_ENABLE_EVENT() SET_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
455 * @brief Disable the COMP EXTI Line in event mode.
458 #define __HAL_COMP_COMP1_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP1)
459 #define __HAL_COMP_COMP2_EXTI_DISABLE_EVENT() CLEAR_BIT(EXTI->EMR, COMP_EXTI_LINE_COMP2)
461 * @brief Checks whether the specified EXTI line flag is set or not.
462 * @retval The state of __FLAG__ (SET or RESET).
465 #define __HAL_COMP_COMP1_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP1)
466 #define __HAL_COMP_COMP2_EXTI_GET_FLAG() READ_BIT(EXTI->PR, COMP_EXTI_LINE_COMP2)
469 * @brief Clear the COMP Exti flags.
472 #define __HAL_COMP_COMP1_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP1)
473 #define __HAL_COMP_COMP2_EXTI_CLEAR_FLAG() WRITE_REG(EXTI->PR, COMP_EXTI_LINE_COMP2)
480 /* Include COMP HAL Extended module */
481 #include "stm32l0xx_hal_comp_ex.h"
483 /* Exported functions --------------------------------------------------------*/
484 /** @defgroup COMP_Exported_Functions COMP Exported Functions
488 /** @defgroup COMP_Exported_Functions_Group1 Initialization/de-initialization functions
492 /* Initialization/de-initialization functions **********************************/
493 HAL_StatusTypeDef HAL_COMP_Init(COMP_HandleTypeDef *hcomp);
494 HAL_StatusTypeDef HAL_COMP_DeInit (COMP_HandleTypeDef *hcomp);
495 void HAL_COMP_MspInit(COMP_HandleTypeDef *hcomp);
496 void HAL_COMP_MspDeInit(COMP_HandleTypeDef *hcomp);
501 /** @defgroup COMP_Exported_Functions_Group2 I/O operation functions
504 /* I/O operation functions *****************************************************/
505 HAL_StatusTypeDef HAL_COMP_Start(COMP_HandleTypeDef *hcomp);
506 HAL_StatusTypeDef HAL_COMP_Stop(COMP_HandleTypeDef *hcomp);
507 HAL_StatusTypeDef HAL_COMP_Start_IT(COMP_HandleTypeDef *hcomp);
508 HAL_StatusTypeDef HAL_COMP_Stop_IT(COMP_HandleTypeDef *hcomp);
509 void HAL_COMP_IRQHandler(COMP_HandleTypeDef *hcomp);
514 /** @defgroup COMP_Exported_Functions_Group3 Peripheral Control functions
517 /* Peripheral Control functions ************************************************/
518 HAL_StatusTypeDef HAL_COMP_Lock(COMP_HandleTypeDef *hcomp);
519 uint32_t HAL_COMP_GetOutputLevel(COMP_HandleTypeDef *hcomp);
521 /* Callback in Interrupt mode */
522 void HAL_COMP_TriggerCallback(COMP_HandleTypeDef *hcomp);
527 /** @defgroup COMP_Exported_Functions_Group4 Peripheral State functions
530 /* Peripheral State functions **************************************************/
531 HAL_COMP_StateTypeDef HAL_COMP_GetState(COMP_HandleTypeDef *hcomp);
554 #endif /* __STM32L0xx_HAL_COMP_H */
556 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/