refactor(adc): move channel count to adc LL

This commit is contained in:
morris
2026-08-25 12:30:52 +08:00
parent 5de7d85e4e
commit cd356d592d
40 changed files with 46 additions and 38 deletions
@@ -32,6 +32,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (10)
#define ADC_LL_CHANNEL_NUM(unit_id) (((unit_id) == ADC_UNIT_1) ? 8 : 10)
/*---------------------------------------------------------------
* oneshot
@@ -34,6 +34,7 @@ extern "C" {
#define ADC_LL_NEED_APB_PERIPH_CLAIM(ADC_UNIT) (1)
#define ADC_LL_MAX_CHANNEL_NUM (5)
#define ADC_LL_CHANNEL_NUM(unit_id) (5)
/*---------------------------------------------------------------
* oneshot
@@ -44,6 +44,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (5)
#define ADC_LL_CHANNEL_NUM(unit_id) (((unit_id) == ADC_UNIT_1) ? 5 : 1)
/*---------------------------------------------------------------
* oneshot
@@ -46,6 +46,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (6)
#define ADC_LL_CHANNEL_NUM(unit_id) (6)
/*---------------------------------------------------------------
* oneshot
@@ -46,6 +46,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (7)
#define ADC_LL_CHANNEL_NUM(unit_id) (7)
/*---------------------------------------------------------------
* oneshot
@@ -46,6 +46,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (4)
#define ADC_LL_CHANNEL_NUM(unit_id) (4)
/*---------------------------------------------------------------
* oneshot
@@ -45,6 +45,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (5)
#define ADC_LL_CHANNEL_NUM(unit_id) (5)
/*---------------------------------------------------------------
* oneshot
@@ -45,6 +45,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (5)
#define ADC_LL_CHANNEL_NUM(unit_id) (5)
/*---------------------------------------------------------------
* oneshot
@@ -45,6 +45,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (5)
#define ADC_LL_CHANNEL_NUM(unit_id) (5)
/*---------------------------------------------------------------
* oneshot
@@ -39,6 +39,7 @@ extern "C" {
// ESP32P4 ADC2 channel is 2-7, so we need to subtract 2 to get the correct channel
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 2
#define ADC_LL_MAX_CHANNEL_NUM (8)
#define ADC_LL_CHANNEL_NUM(unit_id) (((unit_id) == ADC_UNIT_1) ? 8 : 6)
#define ADC_LL_NEED_APB_PERIPH_CLAIM(ADC_UNIT) (((ADC_UNIT) == ADC_UNIT_1) ? 0 : 1)
@@ -42,6 +42,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (10)
#define ADC_LL_CHANNEL_NUM(unit_id) (10)
/*---------------------------------------------------------------
* oneshot
@@ -44,6 +44,7 @@ extern "C" {
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION 0
#define ADC_LL_MAX_CHANNEL_NUM (10)
#define ADC_LL_CHANNEL_NUM(unit_id) (10)
/*---------------------------------------------------------------
* oneshot
@@ -34,6 +34,7 @@ extern "C" {
#define ADC_LL_NEED_APB_PERIPH_CLAIM(ADC_UNIT) (1)
#define ADC_LL_UNIT2_CHANNEL_SUBSTRATION (0)
#define ADC_LL_MAX_CHANNEL_NUM (8)
#define ADC_LL_CHANNEL_NUM(unit_id) (8)
#define ADC_LL_DMA_USE_LP_AHB_GDMA 1