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:
- 5:a206f6505109
- Parent:
- 3:89bf07b855e5
- Child:
- 6:dc06cc75c1c8
diff -r 4e42c80f56b6 -r a206f6505109 max14871_shield.h
--- a/max14871_shield.h Mon Aug 24 17:11:41 2015 +0000
+++ b/max14871_shield.h Tue Dec 22 04:24:07 2015 +0000
@@ -168,6 +168,24 @@
/**********************************************************//**
+ * @brief Sets pwm channel for given motor driver
+ *
+ * @details Must use default, or alternate channel for specific
+ * motor driver. Function allows for mix of default and
+ * alternates for each motor driver vs all default or
+ * all alternate.
+ *
+ * On Entry:
+ * @param[in] md - 1 of 4 motor drivers on the shield
+ * @param[in] ch - PWM channel using Arduino naming convention
+ *
+ * On Exit:
+ * @return 0 on success, non-0 on failure
+ **************************************************************/
+ int16_t set_pwm_channel(max14871_motor_driver_t md, PinName ch);
+
+
+ /**********************************************************//**
* @brief Sets period of pwm signal for selected motor driver
*
* @details period must be in micro-seconds
@@ -241,6 +259,20 @@
/**********************************************************//**
+ * @brief Get pwm period of selected motor driver
+ *
+ * @details
+ *
+ * On Entry:
+ * @param[in] md - 1 of 4 motor drivers on the shield
+ *
+ * On Exit:
+ * @return pwm period of selected motor driver
+ **************************************************************/
+ float get_pwm_period(max14871_motor_driver_t md);
+
+
+ /**********************************************************//**
* @brief Get external voltage reference of selected motor driver
*
* @details
@@ -261,6 +293,7 @@
max14871_operating_mode_t op_mode;
max14871_current_regulation_mode_t i_reg_mode;
float duty_cycle;
+ float period;
float v_ref;
};
MAXREFDES89#-MAX14871