本文整理汇总了C++中card_send_command函数的典型用法代码示例。如果您正苦于以下问题:C++ card_send_command函数的具体用法?C++ card_send_command怎么用?C++ card_send_command使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了card_send_command函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: sb1000_get_PIDs
/* get SB1000 PIDs */
static int
sb1000_get_PIDs(const int ioaddr[], const char* name, short PID[])
{
static const unsigned char Command0[6] = {0x80, 0x40, 0x00, 0x00, 0x00, 0x00};
static const unsigned char Command1[6] = {0x80, 0x41, 0x00, 0x00, 0x00, 0x00};
static const unsigned char Command2[6] = {0x80, 0x42, 0x00, 0x00, 0x00, 0x00};
static const unsigned char Command3[6] = {0x80, 0x43, 0x00, 0x00, 0x00, 0x00};
unsigned char st[7];
int status;
udelay(1000);
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
PID[0] = st[1] << 8 | st[2];
if ((status = card_send_command(ioaddr, name, Command1, st)))
return status;
PID[1] = st[1] << 8 | st[2];
if ((status = card_send_command(ioaddr, name, Command2, st)))
return status;
PID[2] = st[1] << 8 | st[2];
if ((status = card_send_command(ioaddr, name, Command3, st)))
return status;
PID[3] = st[1] << 8 | st[2];
return sb1000_end_get_set_command(ioaddr, name);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:34,代码来源:sb1000.c
示例2: sb1000_end_get_set_command
static inline int
sb1000_end_get_set_command(const int ioaddr[], const char* name)
{
unsigned char st[7];
int status;
const unsigned char Command0[6] = {0x80, 0x1b, 0x02, 0x00, 0x00, 0x00};
const unsigned char Command1[6] = {0x20, 0x00, 0x00, 0x00, 0x00, 0x00};
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
return card_send_command(ioaddr, name, Command1, st);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:12,代码来源:sb1000.c
示例3: sb1000_set_PIDs
/* set SB1000 PIDs */
static int
sb1000_set_PIDs(const int ioaddr[], const char* name, const short PID[])
{
static const unsigned char Command4[6] = {0x80, 0x2e, 0x00, 0x00, 0x00, 0x00};
unsigned char st[7];
short p;
int status;
unsigned char Command0[6] = {0x80, 0x31, 0x00, 0x00, 0x00, 0x00};
unsigned char Command1[6] = {0x80, 0x32, 0x00, 0x00, 0x00, 0x00};
unsigned char Command2[6] = {0x80, 0x33, 0x00, 0x00, 0x00, 0x00};
unsigned char Command3[6] = {0x80, 0x34, 0x00, 0x00, 0x00, 0x00};
udelay(1000);
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
p = PID[0];
Command0[3] = p & 0xff;
p >>= 8;
Command0[2] = p & 0xff;
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
p = PID[1];
Command1[3] = p & 0xff;
p >>= 8;
Command1[2] = p & 0xff;
if ((status = card_send_command(ioaddr, name, Command1, st)))
return status;
p = PID[2];
Command2[3] = p & 0xff;
p >>= 8;
Command2[2] = p & 0xff;
if ((status = card_send_command(ioaddr, name, Command2, st)))
return status;
p = PID[3];
Command3[3] = p & 0xff;
p >>= 8;
Command3[2] = p & 0xff;
if ((status = card_send_command(ioaddr, name, Command3, st)))
return status;
if ((status = card_send_command(ioaddr, name, Command4, st)))
return status;
return sb1000_end_get_set_command(ioaddr, name);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:50,代码来源:sb1000.c
示例4: sb1000_set_frequency
/* set SB1000 frequency */
static int
sb1000_set_frequency(const int ioaddr[], const char* name, int frequency)
{
unsigned char st[7];
int status;
unsigned char Command0[6] = {0x80, 0x29, 0x00, 0x00, 0x00, 0x00};
const int FrequencyLowerLimit = 57000;
const int FrequencyUpperLimit = 804000;
if (frequency < FrequencyLowerLimit || frequency > FrequencyUpperLimit) {
printk(KERN_ERR "%s: frequency chosen (%d kHz) is not in the range "
"[%d,%d] kHz\n", name, frequency, FrequencyLowerLimit,
FrequencyUpperLimit);
return -EINVAL;
}
udelay(1000);
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
Command0[5] = frequency & 0xff;
frequency >>= 8;
Command0[4] = frequency & 0xff;
frequency >>= 8;
Command0[3] = frequency & 0xff;
frequency >>= 8;
Command0[2] = frequency & 0xff;
return card_send_command(ioaddr, name, Command0, st);
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:29,代码来源:sb1000.c
示例5: sb1000_reset
/* reset SB1000 card */
static int
sb1000_reset(const int ioaddr[], const char* name)
{
static const unsigned char Command0[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
unsigned char st[7];
int port, status;
port = ioaddr[1] + 6;
outb(0x4, port);
inb(port);
udelay(1000);
outb(0x0, port);
inb(port);
ssleep(1);
outb(0x4, port);
inb(port);
udelay(1000);
outb(0x0, port);
inb(port);
udelay(0);
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
if (st[3] != 0xf0)
return -EIO;
return 0;
}
开发者ID:325116067,项目名称:semc-qsd8x50,代码行数:29,代码来源:sb1000.c
示例6: sb1000_start_get_set_command
static inline int
sb1000_start_get_set_command(const int ioaddr[], const char* name)
{
unsigned char st[7];
const unsigned char Command0[6] = {0x80, 0x1b, 0x00, 0x00, 0x00, 0x00};
return card_send_command(ioaddr, name, Command0, st);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:8,代码来源:sb1000.c
示例7: sb1000_activate
static inline int
sb1000_activate(const int ioaddr[], const char* name)
{
unsigned char st[7];
int status;
const unsigned char Command0[6] = {0x80, 0x11, 0x00, 0x00, 0x00, 0x00};
const unsigned char Command1[6] = {0x80, 0x16, 0x00, 0x00, 0x00, 0x00};
ssleep(1);
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
if ((status = card_send_command(ioaddr, name, Command1, st)))
return status;
if (st[3] != 0xf1) {
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
return -EIO;
}
udelay(1000);
return sb1000_start_get_set_command(ioaddr, name);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:21,代码来源:sb1000.c
示例8: sb1000_get_frequency
/* get SB1000 frequency */
static int
sb1000_get_frequency(const int ioaddr[], const char* name, int* frequency)
{
unsigned char st[7];
int status;
const unsigned char Command0[6] = {0x80, 0x44, 0x00, 0x00, 0x00, 0x00};
udelay(1000);
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
*frequency = ((st[1] << 8 | st[2]) << 8 | st[3]) << 8 | st[4];
return sb1000_end_get_set_command(ioaddr, name);
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:16,代码来源:sb1000.c
示例9: sb1000_check_CRC
/* check SB1000 firmware CRC */
static inline int
sb1000_check_CRC(const int ioaddr[], const char* name)
{
unsigned char st[7];
int crc, status;
const unsigned char Command0[6] = {0x80, 0x1f, 0x00, 0x00, 0x00, 0x00};
/* check CRC */
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
if (st[1] != st[3] || st[2] != st[4])
return -EIO;
crc = st[1] << 8 | st[2];
return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:16,代码来源:sb1000.c
示例10: sb1000_get_firmware_version
/* get SB1000 firmware version */
static int
sb1000_get_firmware_version(const int ioaddr[], const char* name,
unsigned char version[], int do_end)
{
unsigned char st[7];
int status;
const unsigned char Command0[6] = {0x80, 0x23, 0x00, 0x00, 0x00, 0x00};
if ((status = sb1000_start_get_set_command(ioaddr, name)))
return status;
if ((status = card_send_command(ioaddr, name, Command0, st)))
return status;
if (st[0] != 0xa3)
return -EIO;
version[0] = st[1];
version[1] = st[2];
if (do_end)
return sb1000_end_get_set_command(ioaddr, name);
else
return 0;
}
开发者ID:3sOx,项目名称:asuswrt-merlin,代码行数:22,代码来源:sb1000.c
注:本文中的card_send_command函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论