MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / rt_hw_adc_init

Function rt_hw_adc_init

bsp/efm32/drv_adc.c:804–823  ·  view source on GitHub ↗

/ * @brief * Initialize all ADC module related hardware and register ADC device to kernel * * @details * * @note * ******************************************************************************/

Source from the content-addressed store, hash-verified

802 *
803 ******************************************************************************/
804void rt_hw_adc_init(void)
805{
806 SYSTEM_ChipRevision_TypeDef chipRev;
807 struct efm32_adc_device_t *adc;
808
809#ifdef RT_USING_ADC0
810 if ((adc = rt_hw_adc_unit_init(&adc0_device, 0)) != RT_NULL)
811 {
812 rt_hw_adc_register(&adc0_device, RT_ADC0_NAME, EFM32_NO_DATA, adc);
813 }
814#endif
815
816 /* ADC errata for rev B when using VDD as reference, need to multiply */
817 /* result by 2 */
818 SYSTEM_ChipRevisionGet(&chipRev);
819 if ((chipRev.major == 0x01) && (chipRev.minor == 0x01))
820 {
821 adcErrataShift = 1;
822 }
823}
824
825#endif
826/***************************************************************************//**

Callers 1

rt_hw_driver_initFunction · 0.70

Calls 3

rt_hw_adc_unit_initFunction · 0.85
SYSTEM_ChipRevisionGetFunction · 0.85
rt_hw_adc_registerFunction · 0.70

Tested by

no test coverage detected