samd/machine_dac: Add the machine.DAC class.

It suuports 1 channel @ 10 bit for SAMD21, 2 channels @ 12 bit for SAMD51.

Instantiation by:

    dac = machine.DAC(ch) # 0 or 1

Method write:

    dac.write(value)

The output voltage range is 0..Vdd.
This commit is contained in:
robert-hh
2022-06-07 20:37:44 +02:00
committed by Damien George
parent aa2d746ef4
commit f5da77b5ce
5 changed files with 167 additions and 0 deletions

View File

@@ -29,6 +29,7 @@
#include "py/obj.h"
extern const mp_obj_type_t machine_adc_type;
extern const mp_obj_type_t machine_dac_type;
extern const mp_obj_type_t machine_hw_i2c_type;
extern const mp_obj_type_t machine_led_type;
extern const mp_obj_type_t machine_pin_type;