Add a stub mgos_gpio_remove_int_handler()

This commit is contained in:
Pim van Pelt
2019-01-09 14:16:05 +01:00
parent 5d194fe8ae
commit d69536b305
2 changed files with 45 additions and 0 deletions

36
tests/mcp23xxx.c Normal file
View File

@ -0,0 +1,36 @@
#include "mgos.h"
#include "mgos_mcp23xxx.h"
#include "tests_autogen.h"
uint32_t test_mcp23xxx_period_ms = 100;
bool test_mcp23xxx_enabled = true;
static struct mgos_mcp23xxx *s_dev;
bool test_mcp23xxx_create(void) {
uint8_t i;
s_dev = mgos_mcp23017_create(mgos_i2c_get_global(), 0x20, -1);
if (!s_dev) return NULL;
for (i=0; i<8; i++)
mgos_mcp23xxx_gpio_setup_input(s_dev, i, MGOS_GPIO_PULL_UP);
for (i=8; i<16; i++)
mgos_mcp23xxx_gpio_set_mode(s_dev, i, MGOS_GPIO_MODE_OUTPUT);
return true;
}
bool test_mcp23xxx_run(void) {
uint8_t i;
mgos_mcp23xxx_gpio_read(s_dev, 0);
for (i=8; i<16; i++)
mgos_mcp23xxx_gpio_write(s_dev, i, random()%2);
return true;
}
bool test_mcp23xxx_destroy(void) {
mgos_mcp23xxx_destroy(&s_dev);
return true;
}