SHARE
TWEET

Untitled

a guest Jun 18th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* FMC initialization function */
  2. static void MX_FMC_Init(void)
  3. {
  4.   FMC_NORSRAM_TimingTypeDef Timing;
  5.  
  6.   /** Perform the SRAM1 memory initialization sequence
  7.   */
  8.   hsram1.Instance = FMC_NORSRAM_DEVICE;
  9.   hsram1.Extended = FMC_NORSRAM_EXTENDED_DEVICE;
  10.   /* hsram1.Init */
  11.   hsram1.Init.NSBank = FMC_NORSRAM_BANK1;
  12.   hsram1.Init.DataAddressMux = FMC_DATA_ADDRESS_MUX_DISABLE;
  13.   hsram1.Init.MemoryType = FMC_MEMORY_TYPE_SRAM;
  14.   hsram1.Init.MemoryDataWidth = FMC_NORSRAM_MEM_BUS_WIDTH_8;
  15.   hsram1.Init.BurstAccessMode = FMC_BURST_ACCESS_MODE_DISABLE;
  16.   hsram1.Init.WaitSignalPolarity = FMC_WAIT_SIGNAL_POLARITY_LOW;
  17.   hsram1.Init.WaitSignalActive = FMC_WAIT_TIMING_BEFORE_WS;
  18.   hsram1.Init.WriteOperation = FMC_WRITE_OPERATION_ENABLE;
  19.   hsram1.Init.WaitSignal = FMC_WAIT_SIGNAL_DISABLE;
  20.   hsram1.Init.ExtendedMode = FMC_EXTENDED_MODE_DISABLE;
  21.   hsram1.Init.AsynchronousWait = FMC_ASYNCHRONOUS_WAIT_DISABLE;
  22.   hsram1.Init.WriteBurst = FMC_WRITE_BURST_DISABLE;
  23.   hsram1.Init.ContinuousClock = FMC_CONTINUOUS_CLOCK_SYNC_ONLY;
  24.   hsram1.Init.WriteFifo = FMC_WRITE_FIFO_DISABLE;
  25.   hsram1.Init.PageSize = FMC_PAGE_SIZE_NONE;
  26.   /* Timing */
  27.   Timing.AddressSetupTime = 2;
  28.   Timing.AddressHoldTime = 0;
  29.   Timing.DataSetupTime = 4;
  30.   Timing.BusTurnAroundDuration = 0;
  31.   Timing.CLKDivision = 0;
  32.   Timing.DataLatency = 0;
  33.   Timing.AccessMode = FMC_ACCESS_MODE_A;
  34.   /* ExtTiming */
  35.  
  36.   if (HAL_SRAM_Init(&hsram1, &Timing, NULL) != HAL_OK)
  37.   {
  38.     Error_Handler( );
  39.   }
  40.  
  41. }
  42.      
  43. #define  LCD_BASE_Addr                  ((uint32_t * )(0x60000000))
  44. #define  LCD_BASE_Data               ((uint32_t *)(0x60000000|0x00000001))
  45.      
  46. void LCD_SendCommand(uint8_t  com){
  47.     *(__IO uint32_t*)(LCD_BASE_Addr) = com;
  48. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top