资源简介
ST官网的LSM303D驱动代码
代码片段和文件信息
/******************** (C) COPYRIGHT 2009 STMicroelectronics ********************
* File Name : main.c
* Author : MSH Application Team
* Author : andrea labombarda
* Revision : $Revision: 1.5 $
* Date : $Date: 2010/08/04 12:19:08 $
* Description : EKSTM32 main file
* HISTORY:
* Date | Modification | Author
* 16/06/2011 | Initial Revision | Fabio Tota
********************************************************************************
* THE PRESENT FIRMWARE WHICH IS FOR GUIDANCE ONLY AIMS AT PROVIDING CUSTOMERS
* WITH CODING INFORMATION REGARDING THEIR PRODUCTS IN ORDER FOR THEM TO SAVE TIME.
* AS A RESULT STMICROELECTRONICS SHALL NOT BE HELD LIABLE FOR ANY DIRECT
* INDIRECT OR CONSEQUENTIAL DAMAGES WITH RESPECT TO ANY CLAIMS ARISING FROM THE
* CONTENT OF SUCH FIRMWARE AND/OR THE USE MADE BY CUSTOMERS OF THE CODING
* INFORMATION CONTAINED HEREIN IN CONNECTION WITH THEIR PRODUCTS.
*
* THIS SOFTWARE IS SPECIFICALLY DESIGNED FOR EXCLUSIVE USE WITH ST PARTS.
*
*******************************************************************************/
/* Includes ------------------------------------------------------------------*/
#include “stm32f10x.h“
#include “usb_lib.h“
#include “usb_desc.h“
#include “hw_config.h“
#include “usb_pwr.h“
#include “led.h“
#include “button.h“
#include “adc_mems.h“
#include “string.h“
#include “spi_mems.h“
#include “lsm303dlhc_driver.h“
#include
/* Private typedef -----------------------------------------------------------*/
/* Private define ------------------------------------------------------------*/
/* Private macro -------------------------------------------------------------*/
/* Private variables ---------------------------------------------------------*/
uint8_t response;
uint8_t USBbuffer[64];
/* Extern variables ----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
//define for example1234
//#define __EXAMPLE1__H
//#define __EXAMPLE2__H
#define __EXAMPLE3__H
/*******************************************************************************
* Function Name : main.
* Description : Main routine.
* Input : None.
* Output : None.
* Return : None.
*******************************************************************************/
int main(void)
{
uint8_t buffer[26];
uint8_t position=0 old_position=0;
AccAxesRaw_t data;
MagAxesRaw_t dataM;
i16_t temperature=0;
InitHardware();
I2C_MEMS_Init();
EKSTM32_LEDOff(LED1);
EKSTM32_LEDOff(LED2);
EKSTM32_LEDOff(LED3);
//wait until the USB is ready
while(bDeviceState != CONFIGURED);
//set ODR_ACCELEROMETER (turn ON device)
response = SetO
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9641 2011-08-05 16:28 LSM303DLHC_driver.zip
文件 8715 2011-08-05 16:23 main.c
- 上一篇:vhdl电子秒表
- 下一篇:vrmlpad3.0注册码
评论
共有 条评论