Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions gd32c10x/standard_peripheral/Include/gd32c10x_can.h
Original file line number Diff line number Diff line change
Expand Up @@ -662,12 +662,6 @@ typedef enum

#define CAN_STATE_PENDING ((uint32_t)0x00000000U) /*!< CAN pending */

/* CAN communication mode */
#define CAN_NORMAL_MODE ((uint8_t)0x00U) /*!< normal communication mode */
#define CAN_LOOPBACK_MODE ((uint8_t)0x01U) /*!< loopback communication mode */
#define CAN_SILENT_MODE ((uint8_t)0x02U) /*!< silent communication mode */
#define CAN_SILENT_LOOPBACK_MODE ((uint8_t)0x03U) /*!< loopback and silent communication mode */

/* CAN resynchronisation jump width */
#define CAN_BT_SJW_1TQ ((uint8_t)0x00U) /*!< 1 time quanta */
#define CAN_BT_SJW_2TQ ((uint8_t)0x01U) /*!< 2 time quanta */
Expand Down Expand Up @@ -764,9 +758,6 @@ typedef enum
#define CAN_ESI_DOMINANT (0U) /*!< transmit the dominant bit in ESI phase */
#define CAN_ESI_RECESSIVE (1U) /*!< transmit the recessive bit in ESI phase */

/* CAN timeout */
#define CAN_TIMEOUT ((uint32_t)0x0000FFFFU) /*!< timeout value */

/* interrupt enable bits */
#define CAN_INT_TME CAN_INTEN_TMEIE /*!< transmit mailbox empty interrupt enable */
#define CAN_INT_RFNE0 CAN_INTEN_RFNEIE0 /*!< receive FIFO0 not empty interrupt enable */
Expand Down
2 changes: 1 addition & 1 deletion gd32c10x/standard_peripheral/Include/gd32c10x_timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ void timer_deinit(uint32_t timer_periph);
/* initialize TIMER init parameter struct */
void timer_struct_para_init(timer_parameter_struct* initpara);
/* initialize TIMER counter */
void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara);
void timer_initialize(uint32_t timer_periph, timer_parameter_struct* initpara);
/* enable a timer */
void timer_enable(uint32_t timer_periph);
/* disable a timer */
Expand Down
9 changes: 9 additions & 0 deletions gd32c10x/standard_peripheral/Source/gd32c10x_can.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ OF SUCH DAMAGE.
#include "gd32c10x_can.h"
#include <stdlib.h>

/* CAN communication mode */
#define CAN_NORMAL_MODE ((uint8_t)0x00U) /*!< normal communication mode */
#define CAN_LOOPBACK_MODE ((uint8_t)0x01U) /*!< loopback communication mode */
#define CAN_SILENT_MODE ((uint8_t)0x02U) /*!< silent communication mode */
#define CAN_SILENT_LOOPBACK_MODE ((uint8_t)0x03U) /*!< loopback and silent communication mode */

/* CAN timeout */
#define CAN_TIMEOUT ((uint32_t)0x0000FFFFU) /*!< timeout value */
Comment on lines +39 to +46
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


#define CAN_ERROR_HANDLE(s) do{}while(1)

/* BS1[6:0] + BS2[4:0] */
Expand Down
2 changes: 1 addition & 1 deletion gd32c10x/standard_peripheral/Source/gd32c10x_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void timer_struct_para_init(timer_parameter_struct* initpara)
\param[out] none
\retval none
*/
void timer_init(uint32_t timer_periph, timer_parameter_struct* initpara)
void timer_initialize(uint32_t timer_periph, timer_parameter_struct* initpara)
{
/* configure the counter prescaler value */
TIMER_PSC(timer_periph) = (uint16_t)initpara->prescaler;
Expand Down