blmc/eeprom.h

42 lines
673 B
C

#ifndef _EEPROM_PARAMETERS_H_
#define _EEPROM_PARAMETERS_H_
struct ee_param {
uint16_t spinup_ticks;
uint8_t spinup_tick;
uint8_t spinup_step;
uint8_t spinup_wait;
uint8_t spinup_pwm;
uint8_t pwm_min;
uint8_t pwm_max;
uint16_t current_limit;
uint16_t current_max;
uint16_t voltage_min;
uint16_t crc16;
};
#define DEFAULT_PARAMETERS { \
.spinup_ticks = 2000, \
.spinup_tick = 24, \
.spinup_step = 4, \
.spinup_wait = 10, \
.spinup_pwm = 25, \
.pwm_min = 0x08, \
.pwm_max = 0xff, \
.current_limit = 120, \
.current_max = 0x3ff, \
.voltage_min = 0x000, \
.crc16 = 0xDB76, \
};
uint8_t read_parameters(void);
void write_parameters(void);
#endif