本文整理汇总了C++中LOW_BYTE函数的典型用法代码示例。如果您正苦于以下问题:C++ LOW_BYTE函数的具体用法?C++ LOW_BYTE怎么用?C++ LOW_BYTE使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了LOW_BYTE函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: i2c_process
void i2c_process(void) {
//###Process incoming I²C-Data###
//Target Colors
if(twibuffer[0]<=170) target[0] = twibuffer[0];
if(twibuffer[1]<=170) target[1] = twibuffer[1];
if(twibuffer[2]<=170) target[2] = twibuffer[2];
//Fade type
fade[0] = twibuffer[3];
fade[1] = twibuffer[4];
fade[2] = twibuffer[5];
//###Write new values to twibuffer so we can read current status###
twibuffer[6] = color[0];
twibuffer[7] = color[1];
twibuffer[8] = color[2];
twibuffer[9] = LOW_BYTE(colort[0]);
twibuffer[10] = HIGH_BYTE(colort[0]);
twibuffer[11] = LOW_BYTE(colort[1]);
twibuffer[12] = HIGH_BYTE(colort[1]);
twibuffer[13] = LOW_BYTE(colort[2]);
twibuffer[14] = HIGH_BYTE(colort[2]);
}
示例2: lcm_update_black
static void lcm_update_black(unsigned int x, unsigned int y,unsigned int width, unsigned int height, unsigned short data)
{
unsigned int x0 = x;
unsigned int y0 = y;
unsigned int x1 = x0 + width;
unsigned int y1 = y0 + height + 2;
unsigned int k, i;
set_lcm_register(0x2A00, HIGH_BYTE(x0), 0);
set_lcm_register(0x2A01, LOW_BYTE(x0), 0);
set_lcm_register(0x2A02, HIGH_BYTE(x1), 0);
set_lcm_register(0x2A03, LOW_BYTE(x1), 0);
set_lcm_register(0x2B00, HIGH_BYTE(y0), 0);
set_lcm_register(0x2B01, LOW_BYTE(y0), 0);
set_lcm_register(0x2B02, HIGH_BYTE(y1), 0);
set_lcm_register(0x2B03, LOW_BYTE(y1), 0);
send_ctrl_cmd(0x2C00);
for (i = x0; i < x1; i++)
{
for (k = y0; k < y1; k++)
{
send_data_cmd(data);
send_data_cmd(data);
}
}
}
示例3: get_default_name
static void get_default_name (char *default_name, zword addr)
{
if (addr != 0) {
zbyte len;
int i;
LOW_BYTE (addr, len);
addr++;
for (i = 0; i < len; i++) {
zbyte c;
LOW_BYTE (addr, c);
addr++;
if (c >= 'A' && c <= 'Z')
c += 'a' - 'A';
default_name[i] = c;
}
default_name[i] = 0;
if (strchr (default_name, '.') == NULL)
strcpy (default_name + i, ".AUX");
} else strcpy (default_name, auxilary_name);
}/* get_default_name */
示例4: z_copy_table
/*
* z_copy_table, copy a table or fill it with zeroes.
*
* zargs[0] = address of table
* zargs[1] = destination address or 0 for fill
* zargs[2] = size of table
*
* Note: Copying is safe even when source and destination overlap; but
* if zargs[1] is negative the table _must_ be copied forwards.
*
*/
void z_copy_table (void)
{
zword addr;
zword size = zargs[2];
zbyte value;
int i;
if (zargs[1] == 0) /* zero table */
for (i = 0; i < size; i++)
storeb ((zword) (zargs[0] + i), 0);
else if ((short) size < 0 || zargs[0] > zargs[1]) /* copy forwards */
for (i = 0; i < (((short) size < 0) ? - (short) size : size); i++) {
addr = zargs[0] + i;
LOW_BYTE (addr, value)
storeb ((zword) (zargs[1] + i), value);
}
else /* copy backwards */
for (i = size - 1; i >= 0; i--) {
addr = zargs[0] + i;
LOW_BYTE (addr, value)
storeb ((zword) (zargs[1] + i), value);
}
}/* z_copy_table */
示例5: lcm_update_black
static void lcm_update_black(unsigned int x, unsigned int y,unsigned int width, unsigned int height, unsigned short data)
{
unsigned int x0 = x;
unsigned int y0 = y;
unsigned int x1 = x0 + width;
unsigned int y1 = y0 + height + 2;
unsigned int k, i;
send_ctrl_cmd(0x2A);
send_data_cmd(HIGH_BYTE(x0));
send_data_cmd(LOW_BYTE(x0));
send_data_cmd(HIGH_BYTE(x1));
send_data_cmd(LOW_BYTE(x1));
send_ctrl_cmd(0x2B);
send_data_cmd(HIGH_BYTE(y0));
send_data_cmd(LOW_BYTE(y0));
send_data_cmd(HIGH_BYTE(y1));
send_data_cmd(LOW_BYTE(y1));
send_ctrl_cmd(0x2C);
for (i = x0; i < x1; i++)
{
for (k = y0; k < y1; k++)
{
send_data_cmd(data);
}
}
}
示例6: create_script_turn
// script to rotate in place through deg degrees
// deg > 0 turn CCW; deg < 0 turn CW
void create_script_turn(int deg, int speed) { // degrees, vel in mm/sec
CREATE_BUSY;
create_write_byte(152); // start script
create_write_byte(17); // script length
create_write_byte(147); // on pin 20
create_write_byte(0); // output 0
create_write_byte(137); // move
create_write_byte(HIGH_BYTE(speed));
create_write_byte(LOW_BYTE(speed));
if (deg > 0){ // CCW case
create_write_byte(0);
create_write_byte(1); }
else { // CW case
create_write_byte(255);
create_write_byte(255); }
create_write_byte(157); // wait for angle done
create_write_byte(HIGH_BYTE(deg));
create_write_byte(LOW_BYTE(deg));
create_write_byte(137); // stop move
create_write_byte(0); // no speed
create_write_byte(0);
create_write_byte(0); // no angle
create_write_byte(0);
create_write_byte(147); // on pin 20
create_write_byte(0); // output 1
// end of script
create_write_byte(153); // run script
CREATE_FREE;
}
示例7: create_script_arc
// script to trace an arc of radius rad until deg is reach
// NOTE: if the turn is not in the direction of deg, the arc won't end
void create_script_arc(int rad, int deg, int speed) { // rad in mm, degrees, vel in mm/sec
CREATE_BUSY;
create_write_byte(152); // start script
create_write_byte(17); // script length
create_write_byte(147); // on pin 20
create_write_byte(0); // output 0
create_write_byte(137); // move
create_write_byte(HIGH_BYTE(speed));
create_write_byte(LOW_BYTE(speed));
create_write_byte(HIGH_BYTE(rad));
create_write_byte(HIGH_BYTE(rad));
create_write_byte(157); // wait for angle done
create_write_byte(HIGH_BYTE(deg));
create_write_byte(LOW_BYTE(deg));
create_write_byte(137); // stop move
create_write_byte(0); // no speed
create_write_byte(0);
create_write_byte(0); // no angle
create_write_byte(0);
create_write_byte(147); // on pin 20
create_write_byte(0); // output 1
// end of script
create_write_byte(153); // run script
CREATE_FREE;
}
示例8: create_script_move_direct
// script to move with individual motor control
// dist mm with r_speed mm/sec on right wheel and l_speed on left
void create_script_move_direct(int dist, int r_speed, int l_speed) {
CREATE_BUSY;
create_write_byte(152); // start script
create_write_byte(17); // script length
create_write_byte(147); // on pin 20
create_write_byte(0); // output 0
create_write_byte(145); // move
create_write_byte(HIGH_BYTE(r_speed));
create_write_byte(LOW_BYTE(r_speed));
create_write_byte(HIGH_BYTE(l_speed));
create_write_byte(LOW_BYTE(l_speed));
create_write_byte(156); // wait for distance done
create_write_byte(HIGH_BYTE(dist));
create_write_byte(LOW_BYTE(dist));
create_write_byte(137); // stop move
create_write_byte(0); // no speed
create_write_byte(0);
create_write_byte(0); // no angle
create_write_byte(0);
create_write_byte(147); // on pin 20
create_write_byte(0); // output 1
// end of script
create_write_byte(153); // run script
CREATE_FREE;
}
示例9: _dma_io
void _dma_io(u8_t DMA_channel, unsigned char page, unsigned int offset, unsigned int length, u8_t mode)
{
/* Don't let anyone else mess up what we're doing. */
asm_disable_interrupt();
/* Set up the DMA channel so we can use it. This tells the DMA */
/* that we're going to be using this channel. (It's masked) */
io_outb(MaskReg[DMA_channel], 0x04 | DMA_channel);
/* Clear any data transfers that are currently executing. */
io_outb(ClearReg[DMA_channel], 0x00);
/* Send the specified mode to the DMA. */
io_outb(ModeReg[DMA_channel], mode);
/* Send the offset address. The first byte is the low base offset, the */
/* second byte is the high offset. */
io_outb(AddrPort[DMA_channel], LOW_BYTE(offset));
io_outb(AddrPort[DMA_channel], HI_BYTE(offset));
/* Send the physical page that the data lies on. */
io_outb(PagePort[DMA_channel], page);
/* Send the length of the data. Again, low byte first. */
io_outb(CountPort[DMA_channel], LOW_BYTE(length));
io_outb(CountPort[DMA_channel], HI_BYTE(length));
/* Ok, we're done. Enable the DMA channel (clear the mask). */
io_outb(MaskReg[DMA_channel], DMA_channel);
/* Re-enable interrupts before we leave. */
asm_enable_interrupt();
}
示例10: emAfRf4ceMsoInitAttributes
// Attributes stored in RAM are always re-initialized upon start-up.
void emAfRf4ceMsoInitAttributes(void)
{
uint8_t i, j;
MEMSET(emAfRf4ceMsoRibAttributes,
0x00,
sizeof(EmAfRf4ceMsoRibAttributes)*EMBER_RF4CE_PAIRING_TABLE_SIZE);
// Initialize the device type of all the peripheral ID entries to 0xFF, which
// means "unused" in this context.
for(i=0; i<EMBER_RF4CE_PAIRING_TABLE_SIZE; i++) {
for(j=0; j<EMBER_AF_PLUGIN_RF4CE_MSO_PERIPHERAL_ID_ENTRIES; j++) {
emAfRf4ceMsoRibAttributes[i].peripheralIds[j].deviceType = 0xFF;
}
// Initialize the validation configuration attribute fields to the default
// values.
emAfRf4ceMsoRibAttributes[i].validationConfiguration[0] =
LOW_BYTE(EMBER_AF_PLUGIN_RF4CE_MSO_LINK_LOST_WAIT_TIME_MS);
emAfRf4ceMsoRibAttributes[i].validationConfiguration[1] =
HIGH_BYTE(EMBER_AF_PLUGIN_RF4CE_MSO_LINK_LOST_WAIT_TIME_MS);
emAfRf4ceMsoRibAttributes[i].validationConfiguration[2] =
LOW_BYTE(EMBER_AF_PLUGIN_RF4CE_MSO_AUTO_CHECK_VALIDATION_PERIOD_MS);
emAfRf4ceMsoRibAttributes[i].validationConfiguration[3] =
HIGH_BYTE(EMBER_AF_PLUGIN_RF4CE_MSO_AUTO_CHECK_VALIDATION_PERIOD_MS);
}
}
示例11: sw_clear_panel
static void sw_clear_panel(unsigned int color)
{
unsigned int x0 = 0;
unsigned int y0 = 0;
unsigned int x1 = x0 + FRAME_WIDTH - 1;
unsigned int y1 = y0 + FRAME_HEIGHT - 1;
unsigned int x, y;
send_ctrl_cmd(0x2A);
send_data_cmd(HIGH_BYTE(x0));
send_data_cmd(LOW_BYTE(x0));
send_data_cmd(HIGH_BYTE(x1));
send_data_cmd(LOW_BYTE(x1));
send_ctrl_cmd(0x2B);
send_data_cmd(HIGH_BYTE(y0));
send_data_cmd(LOW_BYTE(y0));
send_data_cmd(HIGH_BYTE(y1));
send_data_cmd(LOW_BYTE(y1));
send_ctrl_cmd(0x2C); // send DDRAM set
// 18-bit mode (256K color) coding
for (y = y0; y <= y1; ++ y) {
for (x = x0; x <= x1; ++ x) {
lcm_util.send_data(color);
}
}
}
示例12: Roomba_Drive
void Roomba_Drive(int16_t velocity, int16_t radius )
{
uart_putchar(DRIVE);
uart_putchar(HIGH_BYTE(velocity));
uart_putchar(LOW_BYTE(velocity));
uart_putchar(HIGH_BYTE(radius));
uart_putchar(LOW_BYTE(radius));
}
示例13: Roomba_Direct_Drive
void Roomba_Direct_Drive(int16_t right_velocity, int16_t left_velocity)
{
uart_putchar(DIRECT_DRIVE);
uart_putchar(HIGH_BYTE(right_velocity));
uart_putchar(LOW_BYTE(right_velocity));
uart_putchar(HIGH_BYTE(left_velocity));
uart_putchar(LOW_BYTE(left_velocity));
}
示例14: create_drive_direct
// this function drives the right wheel at r_speed and the left wheel at l_speed
// speeds for all of these functions are +/-500mm/sec.
void create_drive_direct(int r_speed, int l_speed)
{
CREATE_BUSY;
create_write_byte(145);
create_write_byte(HIGH_BYTE(r_speed));
create_write_byte(LOW_BYTE(r_speed));
create_write_byte(HIGH_BYTE(l_speed));
create_write_byte(LOW_BYTE(l_speed));
CREATE_FREE;
}
示例15: create_drive
// This command drives the robot along a curve with radius (in mm) radius; and at a speed (mm/sec) of speed
// a radius of 32767 will drive the robot straight
// a radius of 1 will spin the robot CCW
// a radius of -1 will spin the robot CW
// Negative radii will be right turns, positive radii left turns
void create_drive (int speed, int radius)
{
CREATE_BUSY;
create_write_byte(137);
create_write_byte(HIGH_BYTE(speed));
create_write_byte(LOW_BYTE(speed));
create_write_byte(HIGH_BYTE(radius));
create_write_byte(LOW_BYTE(radius));
CREATE_FREE;
}