diff --git a/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c index cff01c46c3..8fb284f965 100644 --- a/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F0/analogout_device.c @@ -74,6 +74,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c index 62004da99e..d58f2e422d 100644 --- a/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F1/analogout_device.c @@ -86,6 +86,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c index 62004da99e..d58f2e422d 100644 --- a/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F2/analogout_device.c @@ -86,6 +86,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c index 7ee22c2caa..67c2b94188 100644 --- a/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F3/analogout_device.c @@ -121,6 +121,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c index 9c74ed8703..f3cd5c6779 100644 --- a/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F4/analogout_device.c @@ -81,6 +81,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c b/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c index bfc27df17e..99425e9a7f 100644 --- a/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32F7/analogout_device.c @@ -86,6 +86,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c index 44f240df4d..bb71818cb2 100644 --- a/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32G0/analogout_device.c @@ -90,6 +90,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c index 46efa9a25f..f560829022 100644 --- a/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32G4/analogout_device.c @@ -109,6 +109,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c b/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c index e11c85170b..f152113022 100644 --- a/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32H7/analogout_device.c @@ -74,6 +74,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c index 1c24712cdc..a31b2b11ad 100644 --- a/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L0/analogout_device.c @@ -90,6 +90,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c index 125e5eff19..de737c46ae 100644 --- a/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L1/analogout_device.c @@ -81,6 +81,7 @@ void analogout_init(dac_t *obj, PinName pin) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_free(dac_t *obj) diff --git a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c index ab3fe57cfb..7953aa8063 100644 --- a/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L4/analogout_device.c @@ -97,6 +97,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); /* DAC cannot be used in deepsleep/STOP mode */ sleep_manager_lock_deep_sleep(); diff --git a/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c b/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c index f085620fce..f6d42fe06f 100644 --- a/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32L5/analogout_device.c @@ -94,6 +94,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c b/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c index 01635aec5a..4ef747858b 100644 --- a/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c +++ b/targets/TARGET_STM/TARGET_STM32WL/analogout_device.c @@ -80,6 +80,7 @@ static void _analogout_init_direct(dac_t *obj, const PinMap *pinmap) } analogout_write_u16(obj, 0); + HAL_DAC_Start(&obj->handle, obj->channel); } void analogout_init(dac_t *obj, PinName pin) diff --git a/targets/TARGET_STM/analogout_api.c b/targets/TARGET_STM/analogout_api.c index 4dac5ce527..c03241c796 100644 --- a/targets/TARGET_STM/analogout_api.c +++ b/targets/TARGET_STM/analogout_api.c @@ -41,7 +41,6 @@ static inline void dac_write(dac_t *obj, int value) { HAL_DAC_SetValue(&obj->handle, obj->channel, DAC_ALIGN_12B_R, (value & DAC_RANGE)); - HAL_DAC_Start(&obj->handle, obj->channel); } static inline int dac_read(dac_t *obj)