WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
ADC

宏定义

#define ADC_LOCK_GET_ATTE   0xFFFFFFFF
 
#define HAL_ADC_SCAN_CH0_1_ADDR   0x4400D01C
 
#define HAL_ADC_SCAN_CH2_3_ADDR   0x4400D024
 
#define HAL_ADC_SCAN_CH0_ADDR   0x4400D01C
 
#define HAL_ADC_SCAN_CH1_ADDR   0x4400D020
 
#define HAL_ADC_SCAN_CH2_ADDR   0x4400D024
 
#define HAL_ADC_SCAN_CH3_ADDR   0x4400D028
 
#define HAL_ADC_SCAN_CH4_ADDR   0x4400D02C
 
#define HAL_ADC_SCAN_CH5_ADDR   0x4400D030
 
#define HAL_ADC_CH0_PIN   0
 
#define HAL_ADC_CH1_PIN   0
 
#define HAL_ADC_CH2_PIN   0
 
#define HAL_ADC_CH3_PIN   0
 
#define HAL_ADC_CH4_PIN   0
 
#define HAL_ADC_CH5_PIN   0
 
#define HAL_ADC_CH6_PIN   0
 
#define HAL_ADC_CH7_PIN   0
 
#define HAL_ADC_CH8_PIN   0
 

枚举

enum  adc_channel_t {
  ADC_CHANNEL_0 , ADC_CHANNEL_1 , ADC_CHANNEL_2 , ADC_CHANNEL_3 ,
  ADC_CHANNEL_4 , ADC_CHANNEL_5 , ADC_CHANNEL_MAX_NUM , ADC_CHANNEL_NONE = ADC_CHANNEL_MAX_NUM
}
 ADC channels definition. 更多...
 
enum  port_adc_scan_freq_t {
  HAL_ADC_SCAN_FREQ_2HZ , HAL_ADC_SCAN_FREQ_4HZ , HAL_ADC_SCAN_FREQ_8HZ , HAL_ADC_SCAN_FREQ_16HZ ,
  HAL_ADC_SCAN_FREQ_32HZ , HAL_ADC_SCAN_FREQ_64HZ , HAL_ADC_SCAN_FREQ_128HZ , HAL_ADC_SCAN_FREQ_256HZ ,
  HAL_ADC_SCAN_FREQ_MAX , HAL_ADC_SCAN_FREQ_NONE = HAL_ADC_SCAN_FREQ_MAX
}
 adc自动扫描频率,用于所有通道。 更多...
 

函数

uintptr_t adc_porting_base_addr_get (void)
 获取指定ADC的基地址。
 
uintptr_t cldo_addr_get (void)
 获取指定ADC复位寄存器的基地址。
 
void adc_port_register_hal_funcs (void)
 Register hal funcs objects into hal_adc module.
 
void adc_port_unregister_hal_funcs (void)
 Unregister hal funcs objects from hal_adc module.
 
void adc_port_init_clock (adc_clock_t clock)
 Set the divider number of the peripheral device clock.
 
void adc_port_clock_enable (bool on)
 Set the divider number of the peripheral device clock.
 
void adc_port_register_irq (void)
 Register the interrupt of adc.
 
void adc_port_unregister_irq (void)
 Unregister the interrupt of adc.
 
void adc_port_power_on (bool on)
 Power on or power off the peripheral device.
 
void adc_port_calibration (void)
 ADC calibratio.
 
void adc_port_pull_disable (adc_channel_t channel)
 ADC disadle channel pull.
 
void adc_port_set_scan_discard_and_average_num (adc_channel_t channel)
 ADC set scan discard number and average number.
 
uint32_t adc_irq_lock (void)
 Lock of the interrupt.
 
void adc_irq_unlock (uint32_t irq_sts)
 Unlock of the interrupt.
 
errcode_t adc_port_get_cali_param (uint8_t *data_s, uint8_t *data_b, uint8_t *data_k)
 
errcode_t adc_port_read (uint8_t channel, uint16_t *data)
 

详细描述

Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2022-2022. All rights reserved.

Description: Provides adc port
History:
2022-09-16, Create file.

宏定义说明

◆ ADC_LOCK_GET_ATTE

#define ADC_LOCK_GET_ATTE   0xFFFFFFFF

◆ HAL_ADC_CH0_PIN

#define HAL_ADC_CH0_PIN   0

◆ HAL_ADC_CH1_PIN

#define HAL_ADC_CH1_PIN   0

◆ HAL_ADC_CH2_PIN

#define HAL_ADC_CH2_PIN   0

◆ HAL_ADC_CH3_PIN

#define HAL_ADC_CH3_PIN   0

◆ HAL_ADC_CH4_PIN

#define HAL_ADC_CH4_PIN   0

◆ HAL_ADC_CH5_PIN

#define HAL_ADC_CH5_PIN   0

◆ HAL_ADC_CH6_PIN

#define HAL_ADC_CH6_PIN   0

◆ HAL_ADC_CH7_PIN

#define HAL_ADC_CH7_PIN   0

◆ HAL_ADC_CH8_PIN

#define HAL_ADC_CH8_PIN   0

◆ HAL_ADC_SCAN_CH0_1_ADDR

#define HAL_ADC_SCAN_CH0_1_ADDR   0x4400D01C

◆ HAL_ADC_SCAN_CH0_ADDR

#define HAL_ADC_SCAN_CH0_ADDR   0x4400D01C

◆ HAL_ADC_SCAN_CH1_ADDR

#define HAL_ADC_SCAN_CH1_ADDR   0x4400D020

◆ HAL_ADC_SCAN_CH2_3_ADDR

#define HAL_ADC_SCAN_CH2_3_ADDR   0x4400D024

◆ HAL_ADC_SCAN_CH2_ADDR

#define HAL_ADC_SCAN_CH2_ADDR   0x4400D024

◆ HAL_ADC_SCAN_CH3_ADDR

#define HAL_ADC_SCAN_CH3_ADDR   0x4400D028

◆ HAL_ADC_SCAN_CH4_ADDR

#define HAL_ADC_SCAN_CH4_ADDR   0x4400D02C

◆ HAL_ADC_SCAN_CH5_ADDR

#define HAL_ADC_SCAN_CH5_ADDR   0x4400D030

枚举类型说明

◆ adc_channel_t

ADC channels definition.

枚举值
ADC_CHANNEL_0 
ADC_CHANNEL_1 
ADC_CHANNEL_2 
ADC_CHANNEL_3 
ADC_CHANNEL_4 
ADC_CHANNEL_5 
ADC_CHANNEL_MAX_NUM 
ADC_CHANNEL_NONE 

◆ port_adc_scan_freq_t

adc自动扫描频率,用于所有通道。

枚举值
HAL_ADC_SCAN_FREQ_2HZ 
HAL_ADC_SCAN_FREQ_4HZ 
HAL_ADC_SCAN_FREQ_8HZ 
HAL_ADC_SCAN_FREQ_16HZ 
HAL_ADC_SCAN_FREQ_32HZ 
HAL_ADC_SCAN_FREQ_64HZ 
HAL_ADC_SCAN_FREQ_128HZ 
HAL_ADC_SCAN_FREQ_256HZ 
HAL_ADC_SCAN_FREQ_MAX 
HAL_ADC_SCAN_FREQ_NONE 

函数说明

◆ adc_irq_lock()

uint32_t adc_irq_lock ( void  )
inline

Lock of the interrupt.

返回
The irq status.

◆ adc_irq_unlock()

void adc_irq_unlock ( uint32_t  irq_sts)
inline

Unlock of the interrupt.

参数
[in]irq_stsThe irq status to restore.

◆ adc_port_calibration()

void adc_port_calibration ( void  )

ADC calibratio.

◆ adc_port_clock_enable()

void adc_port_clock_enable ( bool  on)

Set the divider number of the peripheral device clock.

参数
[in]onEnable or disable.

◆ adc_port_get_cali_param()

errcode_t adc_port_get_cali_param ( uint8_t *  data_s,
uint8_t *  data_b,
uint8_t *  data_k 
)

◆ adc_port_init_clock()

void adc_port_init_clock ( adc_clock_t  clock)

Set the divider number of the peripheral device clock.

参数
[in]clockThe clock which is used for adc sample, adc source clock is 2MHz.

◆ adc_port_power_on()

void adc_port_power_on ( bool  on)

Power on or power off the peripheral device.

参数
[in]onPower on or Power off.

◆ adc_port_pull_disable()

void adc_port_pull_disable ( adc_channel_t  channel)

ADC disadle channel pull.

参数
[in]channelThe adc channel.

◆ adc_port_read()

errcode_t adc_port_read ( uint8_t  channel,
uint16_t *  data 
)

◆ adc_port_register_hal_funcs()

void adc_port_register_hal_funcs ( void  )

Register hal funcs objects into hal_adc module.

◆ adc_port_register_irq()

void adc_port_register_irq ( void  )

Register the interrupt of adc.

◆ adc_port_set_scan_discard_and_average_num()

void adc_port_set_scan_discard_and_average_num ( adc_channel_t  channel)

ADC set scan discard number and average number.

参数
[in]channelThe adc channel.

◆ adc_port_unregister_hal_funcs()

void adc_port_unregister_hal_funcs ( void  )

Unregister hal funcs objects from hal_adc module.

◆ adc_port_unregister_irq()

void adc_port_unregister_irq ( void  )

Unregister the interrupt of adc.

◆ adc_porting_base_addr_get()

uintptr_t adc_porting_base_addr_get ( void  )

获取指定ADC的基地址。

◆ cldo_addr_get()

uintptr_t cldo_addr_get ( void  )

获取指定ADC复位寄存器的基地址。