diff --git a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_rcc.h b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_rcc.h index ca264cce70..8950223f60 100644 --- a/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_rcc.h +++ b/libraries/mbed/targets/cmsis/TARGET_STM/TARGET_NUCLEO_L053R8/stm32l0xx_hal_rcc.h @@ -1110,7 +1110,7 @@ typedef struct */ /* Include RCC HAL Extension module */ -#include "stm32L0xx_hal_rcc_ex.h" +#include "stm32l0xx_hal_rcc_ex.h" /* Exported functions --------------------------------------------------------*/ /* Initialization and de-initialization methods ******************************/ diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c b/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c index 02a3057320..1e81a42d51 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c @@ -58,7 +58,7 @@ void analogout_init(dac_t *obj, PinName pin) { pinmap_pinout(pin, PinMap_DAC); // Save the channel for future use - obj->channel = pin; + obj->pin = pin; // Enable DAC clock __DAC_CLK_ENABLE(); @@ -67,9 +67,7 @@ void analogout_init(dac_t *obj, PinName pin) { sConfig.DAC_Trigger = DAC_TRIGGER_NONE; sConfig.DAC_OutputBuffer = DAC_OUTPUTBUFFER_DISABLE; - //if (pin == PA_4) { HAL_DAC_ConfigChannel(&DacHandle, &sConfig, DAC_CHANNEL_1); - //} analogout_write_u16(obj, 0); } @@ -81,20 +79,16 @@ void analogout_free(dac_t *obj) { __DAC_CLK_DISABLE(); // Configure GPIO - pin_function(obj->channel, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)); + pin_function(obj->pin, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, 0)); } static inline void dac_write(dac_t *obj, uint16_t value) { - //if (obj->channel == PA_4) { HAL_DAC_SetValue(&DacHandle, DAC_CHANNEL_1, DAC_ALIGN_12B_R, value); HAL_DAC_Start(&DacHandle, DAC_CHANNEL_1); - //} } static inline int dac_read(dac_t *obj) { - //if (obj->channel == PA_4) { return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1); - //} } void analogout_write(dac_t *obj, float value) { diff --git a/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/objects.h b/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/objects.h index dde3f75641..b5065b6066 100644 --- a/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/objects.h +++ b/libraries/mbed/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/objects.h @@ -61,7 +61,7 @@ struct analogin_s { struct dac_s { DACName dac; - PinName channel; + PinName pin; }; struct serial_s {