Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F77931069
hall.c
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Aug 17, 07:20
Size
695 B
Mime Type
text/x-c
Expires
Mon, Aug 19, 07:20 (2 d)
Engine
blob
Format
Raw Data
Handle
19948152
Attached To
R2671 HHRI-software
hall.c
View Options
#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, ADC_SCALE_10_V);
// TODO: the voltage to angle conversion is not implemented yet.
return voltage;
}
Event Timeline
Log In to Comment