STM8S/A Standard Peripherals Drivers: CAN_Public_Functions

STM8S/A

STM8S/A Standard Peripherals Drivers
CAN_Public_Functions

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.

Function Documentation

void CAN_CancelTransmit ( CAN_TransmitMailBox_TypeDef  CAN_TransmitMailbox)

Cancels a transmit request.

Parameters:
CAN_TransmitMailbox: the Transmission mailbox, can be one of CAN_TransmitMailBox_TypeDef
Return values:
None

Definition at line 724 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_MCSR_ABRQ, CAN_SelectPage(), and IS_CAN_TRANSMITMAILBOX_OK.

void CAN_ClearFlag ( CAN_FLAG_TypeDef  CAN_Flag)

Clears the CAN's pending flags.

Parameters:
CAN_Flag: Flag to be cleared, can be one of the following parameters: CAN_FLAG_RQCP0 Request MailBox0 Flag CAN_FLAG_RQCP1 Request MailBox1 Flag CAN_FLAG_RQCP2 Request MailBox2 Flag CAN_FLAG_FF FIFO Full Flag CAN_FLAG_FOV FIFO Overrun Flag CAN_FLAG_WKU wake up Flag CAN_FLAG_LEC Last error code Flag
Return values:
None

Definition at line 1077 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_Page_Config, CAN_SelectPage(), IS_CAN_FLAG_CLEAR_OK, and RESET.

void CAN_ClearITPendingBit ( CAN_IT_TypeDef  CAN_IT)

Clears the CAN�s interrupt pending bits.

Parameters:
CAN_IT,:specifies the interrupt pending bit to clear, can be one of the following parameters: CAN_IT_TME = Transmit mailbox empty interrupt CAN_IT_FF =FIFO full interrupt CAN_IT_FOV =FIFO overrun interrupt CAN_IT_WKU =Wake-up interrupt CAN_IT_ERR =General Error interrupt CAN_IT_EWG =Error warning interrupt CAN_IT_EPV =Error passive interrupt CAN_IT_BOF = Bus-off interrupt CAN_IT_LEC =Last error code interrupt
Return values:
None

Definition at line 1348 of file stm8s_can.c.

References CAN_ESR_RESET_VALUE, CAN_GetSelectedPage(), CAN_IT_BOF, CAN_IT_EPV, CAN_IT_ERR, CAN_IT_EWG, CAN_IT_FF, CAN_IT_FOV, CAN_IT_LEC, CAN_IT_TME, CAN_IT_WKU, CAN_MSR_ERRI, CAN_MSR_WKUI, CAN_Page_Config, CAN_RFR_FOVR, CAN_RFR_FULL, CAN_SelectPage(), CAN_TSR_RQCP012, and IS_CAN_IT_PENDING_BIT_OK.

void CAN_FIFORelease ( void  )

Releases the CAN FIFO.

Parameters:
None
Return values:
None

Definition at line 742 of file stm8s_can.c.

References CAN_RFR_RFOM.

Referenced by CAN_Receive().

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.

Parameters:
CAN_FilterNumber: CAN Filter number , can be one of CAN_FilterNumber_TypeDef
CAN_FilterActivation: CAN Filter Activation state , can be one of FunctionalState
CAN_FilterMode: CAN Filter Mode , can be one of CAN_FilterMode_TypeDef
CAN_FilterScale: CAN Filter Scale , can be one of CAN_FilterScale_TypeDef
CAN_FilterID1: CAN Filter ID 1 , can be a value from 0x00 to 0xFF
CAN_FilterID2: CAN Filter ID 2 , can be a value from 0x00 to 0xFF
CAN_FilterID3: CAN Filter ID 3 , can be a value from 0x00 to 0xFF
CAN_FilterID4: CAN Filter ID 4 , can be a value from 0x00 to 0xFF
CAN_FilterIDMask1: CAN Filter ID 1/ Mask 1 , can be a value from 0x00 to 0xFF depending of CAN_FilterMode parameter
CAN_FilterIDMask2: CAN Filter ID 2/ Mask 2 , can be a value from 0x00 to 0xFF depending of CAN_FilterMode parameter
CAN_FilterIDMask3: CAN Filter ID 3/ Mask 3 , can be a value from 0x00 to 0xFF depending of CAN_FilterMode parameter
CAN_FilterIDMask4: CAN Filter ID 4/ Mask 4 , can be a value from 0x00 to 0xFF depending of CAN_FilterMode parameter
Return values:
None

Definition at line 194 of file stm8s_can.c.

References CAN_FCR1_FSC00, CAN_FCR1_FSC01, CAN_FilterMode_IdList, CAN_FilterMode_IdList_IdMask, CAN_FilterMode_IdMask, CAN_FilterNumber_0, CAN_FilterNumber_1, CAN_FilterNumber_2, CAN_FilterNumber_3, CAN_FilterNumber_4, CAN_FilterScale_16_8Bit, CAN_FilterScale_16Bit, CAN_FilterScale_32Bit, CAN_FilterScale_8Bit, CAN_GetSelectedPage(), CAN_IDLIST_IDMASK_MASK, CAN_IDMASK_IDLIST_MASK, CAN_OperatingMode_Initialization, CAN_OperatingMode_Normal, CAN_OperatingModeRequest(), CAN_Page_Config, CAN_Page_Filter01, CAN_Page_Filter23, CAN_Page_Filter45, CAN_SelectPage(), DISABLE, IS_CAN_FILTER_MODE_OK, IS_CAN_FILTER_NUMBER_OK, IS_CAN_FILTER_SCALE_OK, and IS_FUNCTIONALSTATE_OK.

FlagStatus CAN_GetFlagStatus ( CAN_FLAG_TypeDef  CAN_Flag)

Checks whether the specified CAN flag is set or not.

Parameters:
CAN_Flag: specifies the flag to check, can be one of CAN_FLAG_TypeDef enumeration.
Return values:
Thenew state of CAN_FLAG which can be one of FlagStatus.

Definition at line 1119 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_Page_Config, CAN_SelectPage(), IS_CAN_FLAG_STATUS_OK, RESET, and SET.

ITStatus CAN_GetITStatus ( CAN_IT_TypeDef  CAN_IT)

Checks whether the specified CAN interrupt has occurred or not.

Parameters:
CAN_IT,:specifies the CAN interrupt source to check, can be one of CAN_IT_TypeDef.
Return values:
Thenew state of CAN_IT, which can be one of ITStatus.

Definition at line 1203 of file stm8s_can.c.

References CAN_EIER_BOFIE, CAN_EIER_EPVIE, CAN_EIER_ERRIE, CAN_EIER_EWGIE, CAN_EIER_LECIE, CAN_ESR_BOFF, CAN_ESR_EPVF, CAN_ESR_EWGF, CAN_ESR_LEC, CAN_GetSelectedPage(), CAN_IER_FFIE, CAN_IER_FMPIE, CAN_IER_FOVIE, CAN_IER_TMEIE, CAN_IER_WKUIE, CAN_IT_BOF, CAN_IT_EPV, CAN_IT_ERR, CAN_IT_EWG, CAN_IT_FF, CAN_IT_FMP, CAN_IT_FOV, CAN_IT_LEC, CAN_IT_TME, CAN_IT_WKU, CAN_MSR_WKUI, CAN_Page_Config, CAN_RFR_FMP01, CAN_RFR_FOVR, CAN_RFR_FULL, CAN_SelectPage(), CAN_TSR_RQCP012, CheckITStatus(), IS_CAN_IT_STATUS_OK, and RESET.

CAN_ErrorCode_TypeDef CAN_GetLastErrorCode ( void  )

Gets the Last Error Code.

Parameters:
None
Return values:
ErrorCode.

Definition at line 1051 of file stm8s_can.c.

References CAN_ErrorCode_NoErr, CAN_ESR_LEC, CAN_GetSelectedPage(), CAN_Page_Config, and CAN_SelectPage().

uint16_t CAN_GetMessageTimeStamp ( void  )

Returns the Received time stamp.

Parameters:
None
Return values:
uint16_tthe received time stamp.

Definition at line 902 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_Page_RxFifo, and CAN_SelectPage().

uint8_t CAN_GetReceivedData ( uint8_t  CAN_DataIndex)

Gets the CAN Data of the received message.

Parameters:
CAN_DataIndex: number of the received Data, it can be an integer between 0 to 7.
Return values:
thereceived CAN message ith Data.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 878 of file stm8s_can.c.

References _Data, and IS_CAN_DLC_OK.

uint8_t CAN_GetReceivedDLC ( void  )

Gets the CAN DLC of the received message.

Parameters:
None
Return values:
thereceived CAN message DLC.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 864 of file stm8s_can.c.

References _DLC.

uint8_t CAN_GetReceivedFMI ( void  )

Gets the CAN FMI of the received message.

Parameters:
None
Return values:
thereceived CAN message FMI.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 892 of file stm8s_can.c.

References _FMI.

uint32_t CAN_GetReceivedId ( void  )

Gets the CAN Id of the received message.

Parameters:
None
Return values:
thereceived CAN message Id.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 825 of file stm8s_can.c.

References _Id.

CAN_Id_TypeDef CAN_GetReceivedIDE ( void  )

Gets the CAN IDE of the received message.

Parameters:
None
Return values:
thereceived CAN message IDE.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 838 of file stm8s_can.c.

References _IDE.

CAN_RTR_TypeDef CAN_GetReceivedRTR ( void  )

Gets the CAN RTR of the received message.

Parameters:
None
Return values:
thereceived CAN message RTR.
Required preconditions:
This function is used to get data loaded by CAN_Receive function. Before using this function, CAN_Receive function must be called.

Definition at line 851 of file stm8s_can.c.

References _RTR.

CAN_Page_TypeDef CAN_GetSelectedPage ( void  )

Gets the selected registers page.

Parameters:
None
Return values:
theselected page which can be one of the CAN_Page_TypeDef.

Definition at line 1407 of file stm8s_can.c.

Referenced by CAN_CancelTransmit(), CAN_ClearFlag(), CAN_ClearITPendingBit(), CAN_FilterInit(), CAN_GetFlagStatus(), CAN_GetITStatus(), CAN_GetLastErrorCode(), CAN_GetMessageTimeStamp(), CAN_Init(), CAN_ITConfig(), CAN_Receive(), CAN_Transmit(), and CAN_TTComModeCmd().

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.

Parameters:
CAN_MasterCtrl: Master control option, can be one or a combination of CAN_MasterCtrl_TypeDef.
CAN_Mode: CAN mode , can be one of CAN_Mode_TypeDef.
CAN_SynJumpWidth: CAN Synchronisation Jump Width , can be one of CAN_SynJumpWidth_TypeDef.
CAN_BitSeg1: CAN bit segment 1 , can be one of CAN_BitSeg1_TypeDef.
CAN_BitSeg2: CAN bit segment 2 , can be one of CAN_BitSeg2_TypeDef.
CAN_Prescaler: CAN Baud Rate Prescaler , can be a value from 0x01 to 0xFF.
Return values:
Indicatesif initialization is succeed. it can be one of CAN_InitStatus_TypeDef enumeration.

Definition at line 106 of file stm8s_can.c.

References CAN_ACKNOWLEDGE_TIMEOUT, CAN_GetSelectedPage(), CAN_InitStatus_Failed, CAN_InitStatus_Success, CAN_MCR_INRQ, CAN_MSR_INAK, CAN_Page_Config, CAN_SelectPage(), IS_CAN_BITSEG1_OK, IS_CAN_BITSEG2_OK, IS_CAN_MASTERCTRL_OK, IS_CAN_MODE_OK, IS_CAN_PRESCALER_OK, and IS_CAN_SYNJUMPWIDTH_OK.

void CAN_ITConfig ( CAN_IT_TypeDef  CAN_IT,
FunctionalState  NewState 
)

Enables or disables the specified CAN interrupts.

Parameters:
CAN_IT,:specifies the CAN interrupt sources to be enabled or disabled.
NewState: CAN_IT new state , can be one of FunctionalState
Return values:
None

Definition at line 487 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_Page_Config, CAN_SelectPage(), DISABLE, IS_CAN_IT_CONFIG_OK, and IS_FUNCTIONALSTATE_OK.

CAN_NbrPendingMessage_TypeDef CAN_MessagePending ( void  )

Returns the number of pending messages.

Return values:
Numberof pending messages.

Definition at line 752 of file stm8s_can.c.

References CAN_NbrPendingMessage_0, and CAN_RFR_FMP01.

CAN_ModeStatus_TypeDef CAN_OperatingModeRequest ( CAN_OperatingMode_TypeDef  CAN_OperatingMode)

Select the CAN Operation mode.

Parameters:
CAN_OperatingModeCAN Operating Mode , this parameter can be one of CAN_OperatingMode_TypeDef enumeration.
Return values:
thestatus of the requested mode which can be
  • CAN_ModeStatus_Failed CAN failed entering the specific mode
  • CAN_ModeStatus_Success CAN Succeed entering the specific mode

Definition at line 974 of file stm8s_can.c.

References CAN_ACKNOWLEDGE_TIMEOUT, CAN_MCR_INRQ, CAN_MCR_SLEEP, CAN_MODE_MASK, CAN_ModeStatus_Failed, CAN_ModeStatus_Success, CAN_MSR_INAK, CAN_MSR_SLAK, CAN_OperatingMode_Initialization, CAN_OperatingMode_Normal, CAN_OperatingMode_Sleep, and IS_CAN_OPERATINGMODE_OK.

Referenced by CAN_DeInit(), and CAN_FilterInit().

void CAN_Receive ( void  )

Receives a message which contains CAN Id, IDE, RTR DLC, data and FMI number.

In order to get these data, use CAN_GetReceivedId(), CAN_GetReceivedIDE(), CAN_GetReceivedRTR(), CAN_GetReceivedDLC(), CAN_GetReceivedFMI() and CAN_GetReceivedData() functions.

Parameters:
None
Return values:
None

Definition at line 767 of file stm8s_can.c.

References _Data, _DLC, _FMI, _Id, _IDE, _RTR, CAN_EXTID_SIZE, CAN_FIFORelease(), CAN_GetSelectedPage(), CAN_Id_Extended, CAN_Id_Standard, CAN_Page_RxFifo, CAN_SelectPage(), and CAN_STDID_SIZE.

void CAN_SelectPage ( CAN_Page_TypeDef  CAN_Page)

Sets the registers page to be selected.

Parameters:
CAN_Page,:the selected page which can be one of the CAN_Page_TypeDef.
Return values:
None

Definition at line 1417 of file stm8s_can.c.

Referenced by CAN_CancelTransmit(), CAN_ClearFlag(), CAN_ClearITPendingBit(), CAN_FilterInit(), CAN_GetFlagStatus(), CAN_GetITStatus(), CAN_GetLastErrorCode(), CAN_GetMessageTimeStamp(), CAN_Init(), CAN_ITConfig(), CAN_Receive(), CAN_Transmit(), and CAN_TTComModeCmd().

CAN_Sleep_TypeDef CAN_Sleep ( void  )

Enters the Sleep low power mode.

Parameters:
None
Return values:
CAN_Sleep_Okif sleep entered, CAN_Sleep_Failed in an other case.

Definition at line 924 of file stm8s_can.c.

References CAN_MCR_INRQ, CAN_MCR_SLEEP, CAN_MSR_INAK, CAN_MSR_SLAK, CAN_Sleep_Failed, and CAN_Sleep_Ok.

void CAN_ST7CompatibilityCmd ( CAN_ST7Compatibility_TypeDef  CAN_ST7Compatibility)

Enables or Disables the ST7 CAN Compatibility.

if the ST7 compatibility is Enabled, CAN provides only 2 mailboxes. if the ST7 compatibility is Disabled, CAN provides 3 mailboxes.

Parameters:
CAN_ST7Compatibility: CAN ST7 Compatibility , this parameter can be one of CAN_ST7Compatibility_TypeDef enumeration.
Return values:
None

Definition at line 525 of file stm8s_can.c.

References CAN_DGR_TXM2E, and IS_CAN_ST7_COMPATIBILITY_OK.

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.

Parameters:
CAN_Idthe ID number of the message, its size depends on CAN_IDE value.
[in]CAN_IDEthe ID type of the message, this parameter can be one of the CAN_Id_TypeDef enumeration.
[in]CAN_RTRthe message type, this parameter can be one of the CAN_RTR_TypeDef enumeration.
[in]CAN_DLCthe number of data in the message type, this parameter can be a value between 0 to 7.
[in]CAN_Datapointer to a the uint8_t table which contains data to sent.
Return values:
TransmitStatus, this returned value can be one of the CAN_TxStatus_TypeDef enumeration.

Definition at line 587 of file stm8s_can.c.

References CAN_EXTID_SIZE, CAN_GetSelectedPage(), CAN_Id_Standard, CAN_MCSR_TXRQ, CAN_SelectPage(), CAN_STDID_SIZE, CAN_TPR_TME0, CAN_TPR_TME1, CAN_TPR_TME2, CAN_TxStatus_MailBox0Ok, CAN_TxStatus_MailBox1Ok, CAN_TxStatus_MailBox2Ok, CAN_TxStatus_NoMailBox, IS_CAN_DLC_OK, IS_CAN_EXTID_OK, IS_CAN_IDTYPE_OK, IS_CAN_RTR_OK, and IS_CAN_STDID_OK.

CAN_TxStatus_TypeDef CAN_TransmitStatus ( CAN_TransmitMailBox_TypeDef  CAN_TransmitMailbox)

Checks the transmission of a message.

Parameters:
CAN_TransmitMailbox: the number of the mailbox that is used for transmission, can be on of CAN_TransmitMailBox_TypeDef.
Return values:
CAN_TxStatus_Okif the CAN driver transmits the message, CAN_TxStatus_Failed in an other case.

Definition at line 672 of file stm8s_can.c.

References CAN_TPR_TME0, CAN_TPR_TME1, CAN_TPR_TME2, CAN_TransmitMailBox_0, CAN_TransmitMailBox_1, CAN_TransmitMailBox_2, CAN_TSR_RQCP0, CAN_TSR_RQCP1, CAN_TSR_RQCP2, CAN_TSR_TXOK0, CAN_TSR_TXOK1, CAN_TSR_TXOK2, CAN_TxStatus_Failed, CAN_TxStatus_MailBoxEmpty, CAN_TxStatus_Ok, CAN_TxStatus_Pending, and IS_CAN_TRANSMITMAILBOX_OK.

void CAN_TTComModeCmd ( FunctionalState  NewState)

Enables or disables the CAN Time TriggerOperation communication mode.

Parameters:
NewState: Mode new state , can be one of FunctionalState
Return values:
None

Definition at line 541 of file stm8s_can.c.

References CAN_GetSelectedPage(), CAN_MCR_TTCM, CAN_MDLCR_TGT, CAN_Page_RxFifo, CAN_Page_TxMailBox0, CAN_Page_TxMailBox1, CAN_Page_TxMailBox2, CAN_SelectPage(), DISABLE, and IS_FUNCTIONALSTATE_OK.

CAN_WakeUp_TypeDef CAN_WakeUp ( void  )

Wakes the CAN up.

Parameters:
None
Return values:
CAN_WakeUp_Okif sleep mode left, CAN_WakeUp_Failed in an other case.

Definition at line 947 of file stm8s_can.c.

References CAN_MCR_SLEEP, CAN_MSR_SLAK, CAN_WakeUp_Failed, and CAN_WakeUp_Ok.

static ITStatus CheckITStatus ( uint8_t  CAN_Reg,
uint8_t  It_Bit 
) [static]

Checks whether the CAN interrupt has occurred or not.

Parameters:
CAN_Reg,:specifies the CAN interrupt register to check.
It_Bit,:specifies the interrupt source bit to check.
Return values:
Thenew state of the CAN Interrupt, which can be one of ITStatus.

Definition at line 1428 of file stm8s_can.c.

References RESET, and SET.

Referenced by CAN_GetITStatus().

STM8 Standard Peripherals Library: Footer

 

 

 

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