本文整理汇总了C++中send_vector函数的典型用法代码示例。如果您正苦于以下问题:C++ send_vector函数的具体用法?C++ send_vector怎么用?C++ send_vector使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_vector函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: issp_read_block
int issp_read_block(struct issp_host *host, uint8_t block_idx, uint8_t addr,
uint8_t *buf, int len)
{
int blk_size, i;
int ret;
blk_size = host->pdata->block_size;
len = len + addr > blk_size ? blk_size - addr : len;
if (!len)
return 0;
ret = issp_block_verify_setup(host, block_idx);
if (ret)
return ret;
ret = issp_check_status(host);
if (ret)
return ret;
send_vector(host, vec_sync_enable, bits_sync_enable);
send_vector(host, vec_read_write_setup, bits_read_write_setup);
for (i = 0; i < len; i++)
buf[i] = issp_read_byte_at(host, addr++);
send_vector(host, vec_sync_disable, bits_sync_disable);
return len;
}
示例2: issp_prog_verify_block
static int issp_prog_verify_block(struct issp_host *host, uint8_t idx)
{
send_vector(host, vec_sync_enable, bits_sync_enable);
send_vector(host, vec_set_block_num, bits_set_block_num);
pin_data_out(host);
send_bits(host, &idx, 8);
send_vector(host, vec_set_block_num_end, bits_set_block_num_end);
send_vector(host, vec_sync_disable, bits_sync_disable);
send_vector(host, vec_program_and_verify, bits_program_and_verify);
return wait_and_poll(host);
}
示例3: issp_send_block
static void issp_send_block(struct issp_host *host)
{
uint8_t addr = 0;
send_vector(host, vec_sync_enable, bits_sync_enable);
send_vector(host, vec_read_write_setup, bits_read_write_setup);
pin_data_out(host);
while (addr < host->pdata->block_size)
issp_write_byte(host, addr++, issp_fw_get_byte(host));
pin_data_z(host);
}
示例4: issp_read_byte_at
static uint8_t issp_read_byte_at(struct issp_host *host, uint8_t addr)
{
uint8_t address = addr << 1, data;
send_vector(host, vec_read_byte_v[0], bits_read_byte_v[0]);
pin_data_out(host);
send_bits(host, &address, 7);
generate_clocks(host, 2);
data = read_byte(host);
send_vector(host, vec_read_byte_v[1], bits_read_byte_v[1]);
return data;
}
示例5: set_meters_on
static void set_meters_on(struct echoaudio *chip, char on)
{
if (on && !chip->meters_enabled) {
send_vector(chip, DSP_VC_METERS_ON);
chip->meters_enabled = 1;
} else if (!on && chip->meters_enabled) {
send_vector(chip, DSP_VC_METERS_OFF);
chip->meters_enabled = 0;
memset((s8 *)chip->comm_page->vu_meter, ECHOGAIN_MUTED,
DSP_MAXPIPES);
memset((s8 *)chip->comm_page->peak_meter, ECHOGAIN_MUTED,
DSP_MAXPIPES);
}
}
示例6: restore_dsp_rettings
static int restore_dsp_rettings(struct echoaudio *chip)
{
int err;
DE_INIT(("restore_dsp_settings\n"));
if ((err = check_asic_status(chip)) < 0)
return err;
/* @ Gina20/Darla20 only. Should be harmless for other cards. */
chip->comm_page->gd_clock_state = GD_CLOCK_UNDEF;
chip->comm_page->gd_spdif_status = GD_SPDIF_STATUS_UNDEF;
chip->comm_page->handshake = 0xffffffff;
if ((err = set_sample_rate(chip, chip->sample_rate)) < 0)
return err;
if (chip->meters_enabled)
if (send_vector(chip, DSP_VC_METERS_ON) < 0)
return -EIO;
#ifdef ECHOCARD_HAS_EXTERNAL_CLOCK
if (set_input_clock(chip, chip->input_clock) < 0)
return -EIO;
#endif
#ifdef ECHOCARD_HAS_OUTPUT_CLOCK_SWITCH
if (set_output_clock(chip, chip->output_clock) < 0)
return -EIO;
#endif
if (update_output_line_level(chip) < 0)
return -EIO;
if (update_input_line_level(chip) < 0)
return -EIO;
#ifdef ECHOCARD_HAS_VMIXER
if (update_vmixer_level(chip) < 0)
return -EIO;
#endif
if (wait_handshake(chip) < 0)
return -EIO;
clear_handshake(chip);
DE_INIT(("restore_dsp_rettings done\n"));
return send_vector(chip, DSP_VC_UPDATE_FLAGS);
}
示例7: send_uint32
void GameObjectMessage::send(uint32_t object_id, GameObject *game_object) {
send_uint32(socket_, object_id);
send_vector(socket_, game_object->body().position());
send_char(socket_, game_object->game_object_type());
send_object_points(socket_, game_object->characteristic_points());
send_bool(socket_, game_object->alive());
}
示例8: check_asic_status
static int check_asic_status(struct echoaudio *chip)
{
u32 box_status;
if (wait_handshake(chip))
return -EIO;
chip->comm_page->ext_box_status =
__constant_cpu_to_le32(E3G_ASIC_NOT_LOADED);
chip->asic_loaded = FALSE;
clear_handshake(chip);
send_vector(chip, DSP_VC_TEST_ASIC);
if (wait_handshake(chip)) {
chip->dsp_code = NULL;
return -EIO;
}
box_status = le32_to_cpu(chip->comm_page->ext_box_status);
DE_INIT(("box_status=%x\n", box_status));
if (box_status == E3G_ASIC_NOT_LOADED)
return -ENODEV;
chip->asic_loaded = TRUE;
return box_status & E3G_BOX_TYPE_MASK;
}
示例9: check_asic_status
/* ASIC status check - some cards have one or two ASICs that need to be
loaded. Once that load is complete, this function is called to see if
the load was successful.
If this load fails, it does not necessarily mean that the hardware is
defective - the external box may be disconnected or turned off.
This routine sometimes fails for Layla20; for Layla20, the loop runs
5 times and succeeds if it wins on three of the loops. */
static int check_asic_status(struct echoaudio *chip)
{
u32 asic_status;
int goodcnt, i;
chip->asic_loaded = FALSE;
for (i = goodcnt = 0; i < 5; i++) {
send_vector(chip, DSP_VC_TEST_ASIC);
/* The DSP will return a value to indicate whether or not
the ASIC is currently loaded */
if (read_dsp(chip, &asic_status) < 0) {
DE_ACT(("check_asic_status: failed on read_dsp\n"));
return -EIO;
}
if (asic_status == ASIC_ALREADY_LOADED) {
if (++goodcnt == 3) {
chip->asic_loaded = TRUE;
return 0;
}
}
}
return -EIO;
}
示例10: update_input_line_level
static int update_input_line_level(struct echoaudio *chip)
{
if (wait_handshake(chip))
return -EIO;
clear_handshake(chip);
return send_vector(chip, DSP_VC_UPDATE_INGAIN);
}
示例11: issp_set_security
static int issp_set_security(struct issp_host *host)
{
uint8_t addr = 0;
send_vector(host, vec_sync_enable, bits_sync_enable);
send_vector(host, vec_read_write_setup, bits_read_write_setup);
pin_data_out(host);
while (addr < host->pdata->security_size)
issp_write_byte(host, addr++, issp_fw_get_byte(host));
pin_data_z(host);
send_vector(host, vec_secure, bits_secure);
return wait_and_poll(host);
}
示例12: update_vmixer_level
/* Tell the DSP to read and update virtual mixer levels in comm page. */
static int update_vmixer_level(struct echoaudio *chip)
{
if (wait_handshake(chip))
return -EIO;
clear_handshake(chip);
return send_vector(chip, DSP_VC_SET_VMIXER_GAIN);
}
示例13: send_char
void GameObjectMessage::send_object_points(Socket* socket, const std::vector<Vector> &points) {
char points_size = static_cast<char>(points.size());
send_char(socket, points_size);
for (std::vector<Vector>::const_iterator it = points.begin();
it != points.end();
it++) {
send_vector(socket_, *it);
}
}
示例14: set_sample_rate
static int set_sample_rate(struct echoaudio *chip, u32 rate)
{
if (wait_handshake(chip))
return -EIO;
chip->sample_rate = rate;
chip->comm_page->sample_rate = cpu_to_le32(rate);
clear_handshake(chip);
return send_vector(chip, DSP_VC_UPDATE_CLOCKS);
}
示例15: issp_check_status
static int issp_check_status(struct issp_host *host)
{
uint8_t status;
int ret;
send_vector(host, vec_sync_enable, bits_sync_enable);
send_vector(host, vec_read_status, bits_read_status);
generate_clocks(host, 2);
status = read_byte(host);
send_vector(host, vec_read_status_end, bits_read_status_end);
send_vector(host, vec_sync_disable, bits_sync_disable);
switch (status) {
case 0x00:
ret = 0;
break;
case 0x01:
dev_err(&host->pdev->dev, "ReadStatus: " \
"Not allowed because of block level protection\n");
ret = -EACCES;
break;
case 0x03:
dev_err(&host->pdev->dev, "ReadStatus: Fatal error\n");
ret = -EIO;
break;
case 0x04:
dev_err(&host->pdev->dev, "ReadStatus: Checksum failure\n");
ret = -EIO;
break;
case 0x06:
dev_err(&host->pdev->dev, "ReadStatus: Caliberate failure\n");
ret = -EIO;
break;
default:
dev_err(&host->pdev->dev,
"ReadStatus: Failed 0x%02x\n", status);
ret = -EIO;
break;
}
return ret;
}