📄 ad_cnf.c
字号:
/*******************************************************************
* ADC *
* *
* by J.Schwedes 2009 *
********************************************************************/
#include <general.h>
#include <ad.h>
#include <os.h>
#ifdef AD_USE_AUTOSCAN
/*
__AD_FLASH const u8 ad_autoscan_channel[][2]
*/
/* channel table for channels which shall be converted in Autoscan mode
a channel can be configured more then one time. This enables the possibility to
sample a channel more times than others. E.G CH_AD0,CH_AD1,CH_AD0,CH_AD2.....
For each channel you also have to configure an INDEX to the AD_buffer !!
*/
const u8 __AD_ROM ad_autoscan_channel[][2]=
{
{
CH_AD0, AD_BUFF_IDX_0
}
,
{
CH_AD1, AD_BUFF_IDX_1
}
,
{
CH_AD2, AD_BUFF_IDX_2
}
,
{
CH_AD3, AD_BUFF_IDX_3
}
,
{
CH_AD4, AD_BUFF_IDX_4
}
,
{
CH_AD5, AD_BUFF_IDX_5
}
,
{
CH_AD6, AD_BUFF_IDX_6
}
,
{
CH_AD7, AD_BUFF_IDX_7
}
}
;
const u8 __AD_ROM ad_autoscan_size = sizeof(ad_autoscan_channel)/2;
/*
void AD_AutoScan_OS_1ms(void)
*/
/* Here you can define a timebase interrupt for the cyclic
call of Autoscan handler...., but
this example shows how to use the OS preemptive task service which is
called every 1ms. */
/* Make call "OS_ActDynPreempTask(AD_AutoScan_OS_1ms)"
AFTER "AD_Init()" in Init hook from OS in os_cnf.c */
void AD_AutoScan_OS_1ms(void)
{
AD_AutoScan();
(void) OS_ActDynPreempTask(AD_AutoScan_OS_1ms);
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -