Public Types |
| enum | prepared_action_t |
| | Prepared Actions.
More...
|
Public Member Functions |
| | L6470 (PinName flag_irq, PinName busy_irq, PinName standby_reset, PinName ssel, DevSPI &spi) |
| | Constructor.
|
| virtual | ~L6470 (void) |
| | Destructor.
|
| virtual int | init (void *init) |
| | Initializing the component.
|
| virtual int | read_id (uint8_t *id) |
| | Getting the ID of the component.
|
| virtual unsigned int | get_status (void) |
| | Getting the status.
|
| virtual unsigned int | get_parameter (unsigned int parameter) |
| | Getting a parameter.
|
| virtual signed int | get_position (void) |
| | Getting the position.
|
| virtual signed int | get_mark (void) |
| | Getting the marked position.
|
| virtual unsigned int | get_speed (void) |
| | Getting the current speed in pps.
|
| virtual unsigned int | get_max_speed (void) |
| | Getting the maximum speed in pps.
|
| virtual unsigned int | get_min_speed (void) |
| | Getting the minimum speed in pps.
|
| virtual unsigned int | get_acceleration (void) |
| | Getting the acceleration in pps^2.
|
| virtual unsigned int | get_deceleration (void) |
| | Getting the deceleration in pps^2.
|
| virtual direction_t | get_direction (void) |
| | Getting the direction of rotation.
|
| virtual void | set_parameter (unsigned int parameter, unsigned int value) |
| | Setting a parameter.
|
| virtual void | set_home (void) |
| | Setting the current position to be the home position.
|
| virtual void | set_mark (void) |
| | Setting the current position to be the marked position.
|
| virtual void | set_mark (signed int position) |
| | Setting the current position to be the marked position.
|
| virtual bool | set_max_speed (unsigned int speed) |
| | Setting the maximum speed in pps.
|
| virtual bool | set_min_speed (unsigned int speed) |
| | Setting the minimum speed in pps.
|
| virtual bool | set_acceleration (unsigned int acceleration) |
| | Setting the acceleration in pps^2.
|
| virtual bool | set_deceleration (unsigned int deceleration) |
| | Setting the deceleration in pps^2.
|
| virtual bool | set_step_mode (step_mode_t step_mode) |
| | Setting the Step Mode.
|
| virtual void | go_to (signed int position) |
| | Going to a specified position through the shortest path.
|
| virtual void | go_to (signed int position, direction_t direction) |
| | Going to a specified position imposing the desired direction.
|
| virtual void | go_home (void) |
| | Going to the home position.
|
| virtual void | go_mark (void) |
| | Going to the marked position.
|
| virtual void | go_until (eL6470_ActId_t action, direction_t direction, unsigned int speed) |
| | Running at the given speed imposing the desired direction until an external switch turn-on event occurs.
|
| virtual void | run (direction_t direction) |
| | Running towards a specified direction.
|
| virtual void | run (direction_t direction, unsigned int speed) |
| | Running towards a specified direction at the given speed.
|
| virtual void | move (direction_t direction, unsigned int steps) |
| | Moving towards a specified direction for a certain number of steps.
|
| virtual void | soft_stop (void) |
| | Stopping the motor through an immediate deceleration up to zero speed.
|
| virtual void | hard_stop (void) |
| | Stopping the motor through an immediate infinite deceleration.
|
| virtual void | soft_hiz (void) |
| | Disabling the power bridge after performing a deceleration to zero.
|
| virtual void | hard_hiz (void) |
| | Disabling the power bridge immediately.
|
| virtual void | wait_while_active (void) |
| | Waiting while the motor is active.
|
| virtual void | step_clock (direction_t direction) |
| | Switching to step-clock mode.
|
| virtual void | release_sw (eL6470_ActId_t action, direction_t direction) |
| | Doing a motion at minimum speed imposing a specified direction until the SW is released.
|
| virtual void | reset_device (void) |
| | Resetting the device to power-up conditions.
|
| virtual void | prepare_get_status (void) |
| | Preparing the command to get the status.
|
| virtual void | prepare_get_parameter (unsigned int parameter) |
| | Preparing the command to get a parameter.
|
| virtual void | prepare_get_position (void) |
| | Preparing the command to get the position.
|
| virtual void | prepare_get_mark (void) |
| | Preparing the command to get the marked position.
|
| virtual void | prepare_get_speed (void) |
| | Preparing the command to get the current speed in pps.
|
| virtual void | prepare_get_max_speed (void) |
| | Preparing the command to get the maximum speed in pps.
|
| virtual void | prepare_get_min_speed (void) |
| | Preparing the command to get the minimum speed in pps.
|
| virtual void | prepare_get_acceleration (void) |
| | Preparing the command to get the acceleration in pps^2.
|
| virtual void | prepare_get_deceleration (void) |
| | Preparing the command to get the deceleration in pps^2.
|
| virtual void | prepare_get_direction (void) |
| | Preparing the command to get the direction of rotation.
|
| virtual void | prepare_set_parameter (unsigned int parameter, unsigned int value) |
| | Preparing the command to set a parameter.
|
| virtual void | prepare_set_home (void) |
| | Preparing the command to set the current position to be the home position.
|
| virtual void | prepare_set_mark (void) |
| | Preparing the command to set the current position to be the marked position.
|
| virtual void | prepare_set_mark (signed int position) |
| | Preparing the command to set the given position to be the marked position.
|
| virtual void | prepare_set_speed (unsigned int speed) |
| | Preparing the command to set the current speed in pps.
|
| virtual void | prepare_set_max_speed (unsigned int speed) |
| | Preparing the command to set the maximum speed in pps.
|
| virtual void | prepare_set_min_speed (unsigned int speed) |
| | Preparing the command to set the minimum speed in pps.
|
| virtual void | prepare_set_acceleration (unsigned int acceleration) |
| | Preparing the command to set the acceleration in pps^2.
|
| virtual void | prepare_set_deceleration (unsigned int deceleration) |
| | Preparing the command to set the deceleration in pps^2.
|
| virtual void | prepare_go_to (signed int position) |
| | Preparing the command to go to a specified position.
|
| virtual void | prepare_go_to (signed int position, direction_t direction) |
| | Preparing the command to go to a specified position imposing the desired direction.
|
| virtual void | prepare_go_home (void) |
| | Preparing the command to go to the home position.
|
| virtual void | prepare_go_mark (void) |
| | Preparing the command to go to the marked position.
|
| virtual void | prepare_go_until (eL6470_ActId_t L6470_ActId, direction_t direction, unsigned int speed) |
| | Preparing the command to run at the given speed imposing the desired direction until an external switch turn-on event occurs.
|
| virtual void | prepare_run (direction_t direction) |
| | Preparing the command to run towards a specified direction at the maximum speed.
|
| virtual void | prepare_run (direction_t direction, unsigned int speed) |
| | Preparing the command to run towards a specified direction at the given speed.
|
| virtual void | prepare_move (direction_t direction, unsigned int steps) |
| | Preparing the command to move towards a specified direction for a certain number of steps.
|
| virtual void | prepare_soft_stop (void) |
| | Preparing the command to stop the motor.
|
| virtual void | prepare_hard_stop (void) |
| | Preparing the command to stop the motor and disabling the power bridge.
|
| virtual void | prepare_soft_hiz (void) |
| | Preparing the command to disable the power bridge after performing a deceleration to zero.
|
| virtual void | prepare_hard_hiz (void) |
| | Preparing the command to disable the power bridge immediately.
|
| virtual void | prepare_step_clock (direction_t direction) |
| | Preparing the command to switch to step-clock mode.
|
| virtual void | prepare_release_sw (eL6470_ActId_t action, direction_t direction) |
| | Preparing the command to do a motion at minimum speed imposing a specified direction until the SW is released.
|
| virtual void | prepare_reset_device (void) |
| | Preparing the command to reset the device to power-up conditions.
|
| uint8_t * | perform_prepared_actions (void) |
| | Performing all the actions prepared on the components of the daisy-chain.
|
| prepared_action_t | get_prepared_action (void) |
| | Getting the prepared action.
|
| int32_t | get_result (uint8_t *raw_data) |
| | Converting the raw data received by the component according to the action performed on it.
|
| void | attach_flag_irq (void(*fptr)(void)) |
| | Attaching an interrupt handler to the FLAG interrupt.
|
| void | enable_flag_irq (void) |
| | Enabling the FLAG interrupt handling.
|
| void | disable_flag_irq (void) |
| | Disabling the FLAG interrupt handling.
|
| void | attach_busy_irq (void(*fptr)(void)) |
| | Attaching an interrupt handler to the BUSY interrupt.
|
| void | enable_busy_irq (void) |
| | Enabling the BUSY interrupt handling.
|
| void | disable_busy_irq (void) |
| | Disabling the BUSY interrupt handling.
|
Protected Member Functions |
| int32_t | L6470_AbsPos_2_Position (uint32_t AbsPos) |
| | Convert the absolute position as 2's complement format into the signed number.
|
| uint32_t | L6470_Position_2_AbsPos (int32_t Position) |
| | Convert the position as signed number into absolute position as 2's complement format.
|
| float | L6470_Speed_2_Step_s (uint32_t Speed) |
| | Convert the SPEED register value into step/s.
|
| uint32_t | L6470_Step_s_2_Speed (float Step_s) |
| | Convert the speed as step/s into a right value for SPEED register.
|
| float | L6470_Acc_2_Step_s2 (uint16_t Acc) |
| | Convert the ACC register value into step/(s^2).
|
| uint16_t | L6470_Step_s2_2_Acc (float Step_s2) |
| | Convert the acceleartion as step/(s^2) into a right value for ACC register.
|
| float | L6470_Dec_2_Step_s2 (uint16_t Dec) |
| | Convert the DEC register value into step/(s^2).
|
| uint16_t | L6470_Step_s2_2_Dec (float Step_s2) |
| | Convert the deceleration as step/(s^2) into a right value for DEC register.
|
| float | L6470_MaxSpeed_2_Step_s (uint16_t MaxSpeed) |
| | Convert the MAX_SPEED register value into step/s.
|
| uint16_t | L6470_Step_s_2_MaxSpeed (float Step_s) |
| | Convert the max speed as step/s into a right value for MAX_SPEED register.
|
| float | L6470_MinSpeed_2_Step_s (uint16_t MinSpeed) |
| | Convert the MIN_SPEED register value into step/s.
|
| uint16_t | L6470_Step_s_2_MinSpeed (float Step_s) |
| | Convert the min speed as step/s into a right value for MIN_SPEED register.
|
| float | L6470_FsSpd_2_Step_s (uint16_t FsSpd) |
| | Convert the FS_SPD register value into step/s.
|
| uint16_t | L6470_Step_s_2_FsSpd (float Step_s) |
| | Convert the full-step speed as step/s into a right value for FS_SPD register.
|
| float | L6470_IntSpeed_2_Step_s (uint16_t IntSpeed) |
| | Convert the INT_SPEED register value into step/s.
|
| uint16_t | L6470_Step_s_2_IntSpeed (float Step_s) |
| | Convert the intersect speed as step/s into a right value for INT_SPEED register.
|
| float | L6470_StSlp_2_s_Step (uint8_t StSlp) |
| | Convert the ST_SLP register value into s/step.
|
| uint8_t | L6470_s_Step_2_StSlp (float s_Step) |
| | Convert the intersect speed as step/s into a right value for INT_SPEED register.
|
| float | L6470_FnSlpAcc_2_s_Step (uint8_t FnSlpAcc) |
| | Convert the INT_SPEED register value into step/s.
|
| uint8_t | L6470_s_Step_2_FnSlpAcc (float s_Step) |
| | Convert the intersect speed as step/s into a right value for INT_SPEED register.
|
| float | L6470_FnSlpDec_2_s_Step (uint8_t FnSlpDec) |
| | Convert the INT_SPEED register value into step/s.
|
| uint8_t | L6470_s_Step_2_FnSlpDec (float s_Step) |
| | Convert the intersect speed as step/s into a right value for INT_SPEED register.
|
| float | L6470_OcdTh_2_mA (uint8_t OcdTh) |
| | Convert the OCD_TH register value into mA.
|
| uint8_t | L6470_mA_2_OcdTh (float mA) |
| | Convert the overcurrent threshold as mA into a right value for OCD_TH register.
|
| float | L6470_StallTh_2_mA (uint8_t StallTh) |
| | Convert the STALL_TH register value into mA.
|
| uint8_t | L6470_mA_2_StallTh (float mA) |
| | Convert the stall detection threshold as mA into a right value for STALL_TH register.
|
| status_t | L6470_Config (void *init) |
| | Configures the L6470 registers.
|
| void | L6470_SetParam (eL6470_RegId_t L6470_RegId, uint32_t Value) |
| | SetParam command sets the register value equal to a new value.
|
| uint32_t | L6470_GetParam (eL6470_RegId_t L6470_RegId) |
| | GetParam command reads the register value.
|
| void | L6470_Run (eL6470_DirId_t L6470_DirId, uint32_t Speed) |
| | Run command produces a motion at fixed speed.
|
| void | L6470_StepClock (eL6470_DirId_t L6470_DirId) |
| | StepClock command switches the device in Step-clock mode.
|
| void | L6470_Move (eL6470_DirId_t L6470_DirId, uint32_t N_Step) |
| | Move command produces a motion of N_STEP microsteps.
|
| void | L6470_GoTo (uint32_t AbsPos) |
| | GoTo command produces a motion to ABS_POS absolute position through the shortest path.
|
| void | L6470_GoToDir (eL6470_DirId_t L6470_DirId, uint32_t AbsPos) |
| | GoTo_DIR command produces a motion to ABS_POS absolute position imposing a direction.
|
| void | L6470_GoUntil (eL6470_ActId_t L6470_ActId, eL6470_DirId_t L6470_DirId, uint32_t Speed) |
| | GoUntil command produces a motion at fixed speed imposing a direction until an external switch turn-on event occurs.
|
| void | L6470_ReleaseSW (eL6470_ActId_t L6470_ActId, eL6470_DirId_t L6470_DirId) |
| | ReleaseSW command produces a motion at minimum speed imposing a direction until SW is released.
|
| void | L6470_GoHome (void) |
| | GoHome command produces a motion to the HOME position (zero position) via the shortest path.
|
| void | L6470_GoMark (void) |
| | GoMark command produces a motion to the MARK position performing the minimum path.
|
| void | L6470_ResetPos (void) |
| | ResetPos command resets the ABS_POS register to zero.
|
| void | L6470_ResetDevice (void) |
| | ResetDevice command resets the device to power-up conditions.
|
| void | L6470_SoftStop (void) |
| | SoftStop command causes an immediate deceleration to zero speed and a consequent motor stop; the deceleration value used is the one stored in the DEC register.
|
| void | L6470_HardStop (void) |
| | HardStop command causes an immediate motor stop with infinite deceleration.
|
| void | L6470_SoftHiZ (void) |
| | SoftHiZ command disables the power bridges (high impedance state) after a deceleration to zero; the deceleration value used is the one stored in the DEC register.
|
| void | L6470_HardHiZ (void) |
| | HardHiZ command immediately disables the power bridges (high impedance state).
|
| uint16_t | L6470_GetStatus (void) |
| | GetStatus command returns the STATUS register value.
|
| void | L6470_PrepareSetParam (eL6470_RegId_t L6470_RegId, uint32_t Value) |
| | Prepare to send L6470_SetParam command.
|
| void | L6470_PrepareGetParam (eL6470_RegId_t L6470_RegId) |
| | Prepare to send L6470_GetParam command.
|
| void | L6470_PrepareRun (eL6470_DirId_t L6470_DirId, uint32_t Speed) |
| | Prepare to send L6470_Run command.
|
| void | L6470_PrepareStepClock (eL6470_DirId_t L6470_DirId) |
| | Prepare to send L6470_StepClock command.
|
| void | L6470_PrepareMove (eL6470_DirId_t L6470_DirId, uint32_t N_Step) |
| | Prepare to send L6470_Move command.
|
| void | L6470_PrepareGoTo (uint32_t AbsPos) |
| | Prepare to send L6470_GoTo command.
|
| void | L6470_PrepareGoToDir (eL6470_DirId_t L6470_DirId, uint32_t AbsPos) |
| | Prepare to send L6470_GoToDIR command.
|
| void | L6470_PrepareGoUntil (eL6470_ActId_t L6470_ActId, eL6470_DirId_t L6470_DirId, uint32_t Speed) |
| | Prepare to send L6470_GoUntil command.
|
| void | L6470_PrepareReleaseSW (eL6470_ActId_t L6470_ActId, eL6470_DirId_t L6470_DirId) |
| | Prepare to send L6470_ReleaseSW.
|
| void | L6470_PrepareGoHome (void) |
| | Prepare to send L6470_GoHome command.
|
| void | L6470_PrepareGoMark (void) |
| | Prepare to send L6470_GoMark command.
|
| void | L6470_PrepareResetPos (void) |
| | Prepare to send L6470_ResetPos command.
|
| void | L6470_PrepareResetDevice (void) |
| | Prepare to send L6470_ResetDevice command.
|
| void | L6470_PrepareSoftStop (void) |
| | Prepare to send L6470_SoftStop command.
|
| void | L6470_PrepareHardStop (void) |
| | Prepare to send L6470_HardStop command.
|
| void | L6470_PrepareSoftHiZ (void) |
| | Prepare to send L6470_SoftHiZ command.
|
| void | L6470_PrepareHardHiZ (void) |
| | Prepare to send L6470_HardHiZ command.
|
| void | L6470_PrepareGetStatus (void) |
| | Prepare to send L6470_GetStatus command.
|
| uint8_t * | L6470_PerformPreparedApplicationCommand (void) |
| | Send via SPI the command stored inside the L6470_AppCmdPkg to the L6470 daisy chain.
|
| void | L6470_DaisyChainCommand (uint8_t *pL6470_DaisyChainSpiTxStruct, uint8_t *pL6470_DaisyChainSpiRxStruct) |
| | Send command to the L6470 daisy chain via SPI.
|
| uint32_t | L6470_ExtractReturnedData (uint8_t *pL6470_DaisyChainSpiRxStruct, uint8_t LengthByte) |
| | Extracts the data returned by the L6470 from the matrix that contains the received SPI data.
|
| uint8_t | L6470_CheckStatusRegisterFlag (uint8_t L6470_StatusRegisterFlagId) |
| | Check the state of a flag inside the L6470 STATUS register.
|
| uint8_t * | L6470_GetRegisterName (uint8_t id) |
| | Return the mnemonic name for the L6470 register.
|
| void | L6470_ResetAppCmdPkg (sL6470_AppCmdPkg_t *pL6470_AppCmdPkg) |
| | Reset the structure used to store the identifier of the L6470 application command and its the needed parameters.
|
| void | L6470_FillAppCmdPkg (sL6470_AppCmdPkg_t *pL6470_AppCmdPkg, eL6470_AppCmdId_t L6470_AppCmdId, uint32_t p1, uint32_t p2, uint32_t p3) |
| | Fill the structure used to store the identifier of the L6470 application command and its the needed parameters.
|
| void | L6470_PrepareAppCmdPkg (sL6470_AppCmdPkg_t *pL6470_AppCmdPkg, eL6470_AppCmdId_t L6470_AppCmdId, uint32_t p1, uint32_t p2, uint32_t p3) |
| | This function will fill the column of the L6470_AppCmdPkg related the L6470 to be addressed inside the daisy chain.
|
| void | L6470_PrepareDaisyChainCommand (sL6470_AppCmdPkg_t *pL6470_AppCmdPkg, uint8_t *pL6470_DaisyChainSpiTxStruct) |
| | This function will translate the data inside the L6470_AppCmdPkg into the right data to be sent via SPI to the L6470 daisy chain.
|
| int | round (float f) |
| | Rounding a floating point number to the nearest unsigned integer number.
|
| status_t | Read (uint8_t *pBuffer, uint16_t NumBytesToRead) |
| | Utility function to read data from L6470.
|
| status_t | Write (uint8_t *pBuffer, uint16_t NumBytesToWrite) |
| | Utility function to write data to L6470.
|
| status_t | ReadWrite (uint8_t *pBufferToRead, uint8_t *pBufferToWrite, uint16_t NumBytes) |
| | Utility function to read and write data from/to L6470 at the same time.
|
Static Protected Attributes |
| static const sL6470_Register_t | _L6470_Register [L6470REGIDSIZE] |
| | Array whose elements are a structure in which store information about the L6470 Registers (the address, the names, the length in bits, the reset value)
|
static const
sL6470_ApplicationCommand_t | _L6470_ApplicationCommand [L6470APPCMDIDSIZE] |
| | Array whose elements are a structure in which store information about the L6470 Application Commands (the mnemonic name, the number of needed parameters, the related funtion to call)
|
| static const sL6470_Direction_t | _L6470_Direction [L6470DIRIDSIZE] |
| | The mnemonic names for the L6470 direction.
|
| static const sL6470_ACT_t | _L6470_ACT [L6470ACTIDSIZE] |
| | Action taken about ABS_POS register.
|