Configure SRST output as open-drain for BMP Mini hardware
This commit is contained in:
parent
3cce6f472c
commit
c395c6f73a
|
@ -98,10 +98,15 @@ int platform_init(void)
|
||||||
* to release the device from reset if this floats. */
|
* to release the device from reset if this floats. */
|
||||||
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
|
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
|
||||||
GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
|
GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
|
||||||
/* Enable SRST output */
|
/* Enable SRST output. Original uses a NPN to pull down, so setting the
|
||||||
gpio_set_val(SRST_PORT, SRST_PIN, platform_hwversion() > 0);
|
* output HIGH asserts. Mini is directly connected so use open drain output
|
||||||
|
* and set LOW to assert.
|
||||||
|
*/
|
||||||
|
platform_srst_set_val(false);
|
||||||
gpio_set_mode(SRST_PORT, GPIO_MODE_OUTPUT_50_MHZ,
|
gpio_set_mode(SRST_PORT, GPIO_MODE_OUTPUT_50_MHZ,
|
||||||
GPIO_CNF_OUTPUT_PUSHPULL,
|
(platform_hwversion() == 0
|
||||||
|
? GPIO_CNF_OUTPUT_PUSHPULL
|
||||||
|
: GPIO_CNF_OUTPUT_OPENDRAIN),
|
||||||
SRST_PIN);
|
SRST_PIN);
|
||||||
|
|
||||||
/* Enable internal pull-up on PWR_BR so that we don't drive
|
/* Enable internal pull-up on PWR_BR so that we don't drive
|
||||||
|
|
|
@ -220,3 +220,4 @@ static inline uint16_t _gpio_get(uint32_t gpioport, uint16_t gpios)
|
||||||
#define disconnect_usb() gpio_set_mode(USB_PU_PORT, GPIO_MODE_INPUT, 0, USB_PU_PIN);
|
#define disconnect_usb() gpio_set_mode(USB_PU_PORT, GPIO_MODE_INPUT, 0, USB_PU_PIN);
|
||||||
void assert_boot_pin(void);
|
void assert_boot_pin(void);
|
||||||
void setup_vbus_irq(void);
|
void setup_vbus_irq(void);
|
||||||
|
void platform_srst_set_val(bool assert);
|
||||||
|
|
Loading…
Reference in New Issue