OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 Gurjant Kalsi <me@gurjantkalsi.com> | 2 * Copyright (c) 2015 Gurjant Kalsi <me@gurjantkalsi.com> |
3 * | 3 * |
4 * Permission is hereby granted, free of charge, to any person obtaining | 4 * Permission is hereby granted, free of charge, to any person obtaining |
5 * a copy of this software and associated documentation files | 5 * a copy of this software and associated documentation files |
6 * (the "Software"), to deal in the Software without restriction, | 6 * (the "Software"), to deal in the Software without restriction, |
7 * including without limitation the rights to use, copy, modify, merge, | 7 * including without limitation the rights to use, copy, modify, merge, |
8 * publish, distribute, sublicense, and/or sell copies of the Software, | 8 * publish, distribute, sublicense, and/or sell copies of the Software, |
9 * and to permit persons to whom the Software is furnished to do so, | 9 * and to permit persons to whom the Software is furnished to do so, |
10 * subject to the following conditions: | 10 * subject to the following conditions: |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 | 84 |
85 chip_select(true); | 85 chip_select(true); |
86 HAL_SPI_Transmit(&SpiHandle, clear, 2, HAL_MAX_DELAY); | 86 HAL_SPI_Transmit(&SpiHandle, clear, 2, HAL_MAX_DELAY); |
87 chip_select(false); | 87 chip_select(false); |
88 } | 88 } |
89 | 89 |
90 | 90 |
91 status_t memory_lcd_init(void) | 91 status_t memory_lcd_init(void) |
92 { | 92 { |
93 SpiHandle.Instance = SPI2; | 93 SpiHandle.Instance = SPI2; |
94 SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_4; | 94 SpiHandle.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_8; |
95 SpiHandle.Init.Direction = SPI_DIRECTION_1LINE; | 95 SpiHandle.Init.Direction = SPI_DIRECTION_1LINE; |
96 SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE; | 96 SpiHandle.Init.CLKPhase = SPI_PHASE_1EDGE; |
97 SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW; | 97 SpiHandle.Init.CLKPolarity = SPI_POLARITY_LOW; |
98 SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT; | 98 SpiHandle.Init.DataSize = SPI_DATASIZE_8BIT; |
99 SpiHandle.Init.FirstBit = SPI_FIRSTBIT_LSB; | 99 SpiHandle.Init.FirstBit = SPI_FIRSTBIT_LSB; |
100 SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE; | 100 SpiHandle.Init.TIMode = SPI_TIMODE_DISABLE; |
101 SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; | 101 SpiHandle.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; |
102 SpiHandle.Init.CRCPolynomial = 7; | 102 SpiHandle.Init.CRCPolynomial = 7; |
103 SpiHandle.Init.NSS = SPI_NSS_SOFT; | 103 SpiHandle.Init.NSS = SPI_NSS_SOFT; |
104 SpiHandle.Init.Mode = SPI_MODE_MASTER; | 104 SpiHandle.Init.Mode = SPI_MODE_MASTER; |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 { | 199 { |
200 DEBUG_ASSERT(info); | 200 DEBUG_ASSERT(info); |
201 LTRACEF("display_info %p\n", info); | 201 LTRACEF("display_info %p\n", info); |
202 | 202 |
203 info->format = MLCD_FORMAT; | 203 info->format = MLCD_FORMAT; |
204 info->width = MLCD_WIDTH; | 204 info->width = MLCD_WIDTH; |
205 info->height = MLCD_HEIGHT; | 205 info->height = MLCD_HEIGHT; |
206 | 206 |
207 return NO_ERROR; | 207 return NO_ERROR; |
208 } | 208 } |
OLD | NEW |