mbed library sources. Supersedes mbed-src.

Fork of mbed-dev by mbed official

Committer:
<>
Date:
Fri Oct 28 11:17:30 2016 +0100
Revision:
149:156823d33999
This updates the lib to the mbed lib v128

NOTE: This release includes a restructuring of the file and directory locations and thus some
include paths in your code may need updating accordingly.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
<> 149:156823d33999 1 /**************************************************************************//**
<> 149:156823d33999 2 * @file acmp.c
<> 149:156823d33999 3 * @version V3.00
<> 149:156823d33999 4 * $Revision: 4 $
<> 149:156823d33999 5 * $Date: 15/08/11 10:26a $
<> 149:156823d33999 6 * @brief M451 series Analog Comparator(ACMP) driver source file
<> 149:156823d33999 7 *
<> 149:156823d33999 8 * @note
<> 149:156823d33999 9 * Copyright (C) 2014~2015 Nuvoton Technology Corp. All rights reserved.
<> 149:156823d33999 10 *****************************************************************************/
<> 149:156823d33999 11
<> 149:156823d33999 12 #include "M451Series.h"
<> 149:156823d33999 13
<> 149:156823d33999 14 #ifdef __cplusplus
<> 149:156823d33999 15 extern "C"
<> 149:156823d33999 16 {
<> 149:156823d33999 17 #endif
<> 149:156823d33999 18
<> 149:156823d33999 19 /** @addtogroup Standard_Driver Standard Driver
<> 149:156823d33999 20 @{
<> 149:156823d33999 21 */
<> 149:156823d33999 22
<> 149:156823d33999 23 /** @addtogroup ACMP_Driver ACMP Driver
<> 149:156823d33999 24 @{
<> 149:156823d33999 25 */
<> 149:156823d33999 26
<> 149:156823d33999 27
<> 149:156823d33999 28 /** @addtogroup ACMP_EXPORTED_FUNCTIONS ACMP Exported Functions
<> 149:156823d33999 29 @{
<> 149:156823d33999 30 */
<> 149:156823d33999 31
<> 149:156823d33999 32
<> 149:156823d33999 33 /**
<> 149:156823d33999 34 * @brief Configure the specified ACMP module
<> 149:156823d33999 35 *
<> 149:156823d33999 36 * @param[in] Acmp The pointer of the specified ACMP module
<> 149:156823d33999 37 * @param[in] u32ChNum Comparator number.
<> 149:156823d33999 38 * @param[in] u32NegSrc Comparator negative input selection. Including:
<> 149:156823d33999 39 * - \ref ACMP_CTL_NEGSEL_PIN
<> 149:156823d33999 40 * - \ref ACMP_CTL_NEGSEL_CRV
<> 149:156823d33999 41 * - \ref ACMP_CTL_NEGSEL_VBG
<> 149:156823d33999 42 * - \ref ACMP_CTL_NEGSEL_DAC
<> 149:156823d33999 43 * @param[in] u32HysteresisEn The hysteresis function option. Including:
<> 149:156823d33999 44 * - \ref ACMP_CTL_HYSTERESIS_ENABLE
<> 149:156823d33999 45 * - \ref ACMP_CTL_HYSTERESIS_DISABLE
<> 149:156823d33999 46 *
<> 149:156823d33999 47 * @return None
<> 149:156823d33999 48 *
<> 149:156823d33999 49 * @details Configure hysteresis function, select the source of negative input and enable analog comparator.
<> 149:156823d33999 50 */
<> 149:156823d33999 51 void ACMP_Open(ACMP_T *Acmp, uint32_t u32ChNum, uint32_t u32NegSrc, uint32_t u32HysteresisEn)
<> 149:156823d33999 52 {
<> 149:156823d33999 53 Acmp->CTL[u32ChNum] = (Acmp->CTL[u32ChNum] & (~(ACMP_CTL_NEGSEL_Msk | ACMP_CTL_HYSEN_Msk))) | (u32NegSrc | u32HysteresisEn | ACMP_CTL_ACMPEN_Msk);
<> 149:156823d33999 54 }
<> 149:156823d33999 55
<> 149:156823d33999 56 /**
<> 149:156823d33999 57 * @brief Close analog comparator
<> 149:156823d33999 58 *
<> 149:156823d33999 59 * @param[in] Acmp The pointer of the specified ACMP module
<> 149:156823d33999 60 * @param[in] u32ChNum Comparator number.
<> 149:156823d33999 61 *
<> 149:156823d33999 62 * @return None
<> 149:156823d33999 63 *
<> 149:156823d33999 64 * @details This function will clear ACMPEN bit of ACMP_CTL register to disable analog comparator.
<> 149:156823d33999 65 */
<> 149:156823d33999 66 void ACMP_Close(ACMP_T *Acmp, uint32_t u32ChNum)
<> 149:156823d33999 67 {
<> 149:156823d33999 68 Acmp->CTL[u32ChNum] &= (~ACMP_CTL_ACMPEN_Msk);
<> 149:156823d33999 69 }
<> 149:156823d33999 70
<> 149:156823d33999 71
<> 149:156823d33999 72
<> 149:156823d33999 73 /*@}*/ /* end of group ACMP_EXPORTED_FUNCTIONS */
<> 149:156823d33999 74
<> 149:156823d33999 75 /*@}*/ /* end of group ACMP_Driver */
<> 149:156823d33999 76
<> 149:156823d33999 77 /*@}*/ /* end of group Standard_Driver */
<> 149:156823d33999 78
<> 149:156823d33999 79 #ifdef __cplusplus
<> 149:156823d33999 80 }
<> 149:156823d33999 81 #endif
<> 149:156823d33999 82
<> 149:156823d33999 83 /*** (C) COPYRIGHT 2014~2015 Nuvoton Technology Corp. ***/
<> 149:156823d33999 84