Macros | Functions
stm32f10x_can.c File Reference

This file provides all the CAN firmware functions. More...

#include "stm32f10x_can.h"
#include "stm32f10x_rcc.h"
Include dependency graph for stm32f10x_can.c:

Go to the source code of this file.

Macros

#define CAN_FLAGS_ESR   ((uint32_t)0x00F00000)
 
#define CAN_FLAGS_MSR   ((uint32_t)0x01000000)
 
#define CAN_FLAGS_RF0R   ((uint32_t)0x02000000)
 
#define CAN_FLAGS_RF1R   ((uint32_t)0x04000000)
 
#define CAN_FLAGS_TSR   ((uint32_t)0x08000000)
 
#define CAN_MODE_MASK   ((uint32_t) 0x00000003)
 
#define CAN_TXMAILBOX_0   ((uint8_t)0x00)
 
#define CAN_TXMAILBOX_1   ((uint8_t)0x01)
 
#define CAN_TXMAILBOX_2   ((uint8_t)0x02)
 
#define FMR_FINIT   ((uint32_t)0x00000001) /* Filter init mode */
 
#define INAK_TIMEOUT   ((uint32_t)0x0000FFFF)
 
#define MCR_DBF   ((uint32_t)0x00010000) /* software master reset */
 
#define SLAK_TIMEOUT   ((uint32_t)0x0000FFFF)
 
#define TMIDxR_TXRQ   ((uint32_t)0x00000001) /* Transmit mailbox request */
 

Functions

void CAN_CancelTransmit (CAN_TypeDef *CANx, uint8_t Mailbox)
 Cancels a transmit request. More...
 
void CAN_ClearFlag (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Clears the CAN's pending flags. More...
 
void CAN_ClearITPendingBit (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Clears the CANx's interrupt pending bits. More...
 
void CAN_DBGFreeze (CAN_TypeDef *CANx, FunctionalState NewState)
 Enables or disables the DBG Freeze for CAN. More...
 
void CAN_DeInit (CAN_TypeDef *CANx)
 Deinitializes the CAN peripheral registers to their default reset values. More...
 
void CAN_FIFORelease (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Releases the specified FIFO. More...
 
void CAN_FilterInit (CAN_FilterInitTypeDef *CAN_FilterInitStruct)
 Initializes the CAN peripheral according to the specified parameters in the CAN_FilterInitStruct. More...
 
FlagStatus CAN_GetFlagStatus (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Checks whether the specified CAN flag is set or not. More...
 
ITStatus CAN_GetITStatus (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Checks whether the specified CANx interrupt has occurred or not. More...
 
uint8_t CAN_GetLastErrorCode (CAN_TypeDef *CANx)
 Returns the CANx's last error code (LEC). More...
 
uint8_t CAN_GetLSBTransmitErrorCounter (CAN_TypeDef *CANx)
 Returns the LSB of the 9-bit CANx Transmit Error Counter(TEC). More...
 
uint8_t CAN_GetReceiveErrorCounter (CAN_TypeDef *CANx)
 Returns the CANx Receive Error Counter (REC). More...
 
uint8_t CAN_Init (CAN_TypeDef *CANx, CAN_InitTypeDef *CAN_InitStruct)
 Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct. More...
 
void CAN_ITConfig (CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState)
 Enables or disables the specified CANx interrupts. More...
 
uint8_t CAN_MessagePending (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Returns the number of pending messages. More...
 
uint8_t CAN_OperatingModeRequest (CAN_TypeDef *CANx, uint8_t CAN_OperatingMode)
 Select the CAN Operation mode. More...
 
void CAN_Receive (CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMsg *RxMessage)
 Receives a message. More...
 
void CAN_SlaveStartBank (uint8_t CAN_BankNumber)
 Select the start bank filter for slave CAN. More...
 
uint8_t CAN_Sleep (CAN_TypeDef *CANx)
 Enters the low power mode. More...
 
void CAN_StructInit (CAN_InitTypeDef *CAN_InitStruct)
 Fills each CAN_InitStruct member with its default value. More...
 
uint8_t CAN_Transmit (CAN_TypeDef *CANx, CanTxMsg *TxMessage)
 Initiates the transmission of a message. More...
 
uint8_t CAN_TransmitStatus (CAN_TypeDef *CANx, uint8_t TransmitMailbox)
 Checks the transmission of a message. More...
 
void CAN_TTComModeCmd (CAN_TypeDef *CANx, FunctionalState NewState)
 Enables or disabes the CAN Time TriggerOperation communication mode. More...
 
uint8_t CAN_WakeUp (CAN_TypeDef *CANx)
 Wakes the CAN up. More...
 
static ITStatus CheckITStatus (uint32_t CAN_Reg, uint32_t It_Bit)
 Checks whether the CAN interrupt has occurred or not. More...
 

Detailed Description

This file provides all the CAN firmware functions.

Author
MCD Application Team
Version
V3.5.0
Date
11-March-2011
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.

© COPYRIGHT 2011 STMicroelectronics

Definition in file stm32f10x_can.c.



rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Apr 15 2021 05:07:52