|
34 | 34 |
|
35 | 35 |
|
36 | 36 | void common_hal_analogio_analogout_construct(analogio_analogout_obj_t* self, const mcu_pin_obj_t *pin) { |
37 | | -// if (pin->pin != PIN_PA02) { |
38 | | -// mp_raise_ValueError("AnalogOut not supported on given pin"); |
39 | | -// return; |
40 | | -// } |
41 | | -// struct dac_config config_dac; |
42 | | -// dac_get_config_defaults(&config_dac); |
43 | | -// config_dac.reference = DAC_REFERENCE_AVCC; |
44 | | -// enum status_code status = dac_init(&self->dac_instance, DAC, &config_dac); |
45 | | -// if (status != STATUS_OK) { |
46 | | -// mp_raise_OSError(MP_EIO); |
47 | | -// return; |
48 | | -// } |
49 | | -// claim_pin(pin); |
50 | | -// |
51 | | -// struct dac_chan_config config_analogout_chan; |
52 | | -// dac_chan_get_config_defaults(&config_analogout_chan); |
53 | | -// dac_chan_set_config(&self->dac_instance, DAC_CHANNEL_0, &config_analogout_chan); |
54 | | -// dac_chan_enable(&self->dac_instance, DAC_CHANNEL_0); |
55 | | -// |
56 | | -// dac_enable(&self->dac_instance); |
| 37 | + mp_raise_RuntimeError("AnalogOut functionality not supported"); |
57 | 38 | } |
58 | 39 |
|
59 | 40 | bool common_hal_analogio_analogout_deinited(analogio_analogout_obj_t *self) { |
60 | | - return self->deinited; |
| 41 | + return true; |
61 | 42 | } |
62 | 43 |
|
63 | 44 | void common_hal_analogio_analogout_deinit(analogio_analogout_obj_t *self) { |
64 | | -// if (common_hal_analogio_analogout_deinited(self)) { |
65 | | -// return; |
66 | | -// } |
67 | | -// dac_disable(&self->dac_instance); |
68 | | -// dac_chan_disable(&self->dac_instance, DAC_CHANNEL_0); |
69 | | -// reset_pin(PIN_PA02); |
70 | | -// self->deinited = true; |
| 45 | + |
71 | 46 | } |
72 | 47 |
|
73 | 48 | void common_hal_analogio_analogout_set_value(analogio_analogout_obj_t *self, uint16_t value) { |
74 | | - // Input is 16 bit but we only support 10 bit so we shift the input. |
75 | | -// dac_chan_write(&self->dac_instance, DAC_CHANNEL_0, value >> 6); |
| 49 | + |
76 | 50 | } |
0 commit comments