テスト用のあれこれ共用フォルダ
Revision | a6b5e43ece6a2630c54a55b32257f2f4f4e11bee (tree) |
---|---|
Zeit | 2018-04-30 23:40:15 |
Autor | takemasa <suikan@user...> |
Commiter | takemasa |
Test for the SPI master.
@@ -51,6 +51,7 @@ void SysTick_Handler(void); | ||
51 | 51 | void DMA1_Stream1_IRQHandler(void); |
52 | 52 | void DMA1_Stream3_IRQHandler(void); |
53 | 53 | void EXTI9_5_IRQHandler(void); |
54 | +void SPI1_IRQHandler(void); | |
54 | 55 | void USART3_IRQHandler(void); |
55 | 56 | void EXTI15_10_IRQHandler(void); |
56 | 57 | void TIM8_TRG_COM_TIM14_IRQHandler(void); |
@@ -184,29 +184,41 @@ void SystemClock_Config(void) | ||
184 | 184 | */ |
185 | 185 | __HAL_RCC_PWR_CLK_ENABLE(); |
186 | 186 | |
187 | - __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE3); | |
187 | + __HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1); | |
188 | 188 | |
189 | 189 | /**Initializes the CPU, AHB and APB busses clocks |
190 | 190 | */ |
191 | 191 | RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; |
192 | 192 | RCC_OscInitStruct.HSIState = RCC_HSI_ON; |
193 | 193 | RCC_OscInitStruct.HSICalibrationValue = 16; |
194 | - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE; | |
194 | + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; | |
195 | + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; | |
196 | + RCC_OscInitStruct.PLL.PLLM = 8; | |
197 | + RCC_OscInitStruct.PLL.PLLN = 216; | |
198 | + RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2; | |
199 | + RCC_OscInitStruct.PLL.PLLQ = 2; | |
195 | 200 | if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) |
196 | 201 | { |
197 | 202 | _Error_Handler(__FILE__, __LINE__); |
198 | 203 | } |
199 | 204 | |
205 | + /**Activate the Over-Drive mode | |
206 | + */ | |
207 | + if (HAL_PWREx_EnableOverDrive() != HAL_OK) | |
208 | + { | |
209 | + _Error_Handler(__FILE__, __LINE__); | |
210 | + } | |
211 | + | |
200 | 212 | /**Initializes the CPU, AHB and APB busses clocks |
201 | 213 | */ |
202 | 214 | RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK |
203 | 215 | |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2; |
204 | - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_HSI; | |
216 | + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; | |
205 | 217 | RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; |
206 | - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2; | |
207 | - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; | |
218 | + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV4; | |
219 | + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV4; | |
208 | 220 | |
209 | - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) | |
221 | + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_7) != HAL_OK) | |
210 | 222 | { |
211 | 223 | _Error_Handler(__FILE__, __LINE__); |
212 | 224 | } |
@@ -238,17 +250,17 @@ static void MX_SPI1_Init(void) | ||
238 | 250 | hspi1.Instance = SPI1; |
239 | 251 | hspi1.Init.Mode = SPI_MODE_MASTER; |
240 | 252 | hspi1.Init.Direction = SPI_DIRECTION_2LINES; |
241 | - hspi1.Init.DataSize = SPI_DATASIZE_4BIT; | |
253 | + hspi1.Init.DataSize = SPI_DATASIZE_8BIT; | |
242 | 254 | hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; |
243 | 255 | hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; |
244 | 256 | hspi1.Init.NSS = SPI_NSS_SOFT; |
245 | - hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2; | |
257 | + hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_256; | |
246 | 258 | hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; |
247 | 259 | hspi1.Init.TIMode = SPI_TIMODE_DISABLE; |
248 | 260 | hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE; |
249 | 261 | hspi1.Init.CRCPolynomial = 7; |
250 | 262 | hspi1.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE; |
251 | - hspi1.Init.NSSPMode = SPI_NSS_PULSE_ENABLE; | |
263 | + hspi1.Init.NSSPMode = SPI_NSS_PULSE_DISABLE; | |
252 | 264 | if (HAL_SPI_Init(&hspi1) != HAL_OK) |
253 | 265 | { |
254 | 266 | _Error_Handler(__FILE__, __LINE__); |
@@ -44,48 +44,37 @@ void InitTestUart(UART_HandleTypeDef * uart_handle, SPI_HandleTypeDef * spi_hand | ||
44 | 44 | murasaki::platform.logger = new murasaki::UartLogger(murasaki::platform.uart_console); |
45 | 45 | |
46 | 46 | // Setting SPI slave devices. |
47 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoFallThenRise, | |
48 | - murasaki::ksphLatchThenShift, | |
49 | - SPI_CS1_GPIO_Port, | |
50 | - SPI_CS1_Pin); | |
51 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoFallThenRise, | |
52 | - murasaki::ksphShiftThenLatch, | |
53 | - SPI_CS2_GPIO_Port, | |
54 | - SPI_CS2_Pin); | |
55 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoRiseThenFall, | |
56 | - murasaki::ksphLatchThenShift, | |
57 | - SPI_CS3_GPIO_Port, | |
58 | - SPI_CS3_Pin); | |
59 | - murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier(murasaki::kspoRiseThenFall, | |
60 | - murasaki::ksphShiftThenLatch, | |
61 | - SPI_CS4_GPIO_Port, | |
62 | - SPI_CS4_Pin); | |
47 | + murasaki::platform.slave_1 = new murasaki::SpiSlaveSpecifier( | |
48 | + murasaki::kspoFallThenRise, | |
49 | + murasaki::ksphLatchThenShift, | |
50 | + SPI_CS4_GPIO_Port, | |
51 | + SPI_CS4_Pin); | |
52 | + | |
53 | + murasaki::platform.slave_2 = new murasaki::SpiSlaveSpecifier( | |
54 | + murasaki::kspoFallThenRise, | |
55 | + murasaki::ksphShiftThenLatch, | |
56 | + SPI_CS4_GPIO_Port, | |
57 | + SPI_CS4_Pin); | |
58 | + | |
59 | + murasaki::platform.slave_3 = new murasaki::SpiSlaveSpecifier( | |
60 | + murasaki::kspoRiseThenFall, | |
61 | + murasaki::ksphLatchThenShift, | |
62 | + SPI_CS4_GPIO_Port, | |
63 | + SPI_CS4_Pin); | |
64 | + | |
65 | + murasaki::platform.slave_4 = new murasaki::SpiSlaveSpecifier( | |
66 | + murasaki::kspoRiseThenFall, | |
67 | + murasaki::ksphShiftThenLatch, | |
68 | + SPI_CS4_GPIO_Port, | |
69 | + SPI_CS4_Pin); | |
70 | + | |
63 | 71 | // Setting SPI master |
64 | 72 | murasaki::platform.spi_master = new murasaki::SpiMaster(spi_handle); |
65 | 73 | |
66 | 74 | // Setting debugger |
67 | 75 | murasaki::debugger = new murasaki::Debugger(murasaki::platform.logger); |
68 | 76 | murasaki::debugger->AutoRePrint(); // type any key to show history. |
69 | -#if 0 | |
70 | - test_fifo = new murasaki::DebuggerFifo(32); | |
71 | - MURASAKI_ASSERT(test_fifo != nullptr); | |
72 | - | |
73 | - helpers.logger = murasaki::platform.logger; | |
74 | - helpers.fifo = test_fifo; | |
75 | - | |
76 | - tx_task = new murasaki::DebuggerTxTask("Debug_tx", // | |
77 | - PLATFORM_CONFIG_DEBUG_TASK_STACK_SIZE, // | |
78 | - PLATFORM_CONFIG_DEBUG_TASK_PRIORITY, // the bigger value is the higer priority | |
79 | - &helpers); | |
80 | - MURASAKI_ASSERT(tx_task != nullptr); | |
81 | 77 | |
82 | - tx_task->Start(); | |
83 | - | |
84 | - unsigned int copied = test_fifo->Put(reinterpret_cast<const uint8_t *>(MSG1), sizeof(MSG1)); | |
85 | - test_fifo->NotifyData(); | |
86 | - | |
87 | - murasaki::debugger->Printf("FIFO.Put(), %d data taransfered\n\r", copied); | |
88 | -#endif | |
89 | 78 | |
90 | 79 | } |
91 | 80 |
@@ -94,32 +83,15 @@ uint8_t tx_buffer[1] = { 0x55 }, rx_buffer[1]; | ||
94 | 83 | void DoTestUart(void) |
95 | 84 | { |
96 | 85 | // MURASAKI_ASSERT(counter % 2 == 0, "Odd counter"); |
97 | -#if 0 | |
98 | - unsigned int copied = test_fifo->Put(reinterpret_cast<const uint8_t *>(MSG1), sizeof(MSG1)); | |
99 | - test_fifo->NotifyData(); | |
100 | - murasaki::debugger->Printf("FIFO.Put(), %d data taransfered\n\r", copied); | |
101 | -#endif | |
102 | 86 | |
103 | -#if 0 | |
104 | - murasaki::platform.spi_master->Transfer(murasaki::platform.slave_1, tx_buffer, rx_buffer, 1); | |
87 | +#if 1 | |
88 | + murasaki::platform.spi_master->TransmitAndReceive( | |
89 | + murasaki::platform.slave_4, tx_buffer, rx_buffer, 1); | |
105 | 90 | #endif |
106 | 91 | |
107 | -#if 0 | |
108 | - char data[10]; | |
109 | - unsigned int copied = test_fifo->Get(reinterpret_cast<uint8_t *>(data), sizeof(data)); | |
110 | - if (copied == 0) | |
111 | - { | |
112 | - murasaki::debugger->Printf("FIFO.Get(), %d data taransfered \n\r", copied); | |
113 | -// test_fifo->ReWind(); | |
114 | - test_fifo->NotifyData(); | |
115 | - } | |
116 | - else { | |
117 | - murasaki::debugger->Printf("FIFO.Get(), %d data taransfered : '%10s'\n\r", copied, data); | |
118 | - } | |
119 | -#endif | |
120 | 92 | // by murasaki debugging output. You can use this in both task and interrupt context. |
121 | 93 | // non blocking |
122 | - murasaki::debugger->Printf(MSG, counter); | |
94 | + murasaki::debugger->Printf(MSG, counter++); | |
123 | 95 | |
124 | 96 | } |
125 | 97 |
@@ -154,6 +154,9 @@ void HAL_SPI_MspInit(SPI_HandleTypeDef* hspi) | ||
154 | 154 | |
155 | 155 | __HAL_LINKDMA(hspi,hdmarx,hdma_spi1_rx); |
156 | 156 | |
157 | + /* SPI1 interrupt Init */ | |
158 | + HAL_NVIC_SetPriority(SPI1_IRQn, 5, 0); | |
159 | + HAL_NVIC_EnableIRQ(SPI1_IRQn); | |
157 | 160 | /* USER CODE BEGIN SPI1_MspInit 1 */ |
158 | 161 | |
159 | 162 | /* USER CODE END SPI1_MspInit 1 */ |
@@ -182,6 +185,9 @@ void HAL_SPI_MspDeInit(SPI_HandleTypeDef* hspi) | ||
182 | 185 | /* SPI1 DMA DeInit */ |
183 | 186 | HAL_DMA_DeInit(hspi->hdmatx); |
184 | 187 | HAL_DMA_DeInit(hspi->hdmarx); |
188 | + | |
189 | + /* SPI1 interrupt DeInit */ | |
190 | + HAL_NVIC_DisableIRQ(SPI1_IRQn); | |
185 | 191 | /* USER CODE BEGIN SPI1_MspDeInit 1 */ |
186 | 192 | |
187 | 193 | /* USER CODE END SPI1_MspDeInit 1 */ |
@@ -43,6 +43,7 @@ | ||
43 | 43 | /* External variables --------------------------------------------------------*/ |
44 | 44 | extern DMA_HandleTypeDef hdma_spi1_tx; |
45 | 45 | extern DMA_HandleTypeDef hdma_spi1_rx; |
46 | +extern SPI_HandleTypeDef hspi1; | |
46 | 47 | extern DMA_HandleTypeDef hdma_usart3_tx; |
47 | 48 | extern DMA_HandleTypeDef hdma_usart3_rx; |
48 | 49 | extern UART_HandleTypeDef huart3; |
@@ -117,6 +118,20 @@ void EXTI9_5_IRQHandler(void) | ||
117 | 118 | } |
118 | 119 | |
119 | 120 | /** |
121 | +* @brief This function handles SPI1 global interrupt. | |
122 | +*/ | |
123 | +void SPI1_IRQHandler(void) | |
124 | +{ | |
125 | + /* USER CODE BEGIN SPI1_IRQn 0 */ | |
126 | + | |
127 | + /* USER CODE END SPI1_IRQn 0 */ | |
128 | + HAL_SPI_IRQHandler(&hspi1); | |
129 | + /* USER CODE BEGIN SPI1_IRQn 1 */ | |
130 | + | |
131 | + /* USER CODE END SPI1_IRQn 1 */ | |
132 | +} | |
133 | + | |
134 | +/** | |
120 | 135 | * @brief This function handles USART3 global interrupt. |
121 | 136 | */ |
122 | 137 | void USART3_IRQHandler(void) |
@@ -122,6 +122,7 @@ NVIC.MemoryManagement_IRQn=true\:0\:0\:false\:false\:false\:false\:true | ||
122 | 122 | NVIC.NonMaskableInt_IRQn=true\:0\:0\:false\:false\:false\:false\:true |
123 | 123 | NVIC.PendSV_IRQn=true\:15\:0\:false\:false\:false\:true\:true |
124 | 124 | NVIC.PriorityGroup=NVIC_PRIORITYGROUP_4 |
125 | +NVIC.SPI1_IRQn=true\:5\:0\:false\:false\:true\:true\:true | |
125 | 126 | NVIC.SVCall_IRQn=true\:0\:0\:false\:false\:false\:false\:true |
126 | 127 | NVIC.SysTick_IRQn=true\:15\:0\:false\:false\:true\:true\:true |
127 | 128 | NVIC.TIM8_TRG_COM_TIM14_IRQn=true\:0\:0\:false\:false\:true\:false\:false |
@@ -300,56 +301,60 @@ ProjectManager.functionlistsort=1-MX_GPIO_Init-GPIO-false-HAL,2-MX_DMA_Init-DMA- | ||
300 | 301 | RCC.48MHZClocksFreq_Value=24000000 |
301 | 302 | RCC.ADC12outputFreq_Value=72000000 |
302 | 303 | RCC.ADC34outputFreq_Value=72000000 |
303 | -RCC.AHBFreq_Value=16000000 | |
304 | -RCC.APB1CLKDivider=RCC_HCLK_DIV2 | |
305 | -RCC.APB1Freq_Value=8000000 | |
306 | -RCC.APB1TimFreq_Value=16000000 | |
307 | -RCC.APB2Freq_Value=16000000 | |
308 | -RCC.APB2TimFreq_Value=16000000 | |
304 | +RCC.AHBFreq_Value=216000000 | |
305 | +RCC.APB1CLKDivider=RCC_HCLK_DIV4 | |
306 | +RCC.APB1Freq_Value=54000000 | |
307 | +RCC.APB1TimFreq_Value=108000000 | |
308 | +RCC.APB2CLKDivider=RCC_HCLK_DIV4 | |
309 | +RCC.APB2Freq_Value=54000000 | |
310 | +RCC.APB2TimFreq_Value=108000000 | |
309 | 311 | RCC.CECFreq_Value=32786.88524590164 |
310 | -RCC.CortexFreq_Value=16000000 | |
311 | -RCC.EthernetFreq_Value=16000000 | |
312 | -RCC.FCLKCortexFreq_Value=16000000 | |
312 | +RCC.CortexFreq_Value=216000000 | |
313 | +RCC.EthernetFreq_Value=216000000 | |
314 | +RCC.FCLKCortexFreq_Value=216000000 | |
313 | 315 | RCC.FamilyName=M |
314 | -RCC.HCLKFreq_Value=16000000 | |
316 | +RCC.HCLKFreq_Value=216000000 | |
315 | 317 | RCC.HSE_VALUE=8000000 |
316 | 318 | RCC.HSI_VALUE=16000000 |
317 | -RCC.I2C1Freq_Value=8000000 | |
318 | -RCC.I2C2Freq_Value=8000000 | |
319 | -RCC.I2C3Freq_Value=8000000 | |
320 | -RCC.I2C4Freq_Value=8000000 | |
319 | +RCC.I2C1Freq_Value=54000000 | |
320 | +RCC.I2C2Freq_Value=54000000 | |
321 | +RCC.I2C3Freq_Value=54000000 | |
322 | +RCC.I2C4Freq_Value=54000000 | |
321 | 323 | RCC.I2SClocksFreq_Value=48000000 |
322 | -RCC.I2SFreq_Value=96000000 | |
323 | -RCC.IPParameters=48MHZClocksFreq_Value,ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2Freq_Value,APB2TimFreq_Value,CECFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2C4Freq_Value,I2SClocksFreq_Value,I2SFreq_Value,LCDTFToutputFreq_Value,LPTIM1Freq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SRoutputFreq_Value,PLLMCOFreq_Value,PLLMUL,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLSAIPCLKFreq_Value,PLLSAIQCLKFreq_Value,PLLSAIRCLKFreq_Value,PLLSAIoutputFreq_Value,PRESCALERUSB,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SYSCLKFreq_VALUE,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,UART7Freq_Value,UART8Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USART6Freq_Value,USBFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutput2Freq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VcooutputI2S,WatchDogFreq_Value | |
324 | -RCC.LCDTFToutputFreq_Value=48000000 | |
325 | -RCC.LPTIM1Freq_Value=8000000 | |
324 | +RCC.I2SFreq_Value=192000000 | |
325 | +RCC.IPParameters=48MHZClocksFreq_Value,ADC12outputFreq_Value,ADC34outputFreq_Value,AHBFreq_Value,APB1CLKDivider,APB1Freq_Value,APB1TimFreq_Value,APB2CLKDivider,APB2Freq_Value,APB2TimFreq_Value,CECFreq_Value,CortexFreq_Value,EthernetFreq_Value,FCLKCortexFreq_Value,FamilyName,HCLKFreq_Value,HSE_VALUE,HSI_VALUE,I2C1Freq_Value,I2C2Freq_Value,I2C3Freq_Value,I2C4Freq_Value,I2SClocksFreq_Value,I2SFreq_Value,LCDTFToutputFreq_Value,LPTIM1Freq_Value,LSE_VALUE,LSI_VALUE,MCO1PinFreq_Value,MCO2PinFreq_Value,MCOFreq_Value,PLLCLKFreq_Value,PLLI2SPCLKFreq_Value,PLLI2SQCLKFreq_Value,PLLI2SRCLKFreq_Value,PLLI2SRoutputFreq_Value,PLLM,PLLMCOFreq_Value,PLLMUL,PLLN,PLLQCLKFreq_Value,PLLQoutputFreq_Value,PLLSAIPCLKFreq_Value,PLLSAIQCLKFreq_Value,PLLSAIRCLKFreq_Value,PLLSAIoutputFreq_Value,PRESCALERUSB,RNGFreq_Value,RTCFreq_Value,RTCHSEDivFreq_Value,SAI1Freq_Value,SAI2Freq_Value,SDMMCFreq_Value,SPDIFRXFreq_Value,SYSCLKFreq_VALUE,SYSCLKSource,SYSCLKSourceVirtual,TIM15Freq_Value,TIM16Freq_Value,TIM17Freq_Value,TIM1Freq_Value,TIM20Freq_Value,TIM2Freq_Value,TIM3Freq_Value,TIM8Freq_Value,UART4Freq_Value,UART5Freq_Value,UART7Freq_Value,UART8Freq_Value,USART1Freq_Value,USART2Freq_Value,USART3Freq_Value,USART6Freq_Value,USBFreq_Value,VCOI2SOutputFreq_Value,VCOInputFreq_Value,VCOOutput2Freq_Value,VCOOutputFreq_Value,VCOSAIOutputFreq_Value,VcooutputI2S,WatchDogFreq_Value | |
326 | +RCC.LCDTFToutputFreq_Value=96000000 | |
327 | +RCC.LPTIM1Freq_Value=54000000 | |
326 | 328 | RCC.LSE_VALUE=32768 |
327 | 329 | RCC.LSI_VALUE=32000 |
328 | 330 | RCC.MCO1PinFreq_Value=16000000 |
329 | -RCC.MCO2PinFreq_Value=16000000 | |
331 | +RCC.MCO2PinFreq_Value=216000000 | |
330 | 332 | RCC.MCOFreq_Value=72000000 |
331 | -RCC.PLLCLKFreq_Value=96000000 | |
332 | -RCC.PLLI2SPCLKFreq_Value=96000000 | |
333 | -RCC.PLLI2SQCLKFreq_Value=96000000 | |
334 | -RCC.PLLI2SRCLKFreq_Value=96000000 | |
335 | -RCC.PLLI2SRoutputFreq_Value=96000000 | |
333 | +RCC.PLLCLKFreq_Value=216000000 | |
334 | +RCC.PLLI2SPCLKFreq_Value=192000000 | |
335 | +RCC.PLLI2SQCLKFreq_Value=192000000 | |
336 | +RCC.PLLI2SRCLKFreq_Value=192000000 | |
337 | +RCC.PLLI2SRoutputFreq_Value=192000000 | |
338 | +RCC.PLLM=8 | |
336 | 339 | RCC.PLLMCOFreq_Value=72000000 |
337 | 340 | RCC.PLLMUL=RCC_PLL_MUL9 |
338 | -RCC.PLLQCLKFreq_Value=96000000 | |
339 | -RCC.PLLQoutputFreq_Value=96000000 | |
340 | -RCC.PLLSAIPCLKFreq_Value=96000000 | |
341 | -RCC.PLLSAIQCLKFreq_Value=96000000 | |
342 | -RCC.PLLSAIRCLKFreq_Value=96000000 | |
343 | -RCC.PLLSAIoutputFreq_Value=96000000 | |
341 | +RCC.PLLN=216 | |
342 | +RCC.PLLQCLKFreq_Value=216000000 | |
343 | +RCC.PLLQoutputFreq_Value=216000000 | |
344 | +RCC.PLLSAIPCLKFreq_Value=192000000 | |
345 | +RCC.PLLSAIQCLKFreq_Value=192000000 | |
346 | +RCC.PLLSAIRCLKFreq_Value=192000000 | |
347 | +RCC.PLLSAIoutputFreq_Value=192000000 | |
344 | 348 | RCC.PRESCALERUSB=RCC_USBCLKSOURCE_PLL_DIV1_5 |
345 | -RCC.RNGFreq_Value=96000000 | |
349 | +RCC.RNGFreq_Value=216000000 | |
346 | 350 | RCC.RTCFreq_Value=32000 |
347 | 351 | RCC.RTCHSEDivFreq_Value=4000000 |
348 | -RCC.SAI1Freq_Value=96000000 | |
349 | -RCC.SAI2Freq_Value=96000000 | |
350 | -RCC.SDMMCFreq_Value=16000000 | |
351 | -RCC.SPDIFRXFreq_Value=96000000 | |
352 | -RCC.SYSCLKFreq_VALUE=16000000 | |
352 | +RCC.SAI1Freq_Value=192000000 | |
353 | +RCC.SAI2Freq_Value=192000000 | |
354 | +RCC.SDMMCFreq_Value=216000000 | |
355 | +RCC.SPDIFRXFreq_Value=192000000 | |
356 | +RCC.SYSCLKFreq_VALUE=216000000 | |
357 | +RCC.SYSCLKSource=RCC_SYSCLKSOURCE_PLLCLK | |
353 | 358 | RCC.SYSCLKSourceVirtual=RCC_SYSCLKSOURCE_PLLCLK |
354 | 359 | RCC.TIM15Freq_Value=72000000 |
355 | 360 | RCC.TIM16Freq_Value=72000000 |
@@ -359,30 +364,33 @@ RCC.TIM20Freq_Value=72000000 | ||
359 | 364 | RCC.TIM2Freq_Value=72000000 |
360 | 365 | RCC.TIM3Freq_Value=72000000 |
361 | 366 | RCC.TIM8Freq_Value=72000000 |
362 | -RCC.UART4Freq_Value=8000000 | |
363 | -RCC.UART5Freq_Value=8000000 | |
364 | -RCC.UART7Freq_Value=8000000 | |
365 | -RCC.UART8Freq_Value=8000000 | |
366 | -RCC.USART1Freq_Value=16000000 | |
367 | -RCC.USART2Freq_Value=8000000 | |
368 | -RCC.USART3Freq_Value=8000000 | |
369 | -RCC.USART6Freq_Value=16000000 | |
370 | -RCC.USBFreq_Value=96000000 | |
371 | -RCC.VCOI2SOutputFreq_Value=192000000 | |
372 | -RCC.VCOInputFreq_Value=1000000 | |
367 | +RCC.UART4Freq_Value=54000000 | |
368 | +RCC.UART5Freq_Value=54000000 | |
369 | +RCC.UART7Freq_Value=54000000 | |
370 | +RCC.UART8Freq_Value=54000000 | |
371 | +RCC.USART1Freq_Value=54000000 | |
372 | +RCC.USART2Freq_Value=54000000 | |
373 | +RCC.USART3Freq_Value=54000000 | |
374 | +RCC.USART6Freq_Value=54000000 | |
375 | +RCC.USBFreq_Value=216000000 | |
376 | +RCC.VCOI2SOutputFreq_Value=384000000 | |
377 | +RCC.VCOInputFreq_Value=2000000 | |
373 | 378 | RCC.VCOOutput2Freq_Value=8000000 |
374 | -RCC.VCOOutputFreq_Value=192000000 | |
375 | -RCC.VCOSAIOutputFreq_Value=192000000 | |
379 | +RCC.VCOOutputFreq_Value=432000000 | |
380 | +RCC.VCOSAIOutputFreq_Value=384000000 | |
376 | 381 | RCC.VcooutputI2S=48000000 |
377 | 382 | RCC.WatchDogFreq_Value=32000 |
378 | 383 | SH.GPXTI13.0=GPIO_EXTI13 |
379 | 384 | SH.GPXTI13.ConfNb=1 |
380 | 385 | SH.GPXTI5.0=GPIO_EXTI5 |
381 | 386 | SH.GPXTI5.ConfNb=1 |
382 | -SPI1.CalculateBaudRate=8.0 MBits/s | |
387 | +SPI1.BaudRatePrescaler=SPI_BAUDRATEPRESCALER_256 | |
388 | +SPI1.CalculateBaudRate=210.937 KBits/s | |
389 | +SPI1.DataSize=SPI_DATASIZE_8BIT | |
383 | 390 | SPI1.Direction=SPI_DIRECTION_2LINES |
384 | -SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate | |
391 | +SPI1.IPParameters=VirtualType,Mode,Direction,CalculateBaudRate,DataSize,BaudRatePrescaler,NSSPMode | |
385 | 392 | SPI1.Mode=SPI_MODE_MASTER |
393 | +SPI1.NSSPMode=SPI_NSS_PULSE_DISABLE | |
386 | 394 | SPI1.VirtualType=VM_MASTER |
387 | 395 | USART3.IPParameters=VirtualMode-Asynchronous,WordLength |
388 | 396 | USART3.VirtualMode-Asynchronous=VM_ASYNC |
@@ -80,6 +80,7 @@ bool SpiMaster::TransmitAndReceive(murasaki::AbstractSpiSlaveSpecifier* spi_spec | ||
80 | 80 | |
81 | 81 | // wait for the completion |
82 | 82 | result = sync_->Wait(timeout_ms); // return false if timeout |
83 | + | |
83 | 84 | } |
84 | 85 | // Dessert the chip select for slave |
85 | 86 | spi_spec->DeassertCs(); |