ciaa-nxp/modpybadc.c
// read method : read an ADC channel value after a conversion
read method : read an ADC channel value after a conversion
read method : read an ADC channel value after a conversion
mp_obj_t pyb_adc_read(mp_obj_t self_in) {
    pyb_adc_obj_t *self = self_in;
    mp_hal_enableADCchannel(ADC_ID(self));
    mp_hal_startADCconversion();
    uint16_t val =  mp_hal_readADCchannel(ADC_ID(self));
    return MP_OBJ_NEW_SMALL_INT(val);
}
mp_obj_t pyb_adc_read ( mp_obj_t self_in ) { pyb_adc_obj_t * self = self_in ; mp_hal_enableADCchannel ( ADC_ID ( self ) ) ; mp_hal_startADCconversion ( ) ; uint16_t val = mp_hal_readADCchannel ( ADC_ID ( self ) ) ; return MP_OBJ_NEW_SMALL_INT ( val ) ; }
read method : read an ADC channel value after a conversion
read method : read an ADC channel value after a conversion