本文整理汇总了C++中send_byte函数的典型用法代码示例。如果您正苦于以下问题:C++ send_byte函数的具体用法?C++ send_byte怎么用?C++ send_byte使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了send_byte函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: reset
/*
* reset the floppy.
*
* The first thing that the driver needs to do is reset the controller.This
* will put it in a known state. To reset the primary floppy controller,(in C)
*
* 1.write 0x00 to the DIGITAL_OUTPUT_REG of the desired controller
* 2.write 0x0C to the DIGITAL_OUTPUT_REG of the desired controller
* 3.wait for an interrupt from the controller
* 4.check interrupt status (this is function 0x08 of controllers)
* 5.write 0x00 to the CONFIG_CONTROL_REG
* 6.configure the drive desired on the controller (function 0x03 of controller)
* 7.calibrate the drive (function 0x07 of controller)
*
*/
static void reset( )
{
//LOG("reset() called ...\n");
/* stop the motor and disable IRQ/DMA */
outb_p(0x0c,FD_DOR);
/* program data rate (500K/s) */
outb_p(0,FD_DCR);
/* re-enable interrupts */
outb_p(0x1c,FD_DOR);
/* resetting triggered an interrupt - handle it */
done = TRUE;
wait_fdc(TRUE);
/* specify drive timings (got these off the BIOS) */
send_byte(FD_SPECIFY);
send_byte(0xdf); /* SRT = 3ms, HUT = 240ms */
send_byte(0x06); /* HLT = 16ms, ND = 0 */
recalibrate();
}
开发者ID:huangrui,项目名称:Thunix,代码行数:39,代码来源:fd.c
示例2: send_byte
void send_byte(uint8_t b) {
switch(b) {
case '\n':
send_byte('\r');
USART_SendData(USART3, '\n');
while(USART_GetFlagStatus(USART3, USART_FLAG_TXE) == RESET);
break;
default:
USART_SendData(USART3, b);
break;
}
while(USART_GetFlagStatus(USART3, USART_FLAG_TXE) == RESET);
}
开发者ID:en0,项目名称:stm32f10x_FreeRTOS,代码行数:16,代码来源:main.c
示例3: send_data
void send_data(unsigned char* data, int len)
{
int i = 0;
output_38k();
delay_us(NEC_HDR_MARK);
output_38k_off();
delay_us(NEC_HDR_MARK - PWM_DELAY);
for (i = 0; i < len; i++)
send_byte(data[i]);
send_bit(1);
delay_us(NEC_HDR_MARK- PWM_DELAY);
}
开发者ID:tanhangbo,项目名称:RaspberryIR,代码行数:16,代码来源:ir_encode.c
示例4: get_byte
int Radio::connect() {
// Used on the arduino
_rec = 0;
if (is_connected()) return 0;
for (int i=0; i<_max_connect_tries; i++) {
_rec = get_byte();
if (_rec == WAITING){
while(!send_byte(CONNECT));
return 0;
}
else delay(_WAITING_delay);
}
// failure to connect
DEBUG("Failure to connect");
return 1;
}
开发者ID:BonnieDougherty,项目名称:PlateReaderCode,代码行数:16,代码来源:Radio.cpp
示例5: log_num
// log_num is used for logging numbers.
void log_num(int num)
{
if(num < 0)
{
num *= -1;
send_byte('-');
}
send_byte('0' + num/10000);
send_byte('0' + (num/1000)%10);
send_byte('0' + (num/100)%10);
send_byte('0' + (num/10)%10);
send_byte('0' + num%10);
send_byte('|');
}
开发者ID:vishwa91,项目名称:e_steth,代码行数:15,代码来源:uart.c
示例6: receive_register_extract
void graph_link_hle_device::rcv_complete()
{
receive_register_extract();
if (m_ready)
{
assert(m_empty);
send_byte(get_received_char());
m_ready = false;
}
else
{
m_buffer[m_head] = get_received_char();
m_head = (m_head + 1) % BUFLEN;
m_empty = false;
}
}
开发者ID:Dagarman,项目名称:mame,代码行数:17,代码来源:graphlinkhle.cpp
示例7: YADA_E7
void YADA_E7(U8 YY,U8 MM,U8 DD,U8 HH,U8 M,U8 SS)
{
send_xy(0xaae7,0x55aa);
send_word(0x5aa5);
send_byte(YY);
send_byte(MM);
send_byte(DD);
send_byte(HH);
send_byte(M);
send_byte(SS);
send_end();
}
开发者ID:yiqixiaoxixi,项目名称:test,代码行数:12,代码来源:LCDDriver.c
示例8: send_int
void send_int(int a)
{
int temp;
int rev=0;
int dummy =a;
while (dummy)
{
rev = rev * 10;
rev = rev + dummy%10;
dummy = dummy/10;
}
while(rev)
{
temp=rev%10;
send_byte(0x30+temp);
rev /=10;
}
}
开发者ID:mexanick,项目名称:msp-dev,代码行数:18,代码来源:main.c
示例9: start
int8_t I2C::wait_dev_busy(uint8_t slaveAddress)
{
int8_t ret;
uint8_t i = 0;
do
{
start();
ret = send_7bits_address(slaveAddress);
send_ack();
send_byte(slaveAddress);
stop();
if(i++==100)
{
return -1;
}
}while(ret != 0);//如果返回值不是0,继续等待
return 0;
}
开发者ID:hcmoder,项目名称:gatePrj,代码行数:18,代码来源:i2c.cpp
示例10: rs232_xmit_msg_task
void rs232_xmit_msg_task( void *pvParameters )
{
serial_str_msg msg;
int curr_char;
while(1) {
/* Read from the queue. Keep trying until a message is received. This
* will block for a period of time (specified by portMAX_DELAY). */
while(!xQueueReceive(serial_str_queue, &msg, portMAX_DELAY));
/* Write each character of the message to the RS232 port. */
curr_char = 0;
while(msg.str[curr_char] != '\0') {
send_byte(msg.str[curr_char]);
curr_char++;
}
}
}
开发者ID:AgathaYang,项目名称:stm32_p103_demos,代码行数:18,代码来源:main.c
示例11: i2c_send
irom i2c_error_t i2c_send(int address, int length, const uint8_t *bytes)
{
int current;
i2c_error_t error;
bool_t ack;
if(!i2c_flags.init_done)
return(i2c_error_no_init);
if(state != i2c_state_idle)
return(i2c_error_invalid_state_not_idle);
state = i2c_state_header_send;
if((error = send_header(address, i2c_direction_send)) != i2c_error_ok)
return(error);
for(current = 0; current < length; current++)
{
state = i2c_state_data_send_data;
if((error = send_byte(bytes[current])) != i2c_error_ok)
return(error);
state = i2c_state_data_send_ack_receive;
if((error = receive_ack(&ack)) != i2c_error_ok)
return(error);
state = i2c_state_data_send_ack_received;
if(!ack)
return(i2c_error_data_nak);
}
state = i2c_state_stop_send;
if((error = send_stop()) != i2c_error_ok)
return(error);
state = i2c_state_idle;
return(i2c_error_ok);
}
开发者ID:chuanchen0,项目名称:esp8266-universal-io-bridge,代码行数:44,代码来源:i2c.c
示例12: send_string
int send_string(int socketfd, const char* str)
{
byte len;
len = strlen(str);
byte byte_str[len];
// Send the length of the string
if (send_byte(socketfd, len) != 1) {
return -1;
}
// Now send the string itself
strncpy(byte_str, str, len);
if (send(socketfd, byte_str, len, 0) <= 0) {
return -1;
}
return len;
}
开发者ID:cmoresid,项目名称:dirapp,代码行数:19,代码来源:common.c
示例13: init_7279
/**********************************************************
函数名:HD7279初始化函数
功 能:初始化HD7279(管脚配置、HD7279复位)
输 入:无
返 回:无
备 注:使用先,选配置管脚的宏定义
*********************************************************/
void init_7279(void)
{
unsigned int tmr;
DR7279 |= cs7279; //cs7279定义为输出
DR7279 |= clk7279; //clk7279定义为输出
DR7279 |= dat7279; //dat7279定义为输出
DR7279 &= ~(key7279); //key7279定义为输入
WR7279 |= cs7279; //cs7279初始化为1
WR7279 |= clk7279; //clk7279初始化为1
WR7279 |= dat7279; //dat7279初始化为1
WR7279 |= key7279; //key7279初始化为有弱上拉
for(tmr=0;tmr<0xf000;tmr++); //上电延时
send_byte(CMD_RESET); //复位HD7279
}
开发者ID:gaogaoxiasha,项目名称:project,代码行数:26,代码来源:HD7279.C
示例14: printnum
void printnum(uint32_t number)
{
uint32_t temp = number;
uint32_t max = 10;
uint32_t counter = 0;
do
{
temp /= 10;
counter++;
} while(temp > 0);
for(temp = 0; temp < counter-1; temp++)
{
max *= 10;
}
for (; max > 1; max/=10)
{
send_byte((number%(max))/(max/10) + '0');
}
}
开发者ID:albf,项目名称:OpcodeConverter,代码行数:19,代码来源:ARCH_avr_serial.c
示例15: data_
SHT11::SHT11(DigitalInOut const& data, DigitalOut const& sck)
: data_(data), sck_(sck)
{
data_.mode(OpenDrain);
data_ = 1;
sck_ = 0;
SHT11_setup_delay();
/* Interface reset */
for (int i=0; i<9; i++)
{
sck_ = 1;
SHT11_clock_delay();
sck_ = 0;
SHT11_clock_delay();
}
start();
send_byte(SHT11_RESET);
delay_ms(SHT11_RESET_TIME_MS);
}
开发者ID:herm,项目名称:sht11,代码行数:19,代码来源:sht11.cpp
示例16: crc16_chksum
//Method to send data string
void RTTY::send(char *data) {
char c;
char chksum_str[6];
//Call checksum routine
unsigned int CHECKSUM = crc16_chksum(data);
sprintf(chksum_str, "*%04X\n", CHECKSUM);
//Concatinate data with checksum
strcat(data, chksum_str);
c = *data++;
//While we haven't reached the end of the data string, keep sending bytes
while (c != '\0') {
send_byte(c);
c = *data++;
}
}
开发者ID:ManchesterSpaceProgramme,项目名称:MSP-arduino,代码行数:20,代码来源:rtty.cpp
示例17: send_memory
void send_memory(void* ptr, size_t len) {
char* x = (char*)ptr;
char buffer[100];
char buffer2[50];
int i;
sprintf(buffer, "Dumping Memory at [0x%x]\n[ %08X ] ", (int)x, (int)x);
send_string(buffer);
for(i = 1; len > 0; len--, x++, i++) {
sprintf(buffer, "%02X ", *x);
if((i%16) == 0) {
sprintf(buffer2, "\n[ %08X ] ", (int)x);
strcat(buffer, buffer2);
}
else if((i%8) == 0) strcat(buffer, "- ");
send_string(buffer);
}
send_byte('\n');
}
开发者ID:en0,项目名称:stm32f10x_FreeRTOS,代码行数:20,代码来源:main.c
示例18: uniphier_i2c_receive
static int uniphier_i2c_receive(struct uniphier_i2c_dev *dev, uint addr,
uint len, u8 *buf, bool *stop)
{
int ret;
debug("%s: addr = %x, len = %d\n", __func__, addr, len);
ret = send_byte(dev, I2C_DTRM_STA | I2C_DTRM_NACK |
I2C_DTRM_RD | addr << 1, stop);
if (ret < 0)
goto fail;
while (len--)
*buf++ = send_and_recv_byte(dev, len ? 0 : I2C_DTRM_NACK);
fail:
if (*stop)
writel(I2C_DTRM_STO | I2C_DTRM_NACK, &dev->regs->dtrm);
return ret;
}
开发者ID:675816156,项目名称:uboot-2016-for-itop4412,代码行数:21,代码来源:i2c-uniphier.c
示例19: get_data
signed long get_data ( signed char dig_start,signed char dig_end )
{
signed long temp_long = 0;
signed char i,temp_char;
for( i = dig_start; i <= dig_end; i++ )
write7279(UNDECODE + i,0x08); //显示为'_'
for( i = dig_end; i >= dig_start ; i-- )
{
temp_char = get_key7279();
temp_long *= 10;
temp_long += temp_char;
write7279 ( DECODE1 + i , 0x80 + temp_char); //1译码可以显示字母
}
delay10ms(5);
send_byte(CMD_RESET);
return temp_long;
}
开发者ID:gaogaoxiasha,项目名称:project,代码行数:22,代码来源:HD7279.C
示例20: set_power
void
fujitsu_control::poweroff()
{
set_power(false);
m_powermem = false;
char bytes[7], i;
bytes[0] = 0x14;
bytes[1] = 0x63;
bytes[2] = 0x00;
bytes[3] = 0x10;
bytes[4] = 0x10;
bytes[5] = 0x02;
bytes[6] = 0xFD;
send_leader();
for (i = 0; i < 7; ++i) {
send_byte(bytes[i]);
}
send_trailer();
}
开发者ID:cedricp,项目名称:espAirCond,代码行数:22,代码来源:fujitsu_control.cpp
注:本文中的send_byte函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论