Library for MAX14871 Shield, MAXREFDES89#
Dependents: MAXREFDES89_MAX14871_Shield_Demo MAXREFDES89_Test_Program Line_Following_Bot Line_Following_Bot_Pololu
Diff: max14871_shield.h
- Revision:
- 3:89bf07b855e5
- Parent:
- 1:7e9b864ddacf
- Child:
- 5:a206f6505109
diff -r 9b50d36d69c8 -r 89bf07b855e5 max14871_shield.h --- a/max14871_shield.h Tue Jul 28 03:42:06 2015 +0000 +++ b/max14871_shield.h Tue Aug 11 04:11:46 2015 +0000 @@ -196,10 +196,76 @@ * @return 0 on success, non-0 on failure **************************************************************/ int16_t set_pwm_duty_cycle(max14871_motor_driver_t md, float duty_cycle); + + + /**********************************************************//** + * @brief Get operating mode of selected motor driver + * + * @details + * + * On Entry: + * @param[in] md - 1 of 4 motor drivers on the shield + * + * On Exit: + * @return operating mode of selected motor driver + **************************************************************/ + max14871_operating_mode_t get_operating_mode(max14871_motor_driver_t md); + + + /**********************************************************//** + * @brief Get current regulation mode of selected motor driver + * + * @details + * + * On Entry: + * @param[in] md - 1 of 4 motor drivers on the shield + * + * On Exit: + * @return current regulation mode of selected motor driver + **************************************************************/ + max14871_current_regulation_mode_t get_current_regulation_mode(max14871_motor_driver_t md); + + + /**********************************************************//** + * @brief Get duty cycle of selected motor driver + * + * @details + * + * On Entry: + * @param[in] md - 1 of 4 motor drivers on the shield + * + * On Exit: + * @return duty cycle of selected motor driver + **************************************************************/ + float get_pwm_duty_cycle(max14871_motor_driver_t md); + + + /**********************************************************//** + * @brief Get external voltage reference of selected motor driver + * + * @details + * + * On Entry: + * @param[in] md - 1 of 4 motor drivers on the shield + * + * On Exit: + * @return external voltage reference of selected motor driver + **************************************************************/ + float get_external_voltage_ref(max14871_motor_driver_t md); private: + struct motor_data_s + { + max14871_operating_mode_t op_mode; + max14871_current_regulation_mode_t i_reg_mode; + float duty_cycle; + float v_ref; + }; + + struct motor_data_s _motor_data_array[4]; + I2C *_p_i2c; Max7300 *_p_io_expander; Max5387 *_p_digi_pot1;