Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93747449
magnetic_encoder.h
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, Dec 1, 04:11
Size
1 KB
Mime Type
text/x-c
Expires
Tue, Dec 3, 04:11 (2 d)
Engine
blob
Format
Raw Data
Handle
22697811
Attached To
R6619 Oncilla Motordriver Firmware
magnetic_encoder.h
View Options
#ifndef MAGNETIC_ENCODER_H_
#define MAGNETIC_ENCODER_H_
#include <sbcp-uc/gpio.h>
struct
magnetic_encoder
;
typedef
struct
magnetic_encoder
magnetic_encoder
;
void
init_magnetic_encoders
(
gpio
spi_cs
);
/**
* Swaps position of Q2 and Q3 in hardware flow,
* if swapped is not zero. Otherwise keep their position.
*/
void
magnetic_encoder_swap_2_and_3
(
int
swapped
);
void
magnetic_encoders_process
();
void
magnetic_encoders_start_reading
();
void
me_load_persistent_sbcp_settings
();
enum
me_error_flags
{
ME_F_OK
=
0
,
ME_F_LINEARITY_READ_ALARM
=
1
<<
0
,
ME_F_CORDIC_OVERFLOW
=
1
<<
1
,
ME_F_ONBOARD_PROCESSING_UNFINISHED
=
1
<<
2
,
ME_F_MAGNETIC_AMPLITUDE_ERROR
=
1
<<
3
};
typedef
enum
me_error_flags
me_error_flags
;
void
me_set_gear_ratio
(
magnetic_encoder
*
e
,
int
mult
,
int
div
);
int
me_get_gear_mult
(
magnetic_encoder
*
e
);
int
me_get_gear_div
(
magnetic_encoder
*
e
);
int
me_get_value
(
magnetic_encoder
*
e
);
me_error_flags
me_get_error
(
magnetic_encoder
*
e
);
extern
magnetic_encoder
*
me1
,
*
me2
,
*
me3
;
#endif
//MAGNETIC_ENCODER_H_
Event Timeline
Log In to Comment