资源简介
ST ST SimpleMAC-1.0.3的zigbee mac协议程序
代码片段和文件信息
/** @file adc.c
* @brief ADC HAL functions
*
*
*/
#include PLATFORM_HEADER
#include “hal/error.h“
#include “hal/hal.h“
#include “hal/micro/adc.h“
#if (NUM_ADC_USERS > 8)
#error NUM_ADC_USERS must not be greater than 8 or int8u variables in adc.c must be changed
#endif
static int16u adcData; // conversion result written by DMA
static int8u adcPendingRequests; // bitmap of pending requests
volatile static int8u adcPendingConversion; // id of pending conversion
static int8u adcReadingValid; // bitmap of valid adcReadings
static int16u adcReadings[NUM_ADC_USERS];
static int16u adcConfig[NUM_ADC_USERS];
static boolean adcCalibrated;
static int16s Nvss;
static int16s Nvdd;
/* Modified the original ADC driver for enabling the ADC extended range mode required for
supporting the STLM20 temperature sensor.
NOTE:
The ADC extended range is inaccurate due to the high voltage mode bug of the general purpose ADC
(see STM32W108 errata). As consequence it is not reccomended to use this ADC driver for getting
the temperature values
*/
#ifdef ENABLE_ADC_EXTENDED_RANGE_BROKEN
static int16s Nvref;
static int16s Nvref2;
#endif /* ENABLE_ADC_EXTENDED_RANGE_BROKEN */
static int16u adcStaticConfig;
void halAdcSetClock(boolean slow)
{
if (slow) {
adcStaticConfig |= ADC_1MHZCLK_MASK;
} else {
adcStaticConfig &= ~ADC_1MHZCLK_MASK;
}
}
void halAdcSetRange(boolean high)
{
if (high) {
adcStaticConfig |= (ADC_HVSELP_MASK | ADC_HVSELN_MASK);
} else {
adcStaticConfig &= ~(ADC_HVSELP_MASK | ADC_HVSELN_MASK);
}
}
boolean halAdcGetClock(void)
{
/* Fix original function code */
return (adcStaticConfig & ADC_1MHZCLK_MASK) ? TRUE : FALSE;
}
boolean halAdcGetRange(void)
{
/* Fix original function code */
return (adcStaticConfig & ((ADC_HVSELP_MASK | ADC_HVSELN_MASK))) ? TRUE : FALSE;
}
// Define a channel field that combines ADC_MUXP and ADC_MUXN
#define ADC_CHAN (ADC_MUXP | ADC_MUXN)
#define ADC_CHAN_BIT ADC_MUXN_BIT
void halAdcIsr(void)
{
int8u i;
int8u conversion = adcPendingConversion; //fix ‘volatile‘ warning; costs no flash
// make sure data is ready and the desired conversion is valid
if ( (INT_ADCFLAG & INT_ADCULDFULL)
&& (conversion < NUM_ADC_USERS) ) {
adcReadings[conversion] = adcData;
adcReadingValid |= BIT(conversion); // mark the reading as valid
// setup the next conversion if any
if (adcPendingRequests) {
for (i = 0; i < NUM_ADC_USERS; i++) {
if (BIT(i) & adcPendingRequests) {
adcPendingConversion = i; // set pending conversion
adcPendingRequests ^= BIT(i); //clear request: conversion is starting
ADC_CFG = adcConfig[i];
break; //conversion started so we‘re done here (only one at a time)
}
}
} el
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19558 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\adc_8c.html
文件 48043 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\adc_8c_source.html
文件 2321 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\adc_8h.html
文件 17809 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\adc_8h_source.html
文件 5089 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\annotated.html
文件 2054 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\asm_8h.html
文件 7942 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\asm_8h_source.html
文件 705 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\bc_s.png
文件 41585 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\board_8c.html
文件 73270 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\board_8c_source.html
文件 29591 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\board_8h.html
文件 26557 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\board_8h_source.html
文件 5194 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\button_8c.html
文件 6887 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\button_8c_source.html
文件 8636 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\button_8h.html
文件 4454 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\button_8h_source.html
文件 5567 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\classes.html
文件 15096 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\clocks_8c.html
文件 49861 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\clocks_8c_source.html
文件 126 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\closed.png
文件 18181 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\cortexm3_2micro-common_8h.html
文件 13761 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\cortexm3_2micro-common_8h_source.html
文件 12013 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\doxygen.css
文件 3942 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\doxygen.png
文件 23256 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\error-def_8h.html
文件 39282 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\error-def_8h_source.html
文件 5703 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\error_8h.html
文件 4680 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\error_8h_source.html
文件 25777 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\fib-bootloader_8h.html
文件 9838 2011-05-25 18:03 ST SimpleMAC-1.0.3\STM32W108\docs\hal\html\fib-bootloader_8h_source.html
............此处省略679个文件信息
- 上一篇:rtlinux安装包
- 下一篇:非线性系统 Hassan+K.+Khalil
相关资源
- FastReport 5.6.2 For D7-10.2安装文件及安装
- 1stopt软件
- 安卓 usb hid通信demo
- MPU6050的zigbee协议栈
- Advanced Installer Architect 14.3 安装包+ 破
- TestStand工业自动化管理 源码
- Can网络诊断15765中文版-1-2-3-4
- STM32F407VET 基于DDS 用内置DAC实现实现多
- 使用STM32和CLRC663实现15693协议读写
- api-ms-win-crt-runtime-|1-1-0.dll和vc_redist.
- Streaming Systems - Tyler Akidau.pdf
- Introduction to Computing Systems From bits &
- STM32中文固件库+中文芯片手册(完全
- Visual Studio 2013 SDK
- 基于struts框架的电子商务网站
- Ubiqua 1.4破解版zigbee协议抓包工具
- Fantastical2.2 最新完美日历 mac 破解版本
- mnist_dataset 手写字体数据集
- OpenStack实战电子书
- Infragistics NetAdvantage for Windows Forms 20
- 基于STM32的温湿度报警程序
- STM32 WinUSB
- BH1750+内部RTC stm32毕设验证成功
- LUST 伺服调试软件
- Fundamental-Statistical-Inference-A-Computatio
- Practical Statistics for Data Scientist
- TCP/IP Illustrated Volume 1 2nd Edition真正的
- VisualAssistX-vs2010在win10系统中切换英文
- dicompyler软件,用于dicom图像查看和R
- Statistical Learning Theory - Vapnik - 1998 高
评论
共有 条评论