Beispiel #1
0
static inline int dac_read(dac_t *obj) {
    if (obj->pin == PA_4) {
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1);
    } else if (obj->pin == PA_5) {
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_2);
    }
    return 0;	/* Just silented warning */
}
Beispiel #2
0
static inline int dac_read(dac_t *obj)
{
    if (obj->pin == PA_4) {
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1);
    } else { // PA_5
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_2);
    }
}
Beispiel #3
0
static inline int dac_read(dac_t *obj)
{
    if (obj->channel == 1) {
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1);
    }
    if (obj->channel == 2) {
        return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_2);
    }
    return 0;
}
Beispiel #4
0
static inline int dac_read(dac_t *obj) {
    return (int)HAL_DAC_GetValue(&DacHandle, DAC_CHANNEL_1);
}