PCA9629 a stepper motor controller class library
Class library for PCA9629.
A sample program available on http://mbed.org/users/nxp_ip/code/PCA9629_Hello/
Diff: PCA9629.h
- Revision:
- 2:2d07f1c46eb3
- Parent:
- 1:b3d94e04adfa
diff -r b3d94e04adfa -r 2d07f1c46eb3 PCA9629.h --- a/PCA9629.h Thu Feb 02 05:23:12 2012 +0000 +++ b/PCA9629.h Fri Feb 03 03:44:06 2012 +0000 @@ -156,12 +156,18 @@ char I2C_address = PCA9629_DEFAULT_ADDR ); - /** + /** Initialize all registers * - * + * The initializing values are defined in the function */ void init_registers( void ); + /** Initialize all registers + * + * The initializing values are defined in the function + */ + void set_all_registers( char *a, char size ); + /** Write 1 byte data into a register * * Setting 8 bits data into a register @@ -198,6 +204,16 @@ */ short read( Register16bits register_name ); + /** Motor start + * + * Start command + * This function starts motor operation with hard-stop flag and rotation+step enabled, no repeat will be performed + * If custom start is required, use "write( PCA9629::MCNTL, 0xXX )" to control each bits. + * + * @param dir rotate direction ("CW" or "CCW") + */ + void start( Direction dir ); + /** Motor stop * * Stop command