Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
TianYing_ty100
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
TY
TianYing_ty100
Commits
7ef70581
Commit
7ef70581
authored
9 months ago
by
李俭双
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:更换AD采集驱动文件
parent
cb64ff16
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
RTE_ADC_INTERIM_VERSION.c
...vice/Cmsemicon/BAT32A239/RTE/AD/RTE_ADC_INTERIM_VERSION.c
+5
-3
RTE_ADC_INTERIM_VERSION.h
...vice/Cmsemicon/BAT32A239/RTE/AD/RTE_ADC_INTERIM_VERSION.h
+2
-0
No files found.
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/AD/RTE_ADC_INTERIM_VERSION.c
View file @
7ef70581
...
...
@@ -4,8 +4,9 @@
#include "cgc.h"
#include "gpio.h"
#include "isr.h"
#include "Analog\Analog_Signals.h"
uint8_t
u8NewChNum
[
4
]
=
{
2
,
3
,
7
,
5
};
// uint8_t
u8NewChNum[4] = {2, 3, 7, 5};
void
RTC_ADC_Interrupt
(
void
*
msg
)
{
...
...
@@ -17,6 +18,7 @@ void RTE_ADC_Init(const uint8_t u8ChList[], uint8_t u8ChNum)
{
GPIO_InitTypeDef
GPIO_InitStructure
=
{
0
};
ADC_InitTypeDef
ADC_InitStructure
=
{
0
};
if
(
u8ChNum
<=
7
)
{
...
...
@@ -133,13 +135,13 @@ void RTE_ADC_Get_Conversion_Result(uint16_t *pu16Data, uint8_t u8ChNum)
uint8_t
i
;
if
((
pu16Data
!=
0U
)
&&
(
u8ChNum
>
0U
)
&&
(
u8ChNum
<=
4U
))
if
((
pu16Data
!=
0U
)
&&
(
u8ChNum
>
0U
)
&&
(
u8ChNum
<=
ADC_TOTAL_CH_NUMBER
))
{
if
(
RTE_ADC_Get_Conversion_Status
()
==
0U
)
{
for
(
i
=
0U
;
i
<
u8ChNum
;
i
++
)
{
ADC_Converse
(
u8NewChNum
[
i
],
1
,
pu16Data
);
ADC_Converse
(
(
ADC_Channel_t
)
u8ADCChList
[
i
],
1
,
pu16Data
);
pu16Data
++
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Firmware/Source/Device/Cmsemicon/BAT32A239/RTE/AD/RTE_ADC_INTERIM_VERSION.h
View file @
7ef70581
...
...
@@ -4,6 +4,8 @@
#include <stdint.h>
extern
const
uint8_t
u8ADCChList
[];
#define ADC_RESOLUTION (4096U)
/* 12bit ADC */
extern
void
RTE_ADC_Init
(
const
uint8_t
u8ChList
[],
uint8_t
u8ChNum
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment