MG32F157 Standard Peripherals Firmware Library
|
Functions | |
void | CAN_DeInit (CAN_TypeDef *CANx) |
Deinitializes the CAN peripheral registers to their default reset values. More... | |
void | CAN_Init (CAN_TypeDef *CANx, CAN_InitTypeDef *CAN_InitStruct) |
Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct. More... | |
void | CANFD_Init (CAN_TypeDef *CANx, CANFD_InitTypeDef *CANFD_InitStruct) |
Initializes the CAN peripheral to FD Mode according to the specified parameters in the CAN_InitStruct. More... | |
void | CAN_FilterInit (CAN_TypeDef *CANx, CAN_FilterInitTypeDef *CAN_FilterInitStruct) |
Initializes the CAN peripheral according to the specified. parameters in the CAN_FilterInitTypeDef. More... | |
void | CAN_StructInit (CAN_InitTypeDef *CAN_InitStruct) |
Fills each CAN_InitStruct member with its default value. More... | |
void | CANFD_StructInit (CANFD_InitTypeDef *CANFD_InitStruct) |
Fills each CANFD_InitTypeDef member with its default value. More... | |
void | CAN_FilterStructInit (CAN_FilterInitTypeDef *CAN_FilterInitStruct) |
Fills each CANFD_InitStruct member with its default value. More... | |
void | CAN_Reset (CAN_TypeDef *CANx, FunctionalState NewState) |
Set peripheral CAN to reset mode. More... | |
void | CAN_SendCmd (CAN_TypeDef *CANx, uint32_t CAN_Cmd) |
Use peripheral CAN to send the transmission command. More... | |
void | CAN_Transmit (CAN_TypeDef *CANx, CAN_Msg *Message, uint32_t AutoRetransmissionEnable) |
Initiates the transmission of a message in class mode. More... | |
void | CAN_Receive (CAN_TypeDef *CANx, CAN_Msg *Message) |
Receives a message in class mode. More... | |
void | CANFD_Transmit (CAN_TypeDef *CANx, CANFD_Msg *Message, uint32_t AutoRetransmissionEnable) |
Initiates the transmission of a message in FD mode. More... | |
void | CANFD_Receive (CAN_TypeDef *CANx, CANFD_Msg *Message) |
Receives a message in FD mode. More... | |
void | CAN_ITConfig (CAN_TypeDef *CANx, uint32_t CAN_IT, FunctionalState NewState) |
Enables or disables the specified CANx interrupts. More... | |
FlagStatus | CAN_GetITStatus (CAN_TypeDef *CANx, uint32_t CAN_Flag) |
Checks whether the specified CAN flag is set or not. More... | |
void | CAN_ClearITPendingBit (CAN_TypeDef *CANx, uint32_t CAN_Flag) |
Clears the CAN's pending flags. More... | |
FlagStatus | CAN_GetFlagStatus (CAN_TypeDef *CANx, uint32_t CAN_Status) |
Checks whether the specified CAN status flag is set or not. More... | |
uint8_t | CAN_GetArbitrationLosePosition (CAN_TypeDef *CANx) |
Checks CAN arbitrations lost capture position. More... | |
uint8_t | CANFD_GetArbitrationErrorCount (CAN_TypeDef *CANx) |
Checks CAN arbitrations error count. More... | |
uint8_t | CANFD_GetDataErrorCount (CAN_TypeDef *CANx) |
Checks CAN data error count. More... | |
FlagStatus | CANFD_GetStatus (CAN_TypeDef *CANx, uint32_t CANFD_Status) |
Checks CAN FD running status. More... | |
FlagStatus | CANFD_GetError (CAN_TypeDef *CANx, uint32_t CANFD_Error) |
Checks CAN FD error. More... | |
uint8_t | CANFD_GetSecondarySamplePosition (CAN_TypeDef *CANx) |
Checks CAN FD Secondary Sample Position. More... | |
uint8_t | CAN_GetMessageCount (CAN_TypeDef *CANx) |
Get CAN number of framed in the rxbuf. More... | |
uint8_t | CAN_GetTransmitErrorCount (CAN_TypeDef *CANx) |
Get CAN Transmit Error Count. More... | |
uint8_t | CAN_GetReceiveErrorCount (CAN_TypeDef *CANx) |
Get CAN Receive Error Count. More... | |
void CAN_ClearITPendingBit | ( | CAN_TypeDef * | CANx, |
uint32_t | CAN_Flag | ||
) |
Clears the CAN's pending flags.
CANx | where x can be 1 select the CAN peripheral. |
CAN_FLAG | specifies the flag to clear. This parameter can be one of the following flags:
|
void CAN_DeInit | ( | CAN_TypeDef * | CANx | ) |
Deinitializes the CAN peripheral registers to their default reset values.
CANx | where x can be 1 select the CAN peripheral. |
void CAN_FilterInit | ( | CAN_TypeDef * | CANx, |
CAN_FilterInitTypeDef * | CAN_FilterInitStruct | ||
) |
Initializes the CAN peripheral according to the specified. parameters in the CAN_FilterInitTypeDef.
CANx | where x can be 1 select the CAN peripheral. |
CAN_FilterInitStruct | pointer to a CAN_FilterInitTypeDef structure that contains the configuration information. |
void CAN_FilterStructInit | ( | CAN_FilterInitTypeDef * | CAN_FilterInitStruct | ) |
Fills each CANFD_InitStruct member with its default value.
CANFD_InitStruct | pointer to a CANFD_InitStruct structure which will be initialized |
uint8_t CAN_GetArbitrationLosePosition | ( | CAN_TypeDef * | CANx | ) |
Checks CAN arbitrations lost capture position.
CANx | where x can be 1 select the CAN peripheral. |
FlagStatus CAN_GetFlagStatus | ( | CAN_TypeDef * | CANx, |
uint32_t | CAN_Status | ||
) |
Checks whether the specified CAN status flag is set or not.
CANx | where x can be 1 select the CAN peripheral. |
CAN_Status | specifies the flag to check. This parameter can be one of the following flags:
|
FlagStatus CAN_GetITStatus | ( | CAN_TypeDef * | CANx, |
uint32_t | CAN_Flag | ||
) |
Checks whether the specified CAN flag is set or not.
CANx | where x can be 1 select the CAN peripheral. |
CAN_FLAG | specifies the flag to check. This parameter can be one of the following flags:
|
uint8_t CAN_GetMessageCount | ( | CAN_TypeDef * | CANx | ) |
Get CAN number of framed in the rxbuf.
CANx | where x can be 1 select the CAN peripheral. |
uint8_t CAN_GetReceiveErrorCount | ( | CAN_TypeDef * | CANx | ) |
Get CAN Receive Error Count.
CANx | where x can be 1 select the CAN peripheral. |
uint8_t CAN_GetTransmitErrorCount | ( | CAN_TypeDef * | CANx | ) |
Get CAN Transmit Error Count.
CANx | where x can be 1 select the CAN peripheral. |
void CAN_Init | ( | CAN_TypeDef * | CANx, |
CAN_InitTypeDef * | CAN_InitStruct | ||
) |
Initializes the CAN peripheral according to the specified parameters in the CAN_InitStruct.
CANx | where x can be 1 select the CAN peripheral. |
CAN_InitStruct | pointer to a CAN_InitTypeDef structure that contains the configuration information for the CAN peripheral. |
void CAN_ITConfig | ( | CAN_TypeDef * | CANx, |
uint32_t | CAN_IT, | ||
FunctionalState | NewState | ||
) |
Enables or disables the specified CANx interrupts.
CANx | where x can be 1 select the CAN peripheral. |
CAN_IT | specifies the CAN interrupt sources to be enabled or disabled. This parameter can be any combination of the following values:
|
NewState | new state of the CAN interrupts. This parameter can be: ENABLE or DISABLE. |
void CAN_Receive | ( | CAN_TypeDef * | CANx, |
CAN_Msg * | Message | ||
) |
Receives a message in class mode.
CANx | where x can be 1 select the CAN peripheral. |
Message | pointer to a structure receive message. |
void CAN_Reset | ( | CAN_TypeDef * | CANx, |
FunctionalState | NewState | ||
) |
Set peripheral CAN to reset mode.
CANx | where x can be 1 select the CAN peripheral. |
NewState | new state of the CAN Reser mode. This parameter can be: ENABLE or DISABLE. |
void CAN_SendCmd | ( | CAN_TypeDef * | CANx, |
uint32_t | CAN_Cmd | ||
) |
Use peripheral CAN to send the transmission command.
CANx | where x can be 1 select the CAN peripheral. |
CAN_Cmd | specifies the CAN transmission cmd. This parameter can be one of the following flags:
|
void CAN_StructInit | ( | CAN_InitTypeDef * | CAN_InitStruct | ) |
Fills each CAN_InitStruct member with its default value.
CAN_InitStruct | pointer to a CAN_InitTypeDef structure which will be initialized |
void CAN_Transmit | ( | CAN_TypeDef * | CANx, |
CAN_Msg * | Message, | ||
uint32_t | AutoRetransmissionEnable | ||
) |
Initiates the transmission of a message in class mode.
CANx | where x can be 1 select the CAN peripheral. |
Message | pointer to a structure which contains CAN info. |
AutoRetransmissionEnable | ENABLE or DISABLE AutoRetransmission. |
uint8_t CANFD_GetArbitrationErrorCount | ( | CAN_TypeDef * | CANx | ) |
Checks CAN arbitrations error count.
CANx | where x can be 1 select the CAN peripheral. |
uint8_t CANFD_GetDataErrorCount | ( | CAN_TypeDef * | CANx | ) |
Checks CAN data error count.
CANx | where x can be 1 select the CAN peripheral. |
FlagStatus CANFD_GetError | ( | CAN_TypeDef * | CANx, |
uint32_t | CANFD_Error | ||
) |
Checks CAN FD error.
CANx | where x can be 1 select the CAN peripheral. |
CANFD_Status | specifies the error to check. This parameter can be one of the following flags:
|
uint8_t CANFD_GetSecondarySamplePosition | ( | CAN_TypeDef * | CANx | ) |
Checks CAN FD Secondary Sample Position.
CANx | where x can be 1 select the CAN peripheral. |
FlagStatus CANFD_GetStatus | ( | CAN_TypeDef * | CANx, |
uint32_t | CANFD_Status | ||
) |
Checks CAN FD running status.
CANx | where x can be 1 select the CAN peripheral. |
CANFD_Status | specifies the status to check. This parameter can be one of the following flags:
|
void CANFD_Init | ( | CAN_TypeDef * | CANx, |
CANFD_InitTypeDef * | CANFD_InitStruct | ||
) |
Initializes the CAN peripheral to FD Mode according to the specified parameters in the CAN_InitStruct.
CANx | where x can be 1 select the CAN peripheral. |
CANFD_InitTypeDef | pointer to a CANFD_InitTypeDef structure that contains the configuration information for the CAN peripheral FD Mode. |
void CANFD_Receive | ( | CAN_TypeDef * | CANx, |
CANFD_Msg * | Message | ||
) |
Receives a message in FD mode.
CANx | where x can be 1 select the CAN peripheral. |
Message | pointer to a structure receive message. |
void CANFD_StructInit | ( | CANFD_InitTypeDef * | CANFD_InitStruct | ) |
Fills each CANFD_InitTypeDef member with its default value.
CANFD_InitStruct | pointer to a CANFD_InitTypeDef structure which will be initialized |
void CANFD_Transmit | ( | CAN_TypeDef * | CANx, |
CANFD_Msg * | Message, | ||
uint32_t | AutoRetransmissionEnable | ||
) |
Initiates the transmission of a message in FD mode.
CANx | where x can be 1 select the CAN peripheral. |
Message | pointer to a structure which contains CAN FD info. |
AutoRetransmissionEnable | ENABLE or DISABLE AutoRetransmission. |