Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: SANFAN_read_analog_value nucleo-wdg Nucleo_sleep_copy
Fork of mbed-src by
Diff: targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c
- Revision:
- 217:d0ccc61c1fd4
- Parent:
- 201:fa203361dc70
- Child:
- 227:7bd0639b8911
diff -r 577900467c9e -r d0ccc61c1fd4 targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c --- a/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c Tue May 27 10:00:08 2014 +0100 +++ b/targets/hal/TARGET_STM/TARGET_NUCLEO_L053R8/analogout_api.c Tue May 27 13:00:07 2014 +0100 @@ -58,7 +58,7 @@ 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 @@ 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 @@ __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) {