/**
* 配置用于操作ADC124S21的模拟SPI GPIO端口
*/
static void U11ADC124S021_GPIO_init()
{
SPI_InitTypeDef SPI_InitStructure; //定义SPI结构体
GPIO_InitTypeDef GPIO_InitStructure; //定义GPIO结构体
//使能SPI1时钟、GPIOA及GPIOC口时钟、引脚复用功能时钟
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA|
RCC_APB2Periph_GPIOC |
RCC_APB2Periph_AFIO |
RCC_APB2Periph_SPI1,
ENABLE);
/* 配置SPI引脚:NSS,SCK,MISO and MOSI */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;//复用推挽输出
GPIO_Init(GPIOA, &GPIO_InitStructure);
/* 配置PA4为推挽输出,作为MAX5415片选引脚 */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_4;