Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of X_NUCLEO_IHM01A1 by
Diff: Components/l6474/l6474_class.cpp
- Revision:
- 1:b38ebb8ea286
- Parent:
- 0:2887415a46cd
- Child:
- 2:de6d31fa3709
- Child:
- 4:83a1eb397a65
--- a/Components/l6474/l6474_class.cpp Wed Oct 14 15:12:18 2015 +0000 +++ b/Components/l6474/l6474_class.cpp Fri Oct 16 13:30:06 2015 +0000 @@ -45,7 +45,7 @@ Repository: http://svn.x-nucleodev.codex.cro.st.com/svnroot/X-NucleoDev Branch/Trunk/Tag: trunk Based on: X-CUBE-SPN1/trunk/Drivers/BSP/Components/l6474/l6474.c - Revision: 0 + Revision: :0 */ @@ -54,8 +54,8 @@ #include "l6474_class.h" #include "l6474.h" - -/* Private constants ---------------------------------------------------------*/ + +/* Private constants ---------------------------------------------------------*/ /// Error while initialising the SPI #define L6474_ERROR_0 (0x8000) @@ -78,7 +78,7 @@ uint8_t L6474::numberOfDevices = 0; -/* Private function prototypes -----------------------------------------------*/ +/* Methods -------------------------------------------------------------------*/ /******************************************************//** * @brief Attaches a user callback to the error Handler. @@ -144,7 +144,7 @@ **********************************************************/ DrvStatusTypeDef L6474::L6474_ReadID(uint8_t *id) { - *id = type; + *id = deviceInstance; return COMPONENT_OK; } @@ -514,6 +514,16 @@ } /******************************************************//** + * @brief Locks until the device state becomes Inactive + * @retval None + **********************************************************/ +void L6474::L6474_WaitWhileActive(void) +{ + /* Wait while motor is running */ + while (L6474_GetDeviceState() != INACTIVE); +} + +/******************************************************//** * @brief Issue the Disable command to the L6474 of the specified device * @retval None **********************************************************/