Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
adc12.c
Package: str711USB.rar [view]
Upload User: yyyd609
Upload Date: 2022-07-18
Package Size: 183k
Code Size: 3k
Category:
ARM-PowerPC-ColdFire-MIPS
Development Platform:
C/C++
- /******************** (C) COPYRIGHT 2003 STMicroelectronics ********************
- * File Name : adc12.c
- * Author : MCD Application Team
- * Date First Issued : 07/31/2003
- * Description : Code sources of ADC12 functions
- ********************************************************************************
- * History:
- * 01/01/2004 : V1.2
- * 14/07/2004 : V1.3
- *******************************************************************************/
- #include "adc12.h"
- /*******************************************************************************
- * Function Name : ADC12_Init
- * Description : Initialize the ADC
- * Input : None.
- * Return : None.
- *******************************************************************************/
- void ADC12_Init(void)
- {
- //Initiate ADC12 registers to their reset values
- ADC12->CSR = 0x00;
- ADC12->CPR = 0x01;
- }
- /*******************************************************************************
- * Function Name : ADC12_PrescalerConfig
- * Description : Configure the prescaler
- * Input : None.
- * Return : None.
- *******************************************************************************/
- void ADC12_PrescalerConfig(u32 Adc12_clk)
- {
- //Update the Prescaler Register
- ADC12->CPR = (vu16) (RCCU_FrequencyValue(RCCU_PCLK)/(Adc12_clk*512*4));
- }
- /*******************************************************************************
- * Function Name : ADC12_ITConfig
- * Description : enable or disable the interrupt
- * Input : status=ENABLE=>enable interrupt
- * status=DISABLE=>disable interrupt
- * Return : None
- *******************************************************************************/
- void ADC12_ITConfig(FunctionalState NewState)
- {
- if (NewState == ENABLE)
- {
- // Test the conversion mode
- if (ADC12->CSR & 0x0040)
- {
- // Set interrupt bit equivalent to the channel selected
- switch (ADC12->CSR & 0x30)
- {
- case 0x00 : ADC12->CSR |= ADC12_IT0_Mask; break;
- case 0x10 : ADC12->CSR |= ADC12_IT1_Mask; break;
- case 0x20 : ADC12->CSR |= ADC12_IT2_Mask; break;
- case 0x30 : ADC12->CSR |= ADC12_IT3_Mask; break;
- }
- }
- else
- // Set all interrupt bits in case of round robin mode
- ADC12->CSR |= ADC12_IT_Mask;
- }
- else
- // Clear all interrupt bits
- ADC12->CSR &= ~ADC12_IT_Mask;
- }
- /*********************(c) 2003 STMicroelectronics********************* END OF FILE **/