Library to handle the X_NUCLEO_IHM02A1 Motor Control Expansion Board based on the L6470 component.
Fork of X_NUCLEO_IHM02A1 by
Diff: Components/l6470/l6470_class.h
- Revision:
- 11:1aca63b2f034
- Parent:
- 8:a9513361a2ec
- Child:
- 12:a942d51c488b
--- a/Components/l6470/l6470_class.h Mon Jan 04 16:10:54 2016 +0000 +++ b/Components/l6470/l6470_class.h Thu Jan 14 10:00:31 2016 +0000 @@ -170,7 +170,7 @@ */ virtual int Init(void *init) { - return (int) L6470_Config((MICROSTEPPING_MOTOR_InitTypeDef *) init); + return (int) L6470_Config((L6470_InitTypeDef *) init); } /** @@ -198,9 +198,9 @@ * @param parameter The parameter's identifier (or its register address). * @retval The parameter's value. */ - virtual unsigned int GetParameter(unsigned int parameter) + virtual float GetParameter(unsigned int parameter) { - return (unsigned int) L6470_GetParam((eL6470_RegId_t) parameter); + return (float) L6470_GetParam((eL6470_RegId_t) parameter); } /** @@ -289,7 +289,7 @@ * @param value The parameter's value. * @retval None. */ - virtual void SetParameter(unsigned int parameter, unsigned int value) + virtual void SetParameter(unsigned int parameter, float value) { L6470_SetParam((eL6470_RegId_t) parameter, (uint32_t) value); } @@ -1086,7 +1086,7 @@ */ void AttachFlagIRQ(void (*fptr)(void)) { - flag_irq.rise(fptr); + flag_irq.fall(fptr); } /** @@ -1116,7 +1116,7 @@ */ void AttachBusyIRQ(void (*fptr)(void)) { - busy_irq.rise(fptr); + busy_irq.fall(fptr); } /** @@ -1185,7 +1185,7 @@ uint8_t L6470_mA_2_OcdTh(float mA); float L6470_StallTh_2_mA(uint8_t StallTh); uint8_t L6470_mA_2_StallTh(float mA); - DrvStatusTypeDef L6470_Config(MICROSTEPPING_MOTOR_InitTypeDef *MotorParameterData); + DrvStatusTypeDef L6470_Config(L6470_InitTypeDef *MotorParameterData); void L6470_SetParam(eL6470_RegId_t L6470_RegId, uint32_t Value); uint32_t L6470_GetParam(eL6470_RegId_t L6470_RegId); void L6470_Run(eL6470_DirId_t L6470_DirId, uint32_t Speed);