| 106 | #endif |
| 107 | |
| 108 | void test_gpio(void) |
| 109 | { |
| 110 | #ifdef BSP_USING_PIN |
| 111 | rt_uint32_t ret; |
| 112 | rt_kprintf("Hello Test GPIO!\n"); |
| 113 | |
| 114 | rt_pin_mode(TEST_PIN_OUT, PIN_MODE_OUTPUT); |
| 115 | rt_pin_write(TEST_PIN_OUT, PIN_HIGH); |
| 116 | rt_pin_mode(TEST_PIN_IN, PIN_MODE_INPUT); |
| 117 | |
| 118 | ret = rt_pin_read(TEST_PIN_IN); |
| 119 | rt_kprintf("common high input test read result: %d\n",ret); |
| 120 | |
| 121 | rt_pin_write(TEST_PIN_OUT, PIN_LOW); |
| 122 | ret = rt_pin_read(TEST_PIN_IN); |
| 123 | rt_kprintf("common low input test read result: %d\n",ret); |
| 124 | |
| 125 | rt_pin_mode(TEST_PIN_IN, PIN_MODE_INPUT_PULLDOWN); |
| 126 | rt_pin_attach_irq(TEST_PIN_IN, PIN_IRQ_MODE_RISING, gpio_rising_test, RT_NULL); |
| 127 | rt_pin_irq_enable(TEST_PIN_IN, PIN_IRQ_ENABLE); |
| 128 | rt_pin_write(TEST_PIN_OUT, PIN_HIGH); |
| 129 | |
| 130 | rt_pin_irq_enable(TEST_PIN_IN, PIN_IRQ_DISABLE); |
| 131 | #endif |
| 132 | } |
| 133 | |
| 134 | #ifdef BSP_USING_I2C1 |
| 135 | #define DS3231_I2C_BUS_NAME "i2c1" |
no test coverage detected