mirror of https://github.com/ARMmbed/mbed-os.git
Merge pull request #332 from bcostm/master
[NUCLEO_L053R8] Fix issue with upper case file namepull/334/head
commit
22f1f3a38a
|
@ -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 ******************************/
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -61,7 +61,7 @@ struct analogin_s {
|
|||
|
||||
struct dac_s {
|
||||
DACName dac;
|
||||
PinName channel;
|
||||
PinName pin;
|
||||
};
|
||||
|
||||
struct serial_s {
|
||||
|
|
Loading…
Reference in New Issue