Configure SRST output as open-drain for BMP Mini hardware

This commit is contained in:
Michael Tharp 2013-10-04 21:24:53 -04:00 committed by Gareth McMullin
parent 3cce6f472c
commit c395c6f73a
2 changed files with 9 additions and 3 deletions

View File

@ -98,10 +98,15 @@ int platform_init(void)
* to release the device from reset if this floats. */
gpio_set_mode(GPIOA, GPIO_MODE_OUTPUT_2_MHZ,
GPIO_CNF_OUTPUT_PUSHPULL, GPIO7);
/* Enable SRST output */
gpio_set_val(SRST_PORT, SRST_PIN, platform_hwversion() > 0);
/* Enable SRST output. Original uses a NPN to pull down, so setting the
* 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_CNF_OUTPUT_PUSHPULL,
(platform_hwversion() == 0
? GPIO_CNF_OUTPUT_PUSHPULL
: GPIO_CNF_OUTPUT_OPENDRAIN),
SRST_PIN);
/* Enable internal pull-up on PWR_BR so that we don't drive

View File

@ -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);
void assert_boot_pin(void);
void setup_vbus_irq(void);
void platform_srst_set_val(bool assert);