Index: firmware/App/Drivers/PinchValve.h =================================================================== diff -u -ra02481d0934a1a13209d652c24837e4f56869c43 -r1f3e57c1351a085c6a05105a50ef73393cc974c6 --- firmware/App/Drivers/PinchValve.h (.../PinchValve.h) (revision a02481d0934a1a13209d652c24837e4f56869c43) +++ firmware/App/Drivers/PinchValve.h (.../PinchValve.h) (revision 1f3e57c1351a085c6a05105a50ef73393cc974c6) @@ -32,56 +32,22 @@ * @{ */ -// ********** public definitions ********** -#define PINCH_VALVE_MAX_INPUT_WORDS 3 ///< Maximum number of command input words. -#define PINCH_VALVE_MAX_OUTPUT_WORDS 3 ///< Maximum number of command output words. - -/// Pinch valve command request. -typedef struct -{ - U16 cmdHeader; ///< Command header. - U16 inputWord1; ///< Input word 1. - U16 inputWord2; ///< Input word 2. - U16 inputWord3; ///< Input word 3. - U08 inputWordCount; ///< Number of valid input words, excluding the command header. - U08 outputWordCount; ///< Number of output words expected. - BOOL writeOnly; ///< TRUE for a write-only command. -} PINCH_VALVE_COMMAND_T; - -/// Pinch valve command response. -typedef struct -{ - U16 outputWord1; ///< Output word 1. - U16 outputWord2; ///< Output word 2. - U16 outputWord3; ///< Output word 3. - U08 spiCmdStatus; ///< FPGA SPI command status. - U08 readCount; ///< FPGA read count. - U08 errorCount; ///< FPGA invalid command error count. -} PINCH_VALVE_RESPONSE_T; - -/// Pinch valve driver command result. -typedef enum pinchValveCommandResults -{ - PINCH_VALVE_CMD_RESULT_IDLE = 0, ///< No command has been requested. - PINCH_VALVE_CMD_RESULT_BUSY, ///< Command is executing. - PINCH_VALVE_CMD_RESULT_COMPLETE, ///< Command completed successfully. - PINCH_VALVE_CMD_RESULT_ERROR ///< Command failed. -} PINCH_VALVE_CMD_RESULT_T; - // ********** public function prototypes ********** void initPinchValveDriver( void ); void execPinchValveDriver( void ); +void execPinchValveFunction( void ); +void execPinchValveCommand( void ); -BOOL setPinchValveCommand( VALVE_T valve, const PINCH_VALVE_COMMAND_T *command ); +BOOL homePinchValve( VALVE_T valve ); +BOOL setPinchValvePosition( VALVE_T valve, S32 position ); +S32 getPinchValvePosition( VALVE_T valve ); void setPinchValveEnableReset( VALVE_T valve, BOOL enable, BOOL reset ); -U08 getPinchValveEnableReset( VALVE_T valve ); +U08 getPinchValveEnableReset( VALVE_T valve ); BOOL isPinchValveBusy( void ); -PINCH_VALVE_CMD_RESULT_T getPinchValveCommandResult( void ); -BOOL getPinchValveResponse( VALVE_T valve, PINCH_VALVE_RESPONSE_T *response ); /**@}*/