Commit 229176e1 authored by 李俭双's avatar 李俭双

🐞 fix:代码评审问题:更改AD采集表格,重新生成代码

parent 5d5b9970
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "Analog_Signals.h" #include "Analog_Signals.h"
/* Private typedef ----------------------------------------------------------*/ /* Private typedef ----------------------------------------------------------*/
typedef struct typedef __attribute__((aligned(4))) struct
{ {
uint8_t u8Ch; uint8_t u8Ch;
uint8_t u8RefType; uint8_t u8RefType;
...@@ -26,7 +26,7 @@ typedef struct ...@@ -26,7 +26,7 @@ typedef struct
ADC_Circuit_Calc_Func pfProcFunc; ADC_Circuit_Calc_Func pfProcFunc;
}ADC_Ch_Cfg_st_t; }ADC_Ch_Cfg_st_t;
typedef enum ASigConvStat typedef __attribute__((aligned(4))) enum ASigConvStat
{ {
ADC_STAT_IDLE = 0, ADC_STAT_IDLE = 0,
ADC_STAT_INIT, ADC_STAT_INIT,
...@@ -36,7 +36,7 @@ typedef enum ASigConvStat ...@@ -36,7 +36,7 @@ typedef enum ASigConvStat
ADC_STAT_ERR, ADC_STAT_ERR,
}ADC_Stat_en_t; }ADC_Stat_en_t;
typedef struct typedef __attribute__((aligned(4))) struct
{ {
ADC_Stat_en_t enStatus; ADC_Stat_en_t enStatus;
uint8_t u8CurrentCh; uint8_t u8CurrentCh;
...@@ -44,7 +44,7 @@ typedef struct ...@@ -44,7 +44,7 @@ typedef struct
uint8_t u8Timer; uint8_t u8Timer;
}ADC_Ctrl_st_t; }ADC_Ctrl_st_t;
typedef struct typedef __attribute__((aligned(4))) struct
{ {
uint8_t u8Valid; uint8_t u8Valid;
uint8_t u8Rsvd; uint8_t u8Rsvd;
...@@ -72,20 +72,20 @@ ADC_Ctrl_st_t stADCCtrl; ...@@ -72,20 +72,20 @@ ADC_Ctrl_st_t stADCCtrl;
uint16_t u16ADCSample[ADC_CONV_CH_NUMBER]; uint16_t u16ADCSample[ADC_CONV_CH_NUMBER];
ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER]; ADC_Data_st_t stADCData[ADC_SIGNAL_CH_NUMBER];
const uint8_t u8ADCChList[ADC_CONV_CH_NUMBER] = const uint8_t __attribute__((aligned(4))) u8ADCChList[ADC_CONV_CH_NUMBER] =
{ {
2U, 3U, 7U, 5U, 2U, 3U, 7U, 5U,
}; };
const ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] = const __attribute__((aligned(4))) ADC_Ch_Cfg_st_t stADCChCfg[ADC_SIGNAL_CH_NUMBER] =
{ {
{ 0U, 0U, 0U, 0U, 700U, 1U, ADC_Voltage_Calc_Circuit102,}, { 0U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
{ 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,}, { 1U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit102,},
{ 2U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,}, { 2U, 0U, 0U, 0U, 0U, 1U, ADC_Voltage_Calc_Circuit101,},
{ 3U, 2U, 0U, 2U, 18U, 1U, ADC_Res_Calc_Circuit101,}, { 3U, 2U, 0U, 2U, 0U, 1U, ADC_Res_Calc_Circuit101,},
}; };
const ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] = const __attribute__((aligned(4))) ADC_Res_List_st_t stADCResList[ADC_SIGNAL_CH_NUMBER] =
{ {
{ 3300000U, 1000000U, 0U, 0U,}, { 3300000U, 1000000U, 0U, 0U,},
{ 3300000U, 1000000U, 0U, 0U,}, { 3300000U, 1000000U, 0U, 0U,},
...@@ -115,10 +115,10 @@ void Analog_Signal_Conv_Init(void) ...@@ -115,10 +115,10 @@ void Analog_Signal_Conv_Init(void)
} }
} }
RTE_ADC_Init(0,2); for (i = 0U; i < ADC_CONV_CH_NUMBER; i++)
RTE_ADC_Init(0,3); {
RTE_ADC_Init(0,5); RTE_ADC_Init(0, u8ADCChList[i]);
RTE_ADC_Init(0,7); }
for (i = 0U; i < ADC_SIGNAL_CH_NUMBER; i++) for (i = 0U; i < ADC_SIGNAL_CH_NUMBER; i++)
{ {
......
/**************************************************************************//**
* \file Analog_Signals.h
* \brief Analog signal processing
* \attention
*
* This file is automatically generated by analog signals configuration tool.
* Date : 2024/9/10 15:16:25
* Cfg Tool Ver : 1.1.0
* Engineer :
* (c) Heilongjiang TYW electronics co., LTD
*
******************************************************************************/
#ifndef ANALOG_SIGNALS_H__
#define ANALOG_SIGNALS_H__
/* Includes -----------------------------------------------------------------*/
#include "ADC.h"
#include "Analog_Circuits.h"
#include "RTE.h"
/* C binding of definitions if building with C++ compiler */
#ifdef __cplusplus
extern {
#endif
/*! @{ */
/* Exported types ------------------------------------------------------------*/
enum ADCChName
{
ADC_CH_KL30_VOLTAGE = 0,
ADC_CH_KL15_VOLTAGE,
ADC_CH_FUEL_VREF,
ADC_CH_FUEL1,
};
/* Exported macro ------------------------------------------------------------*/
#define ADC_TOTAL_CH_NUMBER (4U)
#define ADC_SIGNAL_CH_NUMBER (4U)
#define ADC_REF_VOLTAGE u16ADCRefVoltage
/* Exported variables --------------------------------------------------------*/
extern volatile uint16_t u16ADCRefVoltage;
extern const uint8_t u8ADCChList[];
/* Exported functions --------------------------------------------------------*/
extern void Analog_Signal_Conv_Init(void);
extern void Analog_Signal_Conv_Stop(void);
extern void Analog_Signal_Conv_Service(void);
extern uint16_t ADC_Read_Signal(uint8_t u8ADCCh);
extern uint8_t ADC_Read_Signal_Valid(uint8_t u8ADCCh);
extern uint16_t ADC_Conv_Single_Channel(uint8_t u8ADCCh);
/*! @} */
#ifdef __cplusplus
}
#endif
#endif /* ANALOG_SIGNALS_H__ */
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment