28 #ifndef config_mkk_v2_MODULE_H
29 #define config_mkk_v2_MODULE_H
67 #define CONFIG_MKK_V2_MASK_SET_PWM_SCALING 0x01
68 #define CONFIG_MKK_V2_MASK_SET_CURRENT_LIMIT 0x02
69 #define CONFIG_MKK_V2_MASK_SET_TEMP_LIMIT 0x04
70 #define CONFIG_MKK_V2_MASK_SET_CURRENT_SCALING 0x08
71 #define CONFIG_MKK_V2_MASK_SET_BITCONFIG 0x10
72 #define CONFIG_MKK_V2_MASK_RESET_CAPCOUNTER 0x20
73 #define CONFIG_MKK_V2_MASK_SET_DEFAULT_PARAMS 0x40
74 #define CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM 0x80
76 #define BITCONF_REVERSE_ROTATION 0x01
82 #define config_mkk_v2_ResetDefault(_v) { \
83 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_DEFAULT_PARAMS; \
84 config_mkk_v2_send_eeprom(); \
87 #define config_mkk_v2_SetPwmScaling(_v) { \
88 config_mkk_v2_eeprom.PwmScaling = _v; \
89 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_PWM_SCALING; \
90 config_mkk_v2_send_eeprom(); \
93 #define config_mkk_v2_SetCurrentLimit(_v) { \
94 config_mkk_v2_eeprom.CurrentLimit = _v; \
95 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_CURRENT_LIMIT; \
96 config_mkk_v2_send_eeprom(); \
99 #define config_mkk_v2_SetTempLimit(_v) { \
100 config_mkk_v2_eeprom.TempLimit = _v; \
101 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_TEMP_LIMIT; \
102 config_mkk_v2_send_eeprom(); \
105 #define config_mkk_v2_SetCurrentScaling(_v) { \
106 config_mkk_v2_eeprom.CurrentScaling = _v; \
107 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_CURRENT_SCALING; \
108 config_mkk_v2_send_eeprom(); \
111 #define config_mkk_v2_SetBitConfig(_v) { \
112 config_mkk_v2_eeprom.BitConfig = _v; \
113 config_mkk_v2_eeprom.SetMask = CONFIG_MKK_V2_MASK_SET_SAVE_EEPROM | CONFIG_MKK_V2_MASK_SET_BITCONFIG; \
114 config_mkk_v2_send_eeprom(); \
117 #define config_mkk_v2_GetConfig(_v) { \
118 config_mkk_v2.addr = _v; \
119 config_mkk_v2_read_eeprom(); \
config_mkk_v2_eeprom_t config_mkk_v2_eeprom
struct i2c_transaction trans
struct config_mkk_v2_struct config_mkk_v2
void config_mkk_v2_periodic_read_status(void)
void config_mkk_v2_periodic_telemetry(void)
void config_mkk_v2_send_eeprom(void)
I2C transaction structure.
void config_mkk_v2_init(void)
void config_mkk_v2_read_eeprom(void)
Architecture independent I2C (Inter-Integrated Circuit Bus) API.