当前位置: 首页>>代码示例>>C++>>正文


C++ writeUSBOutString函数代码示例

本文整理汇总了C++中writeUSBOutString函数的典型用法代码示例。如果您正苦于以下问题:C++ writeUSBOutString函数的具体用法?C++ writeUSBOutString怎么用?C++ writeUSBOutString使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了writeUSBOutString函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: _search

/*
 * This function is a special case in that it's argument hasn't been dynamically
 * allocated
 */
int _search(uint8_t * args)
{
    int i;
    int found = 0;
    int arg_len = strlen((char*)args);

    if (args == NULL)
    {
        return 1;
    }

    /*
     * if an argument was given, search
     */
    else
    {
        for (i = 1; i < driver_table_len; i++)
        {
            /*
             * show all matches
             */
            if (prompt_on)
            {
                if (memcmp(args, (char *) driver_table[i].fcn_name, arg_len) == 0)
                {
                    sprintf((char *) str, "%03x %s\r\n", i, driver_table[i].fcn_name);
                    writeUSBOutString(str);
                    found++;
                }
            }

            /*
             * only show an exact match
             */
            else
            {
                if (strcmp((char *) args, (char *) driver_table[i].fcn_name) == 0)
                {
                    sprintf((char *) str, "%03x\r\n", i);
                    writeUSBOutString(str);
                    found++;
                }
            }

        }
        if (!found)
            return 1;
    }
    return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:54,代码来源:extras.c

示例2: _readMag

int _readMag(uint8_t * args)
{
    uint8_t          receive_buffer[6];
    I2C_M_SETUP_Type setup;
    unsigned int     x_value;
    unsigned int     y_value;
    unsigned int     z_value;
    Status           result;
    uint8_t          transmit_buffer;

    setup.sl_addr7bit         = MAG_I2C_SLAVE_ADDRESS;
    setup.retransmissions_max = MAX_ST_I2C_RETRANSMISSIONS;

    setup.tx_data   = &transmit_buffer;
    setup.tx_length = 1;
    setup.rx_data   = receive_buffer;
    setup.rx_length = 6;

    transmit_buffer = MAG_DATA_ADDRESS|ST_I2C_AUTOINCREMENT_ADDRESS;

    result = I2C_MasterTransferData(LPC_I2C0, &setup, I2C_TRANSFER_POLLING);
    if(result == ERROR)
        return 1;

    x_value = MagDataToUInt32(&receive_buffer[0]);
    y_value = MagDataToUInt32(&receive_buffer[2]);
    z_value = MagDataToUInt32(&receive_buffer[4]);

    sprintf((char*)str, "%x %x %x\r\n", x_value, y_value, z_value);
    writeUSBOutString(str);

    return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:33,代码来源:extras.c

示例3: _I2C_GetLastStatusCode

int _I2C_GetLastStatusCode(uint8_t * args)
{
	uint8_t * arg_ptr;
	LPC_I2C_TypeDef* I2Cx;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	I2Cx = (LPC_I2C_TypeDef*) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) I2C_GetLastStatusCode(I2Cx));
	writeUSBOutString(str);
	return 0;
}
开发者ID:chenguangshen,项目名称:MiDebug,代码行数:12,代码来源:_lpc17xx_i2c.c

示例4: _EMAC_SetPHYMode

int _EMAC_SetPHYMode(uint8_t * args)
{
	uint8_t * arg_ptr;
	uint32_t ulPHYMode;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	ulPHYMode = (uint32_t) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) EMAC_SetPHYMode(ulPHYMode));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:12,代码来源:_lpc17xx_emac.c

示例5: _RIT_GetIntStatus

int _RIT_GetIntStatus(uint8_t * args)
{
    uint8_t * arg_ptr;
    LPC_RIT_TypeDef* RITx;

    if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
    RITx = (LPC_RIT_TypeDef*) strtoul((char *) arg_ptr, NULL, 16);

    sprintf((char *) str, "%x\r\n", (unsigned int) RIT_GetIntStatus(RITx));
    writeUSBOutString(str);
    return 0;
}
开发者ID:robovero,项目名称:firmware,代码行数:12,代码来源:_lpc17xx_rit.c

示例6: _malloc

int _malloc(uint8_t * args)
{
    uint8_t * arg;
    size_t size;

    if ((arg = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
    size = (size_t) strtoul((char *) arg, NULL, 16);

    sprintf((char *) str, "%x\r\n", (unsigned int) malloc(size));
    writeUSBOutString(str);
    return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:12,代码来源:extras.c

示例7: _EMAC_CheckReceiveDataStatus

int _EMAC_CheckReceiveDataStatus(uint8_t * args)
{
	uint8_t * arg_ptr;
	uint32_t ulRxStatType;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	ulRxStatType = (uint32_t) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) EMAC_CheckReceiveDataStatus(ulRxStatType));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:12,代码来源:_lpc17xx_emac.c

示例8: _EMAC_Init

int _EMAC_Init(uint8_t * args)
{
	uint8_t * arg_ptr;
	EMAC_CFG_Type* EMAC_ConfigStruct;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	EMAC_ConfigStruct = (EMAC_CFG_Type*) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) EMAC_Init(EMAC_ConfigStruct));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:12,代码来源:_lpc17xx_emac.c

示例9: _FIO_ReadValue

int _FIO_ReadValue(uint8_t * args)
{
	uint8_t * arg_ptr;
	uint8_t portNum;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	portNum = (uint8_t) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) FIO_ReadValue(portNum));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:12,代码来源:_lpc17xx_gpio.c

示例10: _PWM_GetIntStatus

int _PWM_GetIntStatus(uint8_t * args)
{
	uint8_t * arg_ptr;
	LPC_PWM_TypeDef* PWMx;
	uint32_t IntFlag;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWMx = (LPC_PWM_TypeDef*) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	IntFlag = (uint32_t) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) PWM_GetIntStatus(PWMx, IntFlag));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:15,代码来源:_lpc17xx_pwm.c

示例11: _PWM_GetCaptureValue

int _PWM_GetCaptureValue(uint8_t * args)
{
	uint8_t * arg_ptr;
	LPC_PWM_TypeDef* PWMx;
	uint8_t CaptureChannel;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWMx = (LPC_PWM_TypeDef*) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	CaptureChannel = (uint8_t) strtoul((char *) arg_ptr, NULL, 16);

	sprintf((char *) str, "%x\r\n", (unsigned int) PWM_GetCaptureValue(PWMx, CaptureChannel));
	writeUSBOutString(str);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:15,代码来源:_lpc17xx_pwm.c

示例12: _PWM_COUNTERCFG_Type_CountInputSelect

int _PWM_COUNTERCFG_Type_CountInputSelect(uint8_t * args)
{
	uint8_t * arg_ptr;
	PWM_COUNTERCFG_Type* PWM_COUNTERCFG_Type_ptr;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWM_COUNTERCFG_Type_ptr = (PWM_COUNTERCFG_Type *) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) {
		sprintf((char *) str, "%x\r\n", (unsigned int) PWM_COUNTERCFG_Type_ptr->CountInputSelect);
		writeUSBOutString(str);
		return 0;
	}

	PWM_COUNTERCFG_Type_ptr->CountInputSelect = (uint8_t) strtoul((char *) arg_ptr, NULL, 16);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:16,代码来源:_lpc17xx_pwm.c

示例13: _PWM_CAPTURECFG_Type_IntOnCaption

int _PWM_CAPTURECFG_Type_IntOnCaption(uint8_t * args)
{
	uint8_t * arg_ptr;
	PWM_CAPTURECFG_Type* PWM_CAPTURECFG_Type_ptr;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWM_CAPTURECFG_Type_ptr = (PWM_CAPTURECFG_Type *) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) {
		sprintf((char *) str, "%x\r\n", (unsigned int) PWM_CAPTURECFG_Type_ptr->IntOnCaption);
		writeUSBOutString(str);
		return 0;
	}

	PWM_CAPTURECFG_Type_ptr->IntOnCaption = (uint8_t) strtoul((char *) arg_ptr, NULL, 16);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:16,代码来源:_lpc17xx_pwm.c

示例14: _PWM_TIMERCFG_Type_PrescaleValue

int _PWM_TIMERCFG_Type_PrescaleValue(uint8_t * args)
{
	uint8_t * arg_ptr;
	PWM_TIMERCFG_Type* PWM_TIMERCFG_Type_ptr;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWM_TIMERCFG_Type_ptr = (PWM_TIMERCFG_Type *) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) {
		sprintf((char *) str, "%x\r\n", (unsigned int) PWM_TIMERCFG_Type_ptr->PrescaleValue);
		writeUSBOutString(str);
		return 0;
	}

	PWM_TIMERCFG_Type_ptr->PrescaleValue = (uint32_t) strtoul((char *) arg_ptr, NULL, 16);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:16,代码来源:_lpc17xx_pwm.c

示例15: _PWM_MATCHCFG_Type_ResetOnMatch

int _PWM_MATCHCFG_Type_ResetOnMatch(uint8_t * args)
{
	uint8_t * arg_ptr;
	PWM_MATCHCFG_Type* PWM_MATCHCFG_Type_ptr;

	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) return 1;
	PWM_MATCHCFG_Type_ptr = (PWM_MATCHCFG_Type *) strtoul((char *) arg_ptr, NULL, 16);
	if ((arg_ptr = (uint8_t *) strtok(NULL, " ")) == NULL) {
		sprintf((char *) str, "%x\r\n", (unsigned int) PWM_MATCHCFG_Type_ptr->ResetOnMatch);
		writeUSBOutString(str);
		return 0;
	}

	PWM_MATCHCFG_Type_ptr->ResetOnMatch = (uint8_t) strtoul((char *) arg_ptr, NULL, 16);
	return 0;
}
开发者ID:AutonomyLab,项目名称:Raymond,代码行数:16,代码来源:_lpc17xx_pwm.c


注:本文中的writeUSBOutString函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。