123456789101112131415161718192021222324252627282930313233 |
- // Mid Level Utility Function: cm_WriteCommand()
- //
- // Note: this module must be after all low level functions in the library and
- // before all high level user function to assure that any reference to
- // this function in this library are satistified.
- #include "CM_LIB.h"
- #include "CM_I2C.h"
- #include "CM_I2C_L.h"
- #include <unistd.h>
- #include <stdio.h>
- #include "linux/fcntl.h"
- #include "driver.h"
- #include <string.h>
- uint8_t cm_WriteCommand(uint8_t* pucInsBuff, uint8_t* pucSendVal, uint8_t ucLen)
- {
- // int i;
- // printf("---> cm_WriteCommand: %#02x %#02x %#02x %#02x - ", pucInsBuff[0], pucInsBuff[1], pucInsBuff[2], pucInsBuff[3]);
- // for(i=0;i<ucLen;i++)
- // printf("%#02x ", pucSendVal[i]);
- // printf("\n");
- uint8_t ucReturn;
- if ((ucReturn = CM_LOW_LEVEL.SendCommand(pucInsBuff)) != SUCCESS)
- {
- printf("---> cm_WriteCommand ucReturn %d\n", ucReturn);
- return ucReturn;
- }
- ucReturn = CM_LOW_LEVEL.SendData(pucSendVal, ucLen);
- //printf("---> cm_WriteCommand over!\n");
- return ucReturn;
- }
|