本文整理汇总了C++中ap_hal::OwnPtr::set_read_flag方法的典型用法代码示例。如果您正苦于以下问题:C++ OwnPtr::set_read_flag方法的具体用法?C++ OwnPtr::set_read_flag怎么用?C++ OwnPtr::set_read_flag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ap_hal::OwnPtr
的用法示例。
在下文中一共展示了OwnPtr::set_read_flag方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: spi_init
static void spi_init()
{
// SPI reads have flag 0x80 set
spi_dev->set_read_flag(0x80);
// run the SPI bus at low speed
spi_dev->set_speed(AP_HAL::Device::SPEED_LOW);
uint8_t whoami = 0;
uint8_t v;
spi_dev->write_register(0x6B, 0x01);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x6A, 0x10);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6C, 0x3f);
spi_dev->write_register(0xF5, 0x00);
spi_dev->write_register(0x19, 0x09);
spi_dev->write_register(0xEA, 0x00);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x6A, 0x10);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x23, 0x00);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x1D, 0xC0);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x1A, 0xC0);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x38, 0x01);
spi_dev->read_registers(0x6A, &v, 1);
printf("reg 0x6A=0x%02x\n", v);
spi_dev->read_registers(0x6B, &v, 1);
printf("reg 0x6B=0x%02x\n", v);
hal.scheduler->delay(1);
spi_dev->write_register(0x6A, 0x10);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x23, 0x00);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6B, 0x41);
spi_dev->write_register(0x6C, 0x3f);
spi_dev->write_register(0x6B, 0x41);
spi_dev->read_registers(0x6A, &v, 1);
printf("reg 0x6A=0x%02x\n", v);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x6A, 0x10);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x23, 0x00);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->read_registers(0x6A, &v, 1);
printf("reg 0x6A=0x%02x\n", v);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x6A, 0x10);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
spi_dev->write_register(0x6B, 0x01);
hal.scheduler->delay(1);
spi_dev->write_register(0x23, 0x00);
spi_dev->write_register(0x6B, 0x41);
hal.scheduler->delay(1);
//.........这里部分代码省略.........