67 #include "stm32f10x_gpio.h"
68 #include "stm32f10x_spi.h"
79 GPIO_SetBits(GPIOB, GPIO_Pin_0);
80 GPIO_SetBits(GPIOB, GPIO_Pin_10);
81 GPIO_SetBits(GPIOB, GPIO_Pin_12);
82 GPIO_ResetBits(GPIOB, GPIO_Pin_11);
94 uint16_t u_fault_condition;
95 GPIO_ResetBits(GPIOB, GPIO_Pin_12);
96 SPI_I2S_SendData(SPI2, u_value);
98 while (SPI_I2S_GetFlagStatus(SPI2, SPI_I2S_FLAG_RXNE) == RESET);
99 u_fault_condition=SPI_I2S_ReceiveData(SPI2);
100 GPIO_SetBits(GPIOB, GPIO_Pin_12);
101 return u_fault_condition;