/ * @brief * Initialize all ADC module related hardware and register ADC device to kernel * * @details * * @note * ******************************************************************************/
| 802 | * |
| 803 | ******************************************************************************/ |
| 804 | void 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 | /***************************************************************************//** |
no test coverage detected