Page MenuHomec4science

magnetic_encoder.h
No OneTemporary

File Metadata

Created
Thu, Nov 28, 06:52

magnetic_encoder.h

#ifndef MAGNETIC_ENCODER_H_
#define MAGNETIC_ENCODER_H_
#include <gpio.h>
struct magnetic_encoder;
typedef struct magnetic_encoder magnetic_encoder;
void init_magnetic_encoders(gpio spi_cs);
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