esp32/mphalport.h: Make mp_hal_pin_<dir> select gpio on the pad.

Otherwise interfaces like software I2C and SPI don't initialise correctly.
This commit is contained in:
Eric Poulsen 2017-09-29 09:00:55 -07:00 committed by Damien George
parent b74809c70a
commit 5adc133f05

View File

@ -59,12 +59,15 @@ mp_hal_pin_obj_t machine_pin_get_id(mp_obj_t pin_in);
#define mp_obj_get_pin(o) machine_pin_get_id(o) // legacy name; only to support esp8266/modonewire
#define mp_hal_pin_name(p) (p)
static inline void mp_hal_pin_input(mp_hal_pin_obj_t pin) {
gpio_pad_select_gpio(pin);
gpio_set_direction(pin, GPIO_MODE_INPUT);
}
static inline void mp_hal_pin_output(mp_hal_pin_obj_t pin) {
gpio_pad_select_gpio(pin);
gpio_set_direction(pin, GPIO_MODE_INPUT_OUTPUT);
}
static inline void mp_hal_pin_open_drain(mp_hal_pin_obj_t pin) {
gpio_pad_select_gpio(pin);
gpio_set_direction(pin, GPIO_MODE_INPUT_OUTPUT_OD);
}
static inline void mp_hal_pin_od_low(mp_hal_pin_obj_t pin) {