本文整理汇总了C++中gpio::gpio_init方法的典型用法代码示例。如果您正苦于以下问题:C++ gpio::gpio_init方法的具体用法?C++ gpio::gpio_init怎么用?C++ gpio::gpio_init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gpio
的用法示例。
在下文中一共展示了gpio::gpio_init方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: led7seg_testing_init
/*----------------------------------------------------------------------------*/
void led7seg_testing_init(void)
{
HA_NOTIFY("\n*** Initializing hardware for LED7SEG tests ***\n"
"L1 pin: port: %u (port A = 0,...), pin: %u\n"
"L2 pin: port: %u (port A = 0,...), pin: %u\n"
"L3 pin: port: %u (port A = 0,...), pin: %u\n"
"L4 pin: port: %u (port A = 0,...), pin: %u\n"
"A pin: port: %u (port A = 0,...), pin: %u\n"
"B pin: port: %u (port A = 0,...), pin: %u\n"
"C pin: port: %u (port A = 0,...), pin: %u\n"
"D pin: port: %u (port A = 0,...), pin: %u\n"
"h pin: port: %u (port A = 0,...), pin: %u\n",
l1_params.port, l1_params.pin,
l2_params.port, l2_params.pin,
l3_params.port, l3_params.pin,
l4_params.port, l4_params.pin,
a_params.port, a_params.pin,
b_params.port, b_params.pin,
c_params.port, c_params.pin,
d_params.port, d_params.pin,
h_params.port, h_params.pin);
MB1_L1.gpio_init(&l1_params);
MB1_L2.gpio_init(&l2_params);
MB1_L3.gpio_init(&l3_params);
MB1_L4.gpio_init(&l4_params);
MB1_A.gpio_init(&a_params);
MB1_B.gpio_init(&b_params);
MB1_C.gpio_init(&c_params);
MB1_D.gpio_init(&d_params);
MB1_h.gpio_init(&h_params);
}
示例2: button_testing_init
/*----------------------------------------------------------------------------*/
void button_testing_init(void)
{
HA_NOTIFY("up pin: port: %u (port A = 0,...), pin: %u.\n"
"down pin: port: %u (port A = 0,...), pin: %u.\n"
"left pin: port: %u (port A = 0,...), pin: %u.\n"
"right pin: port: %u (port A = 0,...), pin: %u.\n"
"select pin: port: %u (port A = 0,...), pin: %u.\n",
up_params.port, up_params.pin,
down_params.port, down_params.pin,
left_params.port, left_params.pin,
right_params.port, right_params.pin,
select_params.port, select_params.pin);
MB1_up.gpio_init(&up_params);
MB1_down.gpio_init(&down_params);
MB1_left.gpio_init(&left_params);
MB1_right.gpio_init(&right_params);
MB1_select.gpio_init(&select_params);
testing_delay_us(100000);
}
示例3:
/*----------------------------------------------------------------------------*/
static void sim900_testing_init(void)
{
HA_NOTIFY("\nInitializing hardware for sim900 tests\n"
"USART: %u, Baudrate: %lu\n"
"RI pin: port: %u (port A = 0,...), pin: %u\n",
uart_num, baudrate,
RI_params.port, RI_params.pin);
/* Initialize UART */
MB1_usart.Restart(baudrate);
MB1_usart.it_enable(0,1);
MB1_usart.it_config(USART_IT_RXNE, ENABLE);
MB1_int.subISR_assign(MB1_int_type, usart3_irq);
/* Init RI pin */
RI_pin.gpio_init(&RI_params);
HA_NOTIFY("\nRI: %d (should be 1)\n", RI_pin.gpio_read());
/* Create ring buffer */
rb_init(&rx_buffer, 128);
}