STM32F1 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F1 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Groups
CAN_Exported_Functions

Functions

void CAN_DeInit (CAN_TypeDef *CANx)
 Deinitializes the CAN peripheral registers to their default reset values. 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_FilterInit (CAN_FilterInitTypeDef *CAN_FilterInitStruct)
 Initializes the CAN peripheral according to the specified parameters in the CAN_FilterInitStruct. More...
 
void CAN_StructInit (CAN_InitTypeDef *CAN_InitStruct)
 Fills each CAN_InitStruct member with its default value. More...
 
void CAN_SlaveStartBank (uint8_t CAN_BankNumber)
 Select the start bank filter for slave CAN. More...
 
void CAN_ITConfig (CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState)
 Enables or disables the specified CAN interrupts. 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_CancelTransmit (CAN_TypeDef *CANx, uint8_t Mailbox)
 Cancels a transmit request. More...
 
void CAN_FIFORelease (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Releases a FIFO. More...
 
uint8_t CAN_MessagePending (CAN_TypeDef *CANx, uint8_t FIFONumber)
 Returns the number of pending messages. More...
 
void CAN_Receive (CAN_TypeDef *CANx, uint8_t FIFONumber, CanRxMsg *RxMessage)
 Receives a message. More...
 
void CAN_DBGFreeze (CAN_TypeDef *CANx, FunctionalState NewState)
 Enables or disables the DBG Freeze for CAN. More...
 
uint8_t CAN_Sleep (CAN_TypeDef *CANx)
 Enters the low power mode. More...
 
uint8_t CAN_WakeUp (CAN_TypeDef *CANx)
 Wakes the CAN up. More...
 
FlagStatus CAN_GetFlagStatus (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Checks whether the specified CAN flag is set or not. More...
 
void CAN_ClearFlag (CAN_TypeDef *CANx, uint32_t CAN_FLAG)
 Clears the CAN's pending flags. More...
 
ITStatus CAN_GetITStatus (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Checks whether the specified CAN interrupt has occurred or not. More...
 
void CAN_ClearITPendingBit (CAN_TypeDef *CANx, uint32_t CAN_IT)
 Clears the CANís interrupt pending bits. More...
 

Detailed Description

Function Documentation

void CAN_CancelTransmit ( CAN_TypeDef *  CANx,
uint8_t  Mailbox 
)

Cancels a transmit request.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
Mailbox,:Mailbox number.
Return values
None.
void CAN_ClearFlag ( CAN_TypeDef *  CANx,
uint32_t  CAN_FLAG 
)

Clears the CAN's pending flags.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAG,:specifies the flag to clear.
Return values
None.
void CAN_ClearITPendingBit ( CAN_TypeDef *  CANx,
uint32_t  CAN_IT 
)

Clears the CANís interrupt pending bits.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_IT,:specifies the interrupt pending bit to clear.
Return values
None.
void CAN_DBGFreeze ( CAN_TypeDef *  CANx,
FunctionalState  NewState 
)

Enables or disables the DBG Freeze for CAN.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
NewState,:new state of the CAN peripheral. This parameter can be: ENABLE or DISABLE.
Return values
None.
void CAN_DeInit ( CAN_TypeDef *  CANx)

Deinitializes the CAN peripheral registers to their default reset values.

Parameters
CANx,:where x can be 1 or 2 to select the CAN peripheral.
Return values
None.
void CAN_FIFORelease ( CAN_TypeDef *  CANx,
uint8_t  FIFONumber 
)

Releases a FIFO.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
FIFONumber,:FIFO to release, CAN_FIFO0 or CAN_FIFO1.
Return values
None.
void CAN_FilterInit ( CAN_FilterInitTypeDef CAN_FilterInitStruct)

Initializes the CAN peripheral according to the specified parameters in the CAN_FilterInitStruct.

Parameters
CAN_FilterInitStruct,:pointer to a CAN_FilterInitTypeDef structure that contains the configuration information.
Return values
None.
FlagStatus CAN_GetFlagStatus ( CAN_TypeDef *  CANx,
uint32_t  CAN_FLAG 
)

Checks whether the specified CAN flag is set or not.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_FLAG,:specifies the flag to check. This parameter can be: CAN_FLAG_EWG, CAN_FLAG_EPV or CAN_FLAG_BOF.
Return values
Thenew state of CAN_FLAG (SET or RESET).
ITStatus CAN_GetITStatus ( CAN_TypeDef *  CANx,
uint32_t  CAN_IT 
)

Checks whether the specified CAN interrupt has occurred or not.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_IT,:specifies the CAN interrupt source to check. This parameter can be: CAN_IT_RQCP0, CAN_IT_RQCP1, CAN_IT_RQCP2, CAN_IT_FF0, CAN_IT_FOV0, CAN_IT_FF1, CAN_IT_FOV1, CAN_IT_EWG, CAN_IT_EPV, CAN_IT_BOF, CAN_IT_WKU or CAN_IT_SLK.
Return values
Thenew state of CAN_IT (SET or RESET).
uint8_t CAN_Init ( CAN_TypeDef *  CANx,
CAN_InitTypeDef CAN_InitStruct 
)

Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_InitStruct,:pointer to a CAN_InitTypeDef structure that contains the configuration information for the CAN peripheral.
Return values
Constantindicates initialization succeed which will be CANINITFAILED or CANINITOK.
void CAN_ITConfig ( CAN_TypeDef *  CANx,
uint32_t  CAN_IT,
FunctionalState  NewState 
)

Enables or disables the specified CAN interrupts.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
CAN_IT,:specifies the CAN interrupt sources to be enabled or disabled. This parameter can be: CAN_IT_TME, CAN_IT_FMP0, CAN_IT_FF0, CAN_IT_FOV0, CAN_IT_FMP1, CAN_IT_FF1, CAN_IT_FOV1, CAN_IT_EWG, CAN_IT_EPV, CAN_IT_LEC, CAN_IT_ERR, CAN_IT_WKU or CAN_IT_SLK.
NewState,:new state of the CAN interrupts. This parameter can be: ENABLE or DISABLE.
Return values
None.
uint8_t CAN_MessagePending ( CAN_TypeDef *  CANx,
uint8_t  FIFONumber 
)

Returns the number of pending messages.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
FIFONumber,:Receive FIFO number, CAN_FIFO0 or CAN_FIFO1.
Return values
NbMessagewhich is the number of pending message.
void CAN_Receive ( CAN_TypeDef *  CANx,
uint8_t  FIFONumber,
CanRxMsg RxMessage 
)

Receives a message.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
FIFONumber,:Receive FIFO number, CAN_FIFO0 or CAN_FIFO1.
RxMessage,:pointer to a structure receive message which contains CAN Id, CAN DLC, CAN datas and FMI number.
Return values
None.
void CAN_SlaveStartBank ( uint8_t  CAN_BankNumber)

Select the start bank filter for slave CAN.

Note
This function applies only to STM32 Connectivity line devices.
Parameters
CAN_BankNumber,:Select the start slave bank filter from 1..27.
Return values
None.
uint8_t CAN_Sleep ( CAN_TypeDef *  CANx)

Enters the low power mode.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
Return values
CANSLEEPOKif sleep entered, CANSLEEPFAILED in an other case.
void CAN_StructInit ( CAN_InitTypeDef CAN_InitStruct)

Fills each CAN_InitStruct member with its default value.

Parameters
CAN_InitStruct,:pointer to a CAN_InitTypeDef structure which will be initialized.
Return values
None.
uint8_t CAN_Transmit ( CAN_TypeDef *  CANx,
CanTxMsg TxMessage 
)

Initiates the transmission of a message.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
TxMessage,:pointer to a structure which contains CAN Id, CAN DLC and CAN datas.
Return values
Thenumber of the mailbox that is used for transmission or CAN_NO_MB if there is no empty mailbox.
uint8_t CAN_TransmitStatus ( CAN_TypeDef *  CANx,
uint8_t  TransmitMailbox 
)

Checks the transmission of a message.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
TransmitMailbox,:the number of the mailbox that is used for transmission.
Return values
CANTXOKif the CAN driver transmits the message, CANTXFAILED in an other case.
uint8_t CAN_WakeUp ( CAN_TypeDef *  CANx)

Wakes the CAN up.

Parameters
CANx,:where x can be 1 or 2 to to select the CAN peripheral.
Return values
CANWAKEUPOKif sleep mode left, CANWAKEUPFAILED in an other case.