资源简介
这里是关于I2C通讯,以及写EEPROM的C语言程序,是底层的驱动例程
代码片段和文件信息
/**
******************************************************************************
* @file ADC1_ContinuousConversion\main.c
* @brief This file contains the main function for the ADC1 Continuous Conversion example.
* @author STMicroelectronics - MCD Application Team
* @version V1.0.1
* @date 09/22/2008
**************************************************************************
*
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE
* TIME. AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY
* DIRECT INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING
* FROM THE CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE
* CODING INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* © COPYRIGHT 2008 STMicroelectronics
* @image html logo.bmp
******************************************************************************
*/
/* Includes ------------------------------------------------------------------*/
#include “stm8s_lib.h“
#include “main.h“
/**
* @addtogroup ADC1_ContinuousConversion
* @{
*/
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Public functions ----------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
u16 Conversion_Value = 0;
/**
* @brief ADC1_ContinuousConversion Example main entry point.
* @par Parameters:
* None
* @retval void None
* @par Required preconditions:
* None
* @par Library functions called:
* - GPIO_Init()
* - ADC1_DeInit()
* - ADC1_Init()
* - ADC1_StartConversion()
* - ADC1_GetFlagStatus()
* - ADC1_GetConversionValue()
* - ADC1_ClearFlag()
* - ADC1_ITConfig()
* - enableInterrupts()
*/
void main(void)
{
/* Init GPIO for ADC1 */
GPIO_Init(GPIOE GPIO_PIN_6 GPIO_MODE_IN_FL_NO_IT);
/* Init GPIO for LED */
GPIO_Init(LEDS_PORT (LED1_PIN |LED2_PIN |LED3_PIN |LED4_PIN) GPIO_MODE_OUT_PP_LOW_FAST);
ADC1_DeInit();
enableInterrupts();
/* Init ADC1 peripheral */
ADC1_Init(ADC1_CONVERSIONMODE_CONTINUOUS ADC1_CHANNEL_9 ADC1_PRESSEL_FCPU_D2 ADC1_EXTTRIG_TIM DISABLE ADC1_ALIGN_RIGHT ADC1_SCHMITTTRIG_CHANNEL9 DISABLE);
/* Enable EOC interrupt */
ADC1_ITConfig(ADC1_IT_EOCIE ENABLE);
/*Start Conversion */
ADC1_StartConversion();
while (1)
{
/* The LEDs state are changed in the inte
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2009-03-10 17:38 STexamples--I2C\
目录 0 2009-03-10 17:38 STexamples--I2C\ADC1\
目录 0 2009-03-10 17:38 STexamples--I2C\ADC1\ADC1_ContinuousConversion\
文件 3736 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\main.c
文件 1484 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\main.h
文件 1580 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\readme.txt
文件 5668 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\stm8s_conf.h
文件 15227 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\stm8s_it.c
文件 3674 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\stm8s_it.h
文件 5658 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_ContinuousConversion\stm8_interrupt_vector.c
目录 0 2009-03-10 17:38 STexamples--I2C\ADC1\ADC1_TriggerConversion\
文件 4172 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\main.c
文件 1481 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\main.h
文件 1610 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\readme.txt
文件 5651 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\stm8s_conf.h
文件 15206 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\stm8s_it.c
文件 3668 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\stm8s_it.h
文件 3309 2008-09-25 10:21 STexamples--I2C\ADC1\ADC1_TriggerConversion\stm8_interrupt_vector.c
目录 0 2009-03-10 17:38 STexamples--I2C\ADC2\
目录 0 2009-03-10 17:38 STexamples--I2C\ADC2\ADC2_ContinuousConversion\
文件 3713 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\main.c
文件 1484 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\main.h
文件 1585 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\readme.txt
文件 5666 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\stm8s_conf.h
文件 15216 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\stm8s_it.c
文件 3674 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\stm8s_it.h
文件 5655 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_ContinuousConversion\stm8_interrupt_vector.c
目录 0 2009-03-10 17:38 STexamples--I2C\ADC2\ADC2_TriggerConversion\
文件 4157 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_TriggerConversion\main.c
文件 1481 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_TriggerConversion\main.h
文件 1617 2008-09-25 10:21 STexamples--I2C\ADC2\ADC2_TriggerConversion\readme.txt
............此处省略441个文件信息
- 上一篇:Koch曲线C语言
- 下一篇:基于MFC实现的FTP断点续传客户端
评论
共有 条评论