资 源 简 介
lsm6dsl基于stm32f407的开发,详细代码,
/* Includes ------------------------------------------------------------------*/
#include "lsm6dsl.h"
#include "spi.h"
#include "usart.h"
#include "delay.h"
#include
//³õʼ»¯LSM6DSLµÄIO¿Ú
void LSM6DSL_Init(void)
{
uint8_t Device_ID;
GPIO_InitTypeDef GPIO_InitStructure;
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOG, ENABLE);//ʹÄÜGPIOGʱÖÓ
//GPIOI7ÍÆÍìÊä³ö
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;//ÆÕͨÊä³öģʽ
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;//ÍÆÍìÊä³ö
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;//100MHz
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
GPIO_Init(GPIOG, &GPIO_InitStructure);//³õʼ»¯PG7
LSM6DSL_SPI_Init();