1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-19 14:08:11 +00:00

trezorhal: minor fixes to sdcard/touch power on sequence

This commit is contained in:
Pavol Rusnak 2018-07-09 21:13:49 +02:00
parent 6ce106b544
commit 2b30cc16a2
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 17 additions and 2 deletions

View File

@ -89,6 +89,7 @@ void sdcard_init(void) {
GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStructure.Pin = GPIO_PIN_0; GPIO_InitStructure.Pin = GPIO_PIN_0;
HAL_GPIO_WritePin(GPIOC, GPIO_PIN_0, GPIO_PIN_SET);
HAL_GPIO_Init(GPIOC, &GPIO_InitStructure); HAL_GPIO_Init(GPIOC, &GPIO_InitStructure);
sdcard_default_pin_state(); sdcard_default_pin_state();

View File

@ -39,6 +39,20 @@
static I2C_HandleTypeDef i2c_handle; static I2C_HandleTypeDef i2c_handle;
static void touch_power_on(void)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET); // CTP_ON/PB10
HAL_Delay(50);
}
/*
static void touch_power_off(void)
{
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET); // CTP_ON/PB10
HAL_Delay(50);
}
*/
void touch_init(void) void touch_init(void)
{ {
GPIO_InitTypeDef GPIO_InitStructure; GPIO_InitTypeDef GPIO_InitStructure;
@ -48,10 +62,10 @@ void touch_init(void)
GPIO_InitStructure.Pull = GPIO_NOPULL; GPIO_InitStructure.Pull = GPIO_NOPULL;
GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH; GPIO_InitStructure.Speed = GPIO_SPEED_FREQ_VERY_HIGH;
GPIO_InitStructure.Pin = GPIO_PIN_10; GPIO_InitStructure.Pin = GPIO_PIN_10;
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_SET);
HAL_GPIO_Init(GPIOB, &GPIO_InitStructure); HAL_GPIO_Init(GPIOB, &GPIO_InitStructure);
HAL_GPIO_WritePin(GPIOB, GPIO_PIN_10, GPIO_PIN_RESET); // CTP_ON/PB10 touch_power_on();
HAL_Delay(50);
// Enable I2C clock // Enable I2C clock
__HAL_RCC_I2C1_CLK_ENABLE(); __HAL_RCC_I2C1_CLK_ENABLE();