Files @ 47fdd16b7231
Branch filter:

Location: protofuse-firmware/src/gpio.c

NEO
Ethan got the screen working. OMG YAY!
//
// GPIO: configure general-purpose inputs/outputs
//

#include "stm32f3xx_hal.h"

#include "gpio.h"


// Initialize GPIOs
void gpio_init(void)
{
	GPIO_InitTypeDef GPIO_InitStruct;

	// GPIO Ports Clock Enable
	__GPIOA_CLK_ENABLE();
	__GPIOB_CLK_ENABLE();
	__GPIOF_CLK_ENABLE();


	// Configure LED GPIO pins
	GPIO_InitStruct.Pin = LED_RED_Pin;
	GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_InitStruct.Pull = GPIO_NOPULL;
	GPIO_InitStruct.Speed = GPIO_SPEED_LOW;
	HAL_GPIO_Init(LED_RED_GPIO_Port, &GPIO_InitStruct);

	// Configure Gate Drive GPIO pins
	GPIO_InitStruct.Pin = GATE_DRIVE_Pin;
	GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
	GPIO_InitStruct.Pull = GPIO_NOPULL;
	GPIO_InitStruct.Speed = GPIO_SPEED_HIGH;
	HAL_GPIO_Init(GATE_DRIVE_GPIO_Port, &GPIO_InitStruct);

	// Define startup State
	HAL_GPIO_WritePin(LED_RED, 1);
	HAL_GPIO_WritePin(GATE_DRIVE, 1);

}