完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
define MAX6675_CS_Pin GPIO_PIN_12
define MAX6675_CS_GPIO_Port GPIOB SPI_HandleTypeDef hspi2;/ USER CODE BEGIN Includes / / USER CODE END Includes / / Private typedef -----------------------------------------------------------// USER CODE BEGIN TD / / USER CODE END TD / / Private define ------------------------------------------------------------// USER CODE BEGIN Define / / USER CODE END Define / / Private macro -------------------------------------------------------------// USER CODE BEGIN Macro / / USER CODE END Macro / / Private variables ---------------------------------------------------------// USER CODE BEGIN PV / / USER CODE END PV / / Private function prototypes -----------------------------------------------// USER CODE BEGIN PFP / / USER CODE END PFP / / External functions --------------------------------------------------------// USER CODE BEGIN ExternalFunctions / / USER CODE END ExternalFunctions / / USER CODE BEGIN 0 //**
/ USER CODE END SPI2_Init 0 / / USER CODE BEGIN SPI2_Init 1 / / USER CODE END SPI2_Init 1 // SPI2 parameter configuration/hspi2.Instance = SPI2;hspi2.Init.Mode = SPI_MODE_MASTER;hspi2.Init.Direction = SPI_DIRECTION_2LINES;hspi2.Init.DataSize = SPI_DATASIZE_8BIT;hspi2.Init.CLKPolarity = SPI_POLARITY_LOW;hspi2.Init.CLKPhase = SPI_PHASE_1EDGE;hspi2.Init.NSS = SPI_NSS_SOFT;hspi2.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_2;hspi2.Init.FirstBit = SPI_FIRSTBIT_MSB;hspi2.Init.TIMode = SPI_TIMODE_DISABLE;hspi2.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLE;hspi2.Init.CRCPolynomial = 7;hspi2.Init.CRCLength = SPI_CRC_LENGTH_DATASIZE;hspi2.Init.NSSPMode = SPI_NSS_PULSE_ENABLE;if (HAL_SPI_Init( hspi2) != HAL_OK){Error_Handler();}}/ USER CODE END 0 /void HAL_MspInit(void){/ USER CODE BEGIN MspInit 0 / / USER CODE END MspInit 0 / HAL_RCC_SYSCFG_CLK_ENABLE();HAL_RCC_PWR_CLK_ENABLE(); / System interrupt init/ / USER CODE BEGIN MspInit 1 / / USER CODE END MspInit 1 /} /**
/**
/ USER CODE BEGIN 1 / //MAX6675 片选引脚初始化void GPIO_Init(void){GPIO_InitTypeDef GPIO_InitStruct = {0}; / GPIO Ports Clock Enable /__HAL_RCC_GPIOB_CLK_ENABLE(); HAL_GPIO_WritePin(GPIOB, MAX6675_CS_Pin, GPIO_PIN_SET);/引脚配置 /GPIO_InitStruct.Pin = MAX6675_CS_Pin;GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;GPIO_InitStruct.Pull = GPIO_NOPULL;GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;HAL_GPIO_Init(GPIOB, GPIO_InitStruct);} /**
/**
|
|
相关推荐 |
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2725 浏览 1 评论
3237 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1807 浏览 1 评论
3646 浏览 6 评论
6034 浏览 21 评论
1337浏览 4评论
197浏览 3评论
对H747I-DISCO写程序时将CN2的st-link复用为usart1,再次烧录时无法检测到stlink怎么解决?
350浏览 2评论
STM32G474RE芯片只是串口发个数据就发烫严重是怎么回事?
442浏览 2评论
STM32处理增量式编码器Z信号如何判断中断是正转的还是反向转的?
273浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-22 19:43 , Processed in 1.141968 second(s), Total 74, Slave 57 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号