gtk2/linux blmc config tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

56 lines
1.3 KiB

#ifndef _I2C_H_
#define _I2C_H_
#include <stdint.h>
void i2c_enumerate_interfaces(void);
void i2c_close(int fd);
int i2c_open(const char *path);
void i2c_set_address(int fd, int address);
int i2c_isconnected(void);
void i2c_cmd_bootloader(int fd);
void i2c_cmd_application(int fd);
void i2c_cmd_getinfo(int fd, char *buf, int size);
void i2c_cmd_getsignature(int fd, unsigned char *buf, int size);
struct blmc_parameter {
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;
};
void i2c_cmd_getparameters(int fd, struct blmc_parameter *blmc);
void i2c_cmd_setparameters(int fd, struct blmc_parameter *blmc, int persistent);
int i2c_write_flash(int fd, char *data, int size, void (*progress_cb)(int pos, int size));
int i2c_read_flash(int fd, char *data, int size, void (*progress_cb)(int pos, int size));
int i2c_verify_flash(int fd, char *data, int size, void (*progress_cb)(int pos, int size));
void i2c_cmd_setpwm(int fd, int pwm);
struct blmc_status {
uint8_t pwm_real;
uint8_t pwm;
uint16_t rpm;
uint16_t current;
uint16_t voltage;
};
void i2c_cmd_getstatus(int fd, struct blmc_status *status);
#endif /* _I2C_H_ */