diff options
| author | robert-hh <robert@hammelrath.com> | 2022-06-07 20:37:44 +0200 |
|---|---|---|
| committer | Damien George <damien@micropython.org> | 2022-10-06 22:55:10 +1100 |
| commit | f5da77b5ce66a393984fe8f71627f93e95c39edc (patch) | |
| tree | 8273a6273ed5c3abac098efaac37a1179158e99c /ports/samd/modmachine.c | |
| parent | aa2d746ef4ef64cbf8093b22facabca2c495be1f (diff) | |
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.
Diffstat (limited to 'ports/samd/modmachine.c')
| -rw-r--r-- | ports/samd/modmachine.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ports/samd/modmachine.c b/ports/samd/modmachine.c index cabd6b9c5..f7ad47b3c 100644 --- a/ports/samd/modmachine.c +++ b/ports/samd/modmachine.c @@ -150,6 +150,7 @@ STATIC const mp_rom_map_elem_t machine_module_globals_table[] = { { MP_ROM_QSTR(MP_QSTR_unique_id), MP_ROM_PTR(&machine_unique_id_obj) }, { MP_ROM_QSTR(MP_QSTR_ADC), MP_ROM_PTR(&machine_adc_type) }, + { MP_ROM_QSTR(MP_QSTR_DAC), MP_ROM_PTR(&machine_dac_type) }, { MP_ROM_QSTR(MP_QSTR_LED), MP_ROM_PTR(&machine_led_type) }, { MP_ROM_QSTR(MP_QSTR_Pin), MP_ROM_PTR(&machine_pin_type) }, { MP_ROM_QSTR(MP_QSTR_PWM), MP_ROM_PTR(&machine_pwm_type) }, |
