31 #define MD25_REG_SPEED1 0x00
32 #define MD25_REG_SPEED2 0x01
33 #define MD25_REG_ENCODER1 0x02
34 #define MD25_REG_ENCODER2 0x06
35 #define MD25_REG_BAT 0x0A
36 #define MD25_REG_CURRENT1 0x0B
37 #define MD25_REG_CURRENT2 0x0C
38 #define MD25_REG_SOFT_REV 0x0D
39 #define MD25_REG_ACCEL_RATE 0x0E
40 #define MD25_REG_MODE 0x0F
41 #define MD25_REG_COMMAND 0x10
43 #define MD25_CMD_RESET_ENCODERS 0x20
44 #define MD25_CMD_NO_SPEED_REGUL 0x30
45 #define MD25_CMD_SPEED_REGUL 0x31
46 #define MD25_CMD_NO_MOTOR_TIMEOUT 0x32
47 #define MD25_CMD_MOTOR_TIMEOUT 0x33
56 #ifndef ACTUATORS_MD25_MODE
57 #define ACTUATORS_MD25_MODE MD25_MODE0
61 #ifndef ACTUATORS_MD25_ACCEL_RATE
62 #define ACTUATORS_MD25_ACCEL_RATE 5
66 #ifndef ACTUATORS_MD25_I2C_ADDR
67 #define ACTUATORS_MD25_I2C_ADDR 0xB0
118 #define Int32FromBuf(_buf,_idx) ((int32_t)(((uint32_t)_buf[_idx]<<24) | ((uint32_t)_buf[_idx+1]<<16) | ((uint32_t)_buf[_idx+2]<<8) | _buf[_idx+3]))
#define MD25_REG_ACCEL_RATE
void actuators_md25_init(void)
#define ACTUATORS_MD25_ACCEL_RATE
#define ACTUATORS_MD25_MODE
#define MD25_REG_ENCODER1
#define ACTUATORS_MD25_I2C_ADDR
#define Int32FromBuf(_buf, _idx)
void actuators_md25_periodic(void)
void actuators_md25_set(void)
struct ActuatorsMD25 actuators_md25
void actuators_md25_event(void)
uint8_t bat
batterie voltage (in decivolt)
struct i2c_transaction trans_sensors
i2c struct for sensors
uint8_t current[2]
current in motors (in deciamp)
bool initialized
init flag
uint8_t accel_rate
accel rate (from 1 to 10)
struct i2c_transaction trans_cmd
i2c struct for command
int32_t encoders[2]
encoder values
volatile uint8_t buf[I2C_BUF_LEN]
Transaction buffer With I2C_BUF_LEN number of bytes.
enum I2CTransactionStatus status
Transaction status.
bool i2c_transmit(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len)
Submit a write only transaction.
bool i2c_transceive(struct i2c_periph *p, struct i2c_transaction *t, uint8_t s_addr, uint8_t len_w, uint16_t len_r)
Submit a write/read transaction.
@ I2CTransSuccess
transaction successfully finished by I2C driver
@ I2CTransFailed
transaction failed
@ I2CTransDone
transaction set to done by user level
Hardware independent API for actuators (servos, motor controllers).
PRINT_CONFIG_VAR(ONELOOP_ANDI_FILT_CUTOFF)