Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F69235107
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
Sun, Jun 30, 21:11
Size
695 B
Mime Type
text/x-c
Expires
Tue, Jul 2, 21:11 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
18627822
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