Page MenuHomec4science

hall.c
No OneTemporary

File Metadata

Created
Fri, May 24, 00:50
#include "hall.h"
AdcChannel hall_channel;
/**
* @brief Initialize the hall sensor driver.
* @param channel: the ADC channel the hall sensor is wired to (0 or 1).
*/
void hall_Init(AdcChannel channel)
{
hall_channel = channel;
}
/**
* @brief Return the measured paddle angle.
* @retval The paddle angle [deg].
* @warning this function is not implemented yet, and returns actually the raw
* voltage from the Hall sensor, instead of the ready-to-use angular position.
*/
float32_t hall_Get(void)
{
float32_t voltage = adc_GetChannelVoltage(hall_channel);
// TODO: the voltage to angle conversion is not implemented yet.
return voltage;
}

Event Timeline