STM8S/A Standard Peripherals Drivers: stm8s_can.c File Reference

STM8S/A

stm8s_can.c File Reference

This file contains all the functions for the CAN peripheral. More...

#include "stm8s_can.h"

Go to the source code of this file.

Defines

#define CAN_ACKNOWLEDGE_TIMEOUT   ((uint16_t)0xFFFF)
#define CAN_IDLIST_IDMASK_MASK   ((uint8_t) 0x55)
#define CAN_IDMASK_IDLIST_MASK   ((uint8_t) 0xAA)
#define CAN_MODE_MASK   ((uint8_t) 0x03)

Functions

void CAN_CancelTransmit (CAN_TransmitMailBox_TypeDef CAN_TransmitMailbox)
 Cancels a transmit request.
void CAN_ClearFlag (CAN_FLAG_TypeDef CAN_Flag)
 Clears the CAN's pending flags.
void CAN_ClearITPendingBit (CAN_IT_TypeDef CAN_IT)
 Clears the CAN�s interrupt pending bits.
void CAN_DeInit (void)
 Deinitializes the CAN peripheral registers to their default reset values.
void CAN_FIFORelease (void)
 Releases the CAN FIFO.
void CAN_FilterInit (CAN_FilterNumber_TypeDef CAN_FilterNumber, FunctionalState CAN_FilterActivation, CAN_FilterMode_TypeDef CAN_FilterMode, CAN_FilterScale_TypeDef CAN_FilterScale, uint8_t CAN_FilterID1, uint8_t CAN_FilterID2, uint8_t CAN_FilterID3, uint8_t CAN_FilterID4, uint8_t CAN_FilterIDMask1, uint8_t CAN_FilterIDMask2, uint8_t CAN_FilterIDMask3, uint8_t CAN_FilterIDMask4)
 Initializes the CAN peripheral Filter according to the specified parameters.
FlagStatus CAN_GetFlagStatus (CAN_FLAG_TypeDef CAN_Flag)
 Checks whether the specified CAN flag is set or not.
ITStatus CAN_GetITStatus (CAN_IT_TypeDef CAN_IT)
 Checks whether the specified CAN interrupt has occurred or not.
CAN_ErrorCode_TypeDef CAN_GetLastErrorCode (void)
 Gets the Last Error Code.
uint16_t CAN_GetMessageTimeStamp (void)
 Returns the Received time stamp.
uint8_t CAN_GetReceivedData (uint8_t CAN_DataIndex)
 Gets the CAN Data of the received message.
uint8_t CAN_GetReceivedDLC (void)
 Gets the CAN DLC of the received message.
uint8_t CAN_GetReceivedFMI (void)
 Gets the CAN FMI of the received message.
uint32_t CAN_GetReceivedId (void)
 Gets the CAN Id of the received message.
CAN_Id_TypeDef CAN_GetReceivedIDE (void)
 Gets the CAN IDE of the received message.
CAN_RTR_TypeDef CAN_GetReceivedRTR (void)
 Gets the CAN RTR of the received message.
CAN_Page_TypeDef CAN_GetSelectedPage (void)
 Gets the selected registers page.
CAN_InitStatus_TypeDef CAN_Init (CAN_MasterCtrl_TypeDef CAN_MasterCtrl, CAN_Mode_TypeDef CAN_Mode, CAN_SynJumpWidth_TypeDef CAN_SynJumpWidth, CAN_BitSeg1_TypeDef CAN_BitSeg1, CAN_BitSeg2_TypeDef CAN_BitSeg2, uint8_t CAN_Prescaler)
 Initializes the CAN peripheral according to the specified parameters.
void CAN_ITConfig (CAN_IT_TypeDef CAN_IT, FunctionalState NewState)
 Enables or disables the specified CAN interrupts.
CAN_NbrPendingMessage_TypeDef CAN_MessagePending (void)
 Returns the number of pending messages.
CAN_ModeStatus_TypeDef CAN_OperatingModeRequest (CAN_OperatingMode_TypeDef CAN_OperatingMode)
 Select the CAN Operation mode.
void CAN_Receive (void)
 Receives a message which contains CAN Id, IDE, RTR DLC, data and FMI number.
void CAN_SelectPage (CAN_Page_TypeDef CAN_Page)
 Sets the registers page to be selected.
CAN_Sleep_TypeDef CAN_Sleep (void)
 Enters the Sleep low power mode.
void CAN_ST7CompatibilityCmd (CAN_ST7Compatibility_TypeDef CAN_ST7Compatibility)
 Enables or Disables the ST7 CAN Compatibility.
CAN_TxStatus_TypeDef CAN_Transmit (uint32_t CAN_Id, CAN_Id_TypeDef CAN_IDE, CAN_RTR_TypeDef CAN_RTR, uint8_t CAN_DLC, uint8_t *CAN_Data)
 Initiates the transmission of a message.
CAN_TxStatus_TypeDef CAN_TransmitStatus (CAN_TransmitMailBox_TypeDef CAN_TransmitMailbox)
 Checks the transmission of a message.
void CAN_TTComModeCmd (FunctionalState NewState)
 Enables or disables the CAN Time TriggerOperation communication mode.
CAN_WakeUp_TypeDef CAN_WakeUp (void)
 Wakes the CAN up.
static ITStatus CheckITStatus (uint8_t CAN_Reg, uint8_t It_Bit)
 Checks whether the CAN interrupt has occurred or not.

Variables

__IO uint8_t _Data [8] = {0}
__IO uint8_t _DLC = 0
__IO uint8_t _FMI = 0
__IO uint32_t _Id = 0
__IO uint8_t _IDE = 0
__IO uint8_t _RTR = 0

Detailed Description

This file contains all the functions for the CAN peripheral.

Author:
MCD Application Team
Version:
V2.3.0
Date:
16-June-2017
Attention:

© COPYRIGHT 2014 STMicroelectronics

Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); You may not use this file except in compliance with the License. You may obtain a copy of the License at:

http://www.st.com/software_license_agreement_liberty_v2

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Definition in file stm8s_can.c.

STM8 Standard Peripherals Library: Footer

 

 

 

      For complete documentation on STM8 8-bit Microcontrollers platform visit www.st.com