Home » Source Code » MPU6050 (hardware IIC) » stm32f10x_can.h

stm32f10x_can.h ( File view )

  • By 昱晨 2015-04-27
  • View(s):8
  • Download(s):2
  • Point(s): 0
			/**
  ******************************************************************************
  * @file    stm32f10x_can.h
  * @author  MCD Application Team
  * @version V3.5.0
  * @date    11-March-2011
  * @brief   This file contains all the functions prototypes for the CAN firmware 
  *          library.
  ******************************************************************************
  * @attention
  *
  * 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.
  *
  * <h2><center>&copy; COPYRIGHT 2011 STMicroelectronics</center></h2>
  ******************************************************************************
  */

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __STM32F10x_CAN_H
#define __STM32F10x_CAN_H

#ifdef __cplusplus
 extern "C" {

#endif

/* Includes ------------------------------------------------------------------*/
#include "stm32f10x.h"

/** @addtogroup STM32F10x_StdPeriph_Driver
  * @{

  */

/** @addtogroup CAN
  * @{

  */

/** @defgroup CAN_Exported_Types
  * @{

  */

#define IS_CAN_ALL_PERIPH(PERIPH) (((PERIPH) == CAN1) || \
                                   ((PERIPH) == CAN2))

/** 
  * @brief  CAN init structure definition
  */

typedef struct
{

  uint16_t CAN_Prescaler;   /*!< Specifies the length of a time quantum. 
                                 It ranges from 1 to 1024. */
  
  uint8_t CAN_Mode;         /*!< Specifies the CAN operating mode.
                                 This parameter can be a value of 
                                @ref CAN_operating_mode */

  uint8_t CAN_SJW;          /*!< Specifies the maximum number of time quanta 
                                 the CAN hardware is allowed to lengthen or 
                                 shorten a bit to perform resynchronization.
                                 This parameter can be a value of 
                                 @ref CAN_synchronisation_jump_width */

  uint8_t CAN_BS1;          /*!< Specifies the number of time quanta in Bit 
                                 Segment 1. This parameter can be a value of 
                                 @ref CAN_time_quantum_in_bit_segment_1 */

  uint8_t CAN_BS2;          /*!< Specifies the number of time quanta in Bit 
                                 Segment 2.
                                 This parameter can be a value of 
                                 @ref CAN_time_quantum_in_bit_segment_2 */
  
  FunctionalState CAN_TTCM; /*!< Enable or disable the time triggered 
                                 communication mode. This parameter can be set 
                                 either to ENABLE or DISABLE. */
  
  FunctionalState CAN_ABOM;  /*!< Enable or disable the automatic bus-off 
                                  management. This parameter can be set either 
                                  to ENABLE or DISABLE. */

  FunctionalState CAN_AWUM;  /*!< Enable or disable the automatic wake-up mode. 
                                  This parameter can be set either to ENABLE or 
                                  DISABLE. */

  FunctionalState CAN_NART;  /*!< Enable or disable the no-automatic 
                                  retransmission mode. This parameter can be 
                                  set either to ENABLE or DISABLE. */

  FunctionalState CAN_RFLM;  /*!< Enable or disable the Receive FIFO Locked mode.
                                  This parameter can be set either to ENABLE 
                                  or DISABLE. */

  FunctionalState CAN_TXFP;  /*!< Enable or disable the transmit FIFO priority.
                                  This parameter can be set either to ENABLE 
                                  or DISABLE. */

} CAN_InitTypeDef;

/** 
  * @brief  CAN filter init structure definition
  */

typedef struct
{

  uint16_t CAN_FilterIdHigh;         /*!< Specifies the filter identification number (MSBs for a 32-bit
                                              configuration, first one for a 16-bit configuration).
                                              This parameter can be a value between 0x0000 and 0xFFFF */

  uint16_t CAN_FilterIdLow;          /*!< Specifies the filter identification number (LSBs for a 32-bit
                                              configuration, second one for a 16-bit configuration).
                                              This parameter can be a value between 0x0000 and 0xFFFF */

  uint16_t CAN_FilterMaskIdHigh;     /*!< Specifies the filter mask number or identification number,
                                              according to the mode (MSBs for a 32-bit configuration,
                                              first one for a 16-bit configuration).
                                              This parameter can be a value between 0x0000 and 0xFFFF */

  uint16_t CAN_FilterMaskIdLow;      /*!< Specifies the filter mask number or identification number,
                                              according to the mode (LSBs for a 32-bit configuration,
                                              second one for a 16-bit configuration).
                                              This parameter can be a value between 0x0000 and 0xFFFF */

  uint16_t CAN_FilterFIFOAssignment; /*!< Specifies the FIFO (0 or 1) which will be assigned to the filter.
                                              This parameter can be a value of @ref CAN_filter_FIFO */
  
  uint8_t CAN_FilterNumber;          /*!< Specifies the filter which will be initialized. It ranges from 0 to 13. */

  uint8_t CAN_FilterMode;            /*!< Specifies the filter mode to be initialized.
                                              This parameter can be a value of @ref CAN_filter_mode */

  uint8_t CAN_FilterScale;           /*!< Specifies the filter scale.
                                              This parameter can be a value of @ref CAN_filter_scale */

  FunctionalState CAN_FilterActivation; /*!< Enable or disable the filter.
                                              This parameter can be set either to ENABLE or DISABLE. */

} CAN_FilterInitTypeDef;

/** 
  * @brief  CAN Tx message structure definition  
  */

typedef struct
{

  uint32_t StdId;  /*!< Specifies the standard identifier.
                        This parameter can be a value between 0 to 0x7FF. */

  uint32_t ExtId;  /*!< Specifies the extended identifier.
                        This parameter can be a value between 0 to 0x1FFFFFFF. */

  uint8_t IDE;     /*!< Specifies the type of identifier for the message that 
                        will be transmitted. This parameter can be a value 
                        of @ref CAN_identifier_type */

  uint8_t RTR;     /*!< Specifies the type of frame for the message that will 
                        be transmitted. This parameter can be a value of 
                        @ref CAN_remote_transmission_request */

  uint8_t DLC;     /*!< Specifies the length of the frame that will be 
                        transmitted. This parameter can be a value between 
                        0 to 8 */

  uint8_t Data[8]; /*!< Contains the data to be transmitted. It ranges from 0 
                        to 0xFF. */

} CanTxMsg;

/** 
  * @brief  CAN Rx message structure definition  
  */

typedef struct
{

  uint32_t StdId;  /*!< Specifies the standard identifier.
                        This parameter can be a value between 0 to 0x7FF. */

  uint32_t ExtId;  /*!< Specifies the extended identifier.
                        This parameter can be a value between 0 to 0x1FFFFFFF. */

  uint8_t IDE;     /*!< Specifies the type of identifier for the message that 
                        will be received. This parameter can be a value of 
                        @ref CAN_identifier_type */

  uint8_t RTR;     /*!< Specifies the type of frame for the received message.
                        This parameter can be a value of 
                        @ref CAN_remote_transmission_request */

  uint8_t DLC;     /*!< Specifies the length of the frame that will be received.
                        This parameter can be a value between 0 to 8 */

  uint8_t Data[8]; /*!< Contains the data to be received. It ranges from 0 to 
                        0xFF. */

  uint8_t FMI;     /*!< Specifies the index of the filter the message stored in 
                        the mailbox passes through. This parameter can be a 
                        value between 0 to 0xFF */

} CanRxMsg;

/**
  * @
}
  */

/** @defgroup CAN_Exported_Constants
  * @{

  */

/** @defgroup CAN_sleep_constants 
  * @{

  */

#define CAN_InitStatus_Failed              ((uint8_t)0x00) /*!< CAN initialization failed */
#define CAN_InitStatus_Success             ((uint8_t)0x01) /*!< CAN initialization OK */

/**
  * @
}
  */

/** @defgroup CAN_Mode 
  * @{

  */

#define CAN_Mode_Normal             ((uint8_t)0x00)  /*!< normal mode */
#define CAN_Mode_LoopBack           ((uint8_t)0x01)  /*!< loopback mode */
#define CAN_Mode_Silent             ((uint8_t)0x02)  /*!< silent mode */
#define CAN_Mode_Silent_LoopBack    ((uint8_t)0x03)  /*!< loopback combined with silent mode */

#define IS_CAN_MODE(MODE) (((MODE) == CAN_Mode_Normal) || \
                           ((MODE) == CAN_Mode_LoopBack)|| \
                           ((MODE) == CAN_Mode_Silent) || \
                           ((MODE) == CAN_Mode_Silent_LoopBack))
/**
  * @
}
  */


/**
  * @defgroup CAN_Operating_Mode 
  * @{

  */  
#define CAN_OperatingMode_Initialization  ((uint8_t)0x00) /*!< Initialization mode */
#define CAN_OperatingMode_Normal          ((uint8_t)0x
...
...
(Not finished, please download and read the complete file)
			
...
Expand> <Close

Want complete source code? Download it here

Point(s): 0

Download
0 lines left, continue to read
Sponsored links

File list

Tips: You can preview the content of files by clicking file names^_^
Name Size Date
01.97 kB
01.97 kB
core_cm3.c16.87 kB2010-06-07 10:25
core_cm3.h83.71 kB2011-02-09 14:59
startup_stm32f10x_hd.s15.14 kB2011-03-10 10:52
stm32f10x.h619.08 kB2011-03-10 10:51
system_stm32f10x.c35.70 kB2011-03-10 10:51
system_stm32f10x.h2.04 kB2011-03-10 10:51
01.97 kB
01.97 kB
misc.h8.77 kB2011-03-10 10:47
stm32f10x_adc.h21.18 kB2011-03-10 10:47
stm32f10x_bkp.h7.38 kB2011-03-10 10:47
stm32f10x_can.h26.91 kB2011-03-10 10:47
stm32f10x_cec.h6.42 kB2011-03-10 10:47
stm32f10x_crc.h2.11 kB2011-03-10 10:47
stm32f10x_dac.h14.88 kB2011-03-10 10:47
stm32f10x_dbgmcu.h3.73 kB2011-03-10 10:47
stm32f10x_dma.h20.27 kB2011-03-10 10:47
stm32f10x_exti.h6.66 kB2011-03-10 10:47
stm32f10x_flash.h24.85 kB2011-03-10 10:47
stm32f10x_fsmc.h26.38 kB2011-03-10 10:47
stm32f10x_gpio.h19.70 kB2011-03-10 10:47
stm32f10x_i2c.h29.33 kB2011-03-10 10:47
stm32f10x_iwdg.h3.74 kB2011-03-10 10:47
stm32f10x_pwr.h4.28 kB2011-03-10 10:47
stm32f10x_rcc.h29.74 kB2011-03-10 10:47
stm32f10x_rtc.h3.77 kB2011-03-10 10:47
stm32f10x_sdio.h21.35 kB2011-03-10 10:47
stm32f10x_spi.h17.31 kB2011-03-10 10:47
stm32f10x_tim.h51.20 kB2011-03-10 10:47
stm32f10x_usart.h16.16 kB2011-03-10 10:47
stm32f10x_wwdg.h2.90 kB2011-03-10 10:47
01.97 kB
misc.c6.88 kB2011-03-10 10:47
stm32f10x_adc.c46.09 kB2011-03-10 10:47
stm32f10x_bkp.c8.26 kB2011-03-10 10:47
stm32f10x_can.c44.05 kB2011-03-10 10:47
stm32f10x_cec.c11.38 kB2011-03-10 10:47
stm32f10x_crc.c3.27 kB2011-03-10 10:47
stm32f10x_dac.c18.64 kB2011-03-10 10:47
stm32f10x_dbgmcu.c5.03 kB2011-03-10 10:47
stm32f10x_dma.c28.91 kB2011-03-10 10:47
stm32f10x_exti.c6.80 kB2011-03-10 10:47
stm32f10x_flash.c61.08 kB2011-03-10 10:47
stm32f10x_fsmc.c34.65 kB2011-03-10 10:47
stm32f10x_gpio.c22.68 kB2011-03-11 17:43
stm32f10x_i2c.c44.71 kB2011-03-10 10:47
stm32f10x_iwdg.c4.80 kB2011-03-10 10:47
stm32f10x_pwr.c8.55 kB2011-03-10 10:47
stm32f10x_rcc.c50.07 kB2011-03-10 10:47
stm32f10x_rtc.c8.40 kB2011-03-10 10:47
stm32f10x_sdio.c28.25 kB2011-03-10 10:47
stm32f10x_spi.c29.52 kB2011-03-10 10:47
stm32f10x_tim.c106.60 kB2011-03-10 10:47
stm32f10x_usart.c37.41 kB2011-03-10 10:47
stm32f10x_wwdg.c5.60 kB2011-03-10 10:47
01.97 kB
01.97 kB
systick.hex18.40 kB2013-08-15 19:23
01.97 kB
I2C_MPU6050.c4.69 kB2013-08-15 19:23
I2C_MPU6050.h1.13 kB2013-08-15 19:10
I2C_MPU6050.uvgui.Orange131.20 kB2013-08-15 19:25
I2C_MPU6050.uvgui.flyleaf66.57 kB2012-06-25 20:54
I2C_MPU6050.uvopt10.45 kB2013-08-15 19:25
I2C_MPU6050.uvproj16.56 kB2013-08-15 19:00
JLink497.00 B2012-06-25 20:12
JLinkSettings.ini375.00 B2012-06-24 14:45
delay.c177.00 B2011-08-10 16:44
delay.h98.00 B2011-08-08 21:03
main.c1.48 kB2013-08-15 19:11
stm32f10x_conf.h3.22 kB2012-06-24 22:12
stm32f10x_it.c4.30 kB2011-04-04 19:03
stm32f10x_it.h2.04 kB2011-04-04 19:03
usart1.c5.33 kB2013-08-15 14:40
usart1.h234.00 B2011-08-05 21:11
keilkilll.bat399.00 B2011-04-23 10:24
...
Sponsored links

stm32f10x_can.h (294.78 kB)

Need 0 point
Your Point(s)
Download Download

Download failed? Click here to download one by one.

Tip: this source code project contains 2 packages, please click the allow button on the browser pop-up dialog,after you click the download button.

▪ Click to download this source code directly

LOGIN

Don't have an account? Register now
Need any help?
Mail to: support@codeforge.com

切换到中文版?

CodeForge Chinese Version
CodeForge English Version

Where are you going?

^_^"Oops ...

Sorry!This guy is mysterious, its blog hasn't been opened, try another, please!
OK

Warm tip!

CodeForge to FavoriteFavorite by Ctrl+D