uint8_t CAN_Init(CAN_InitTypeDef* CAN_InitStruct)
typedef struct { FunctionnalState CAN_TTCM; FunctionnalState CAN_ABOM; FunctionnalState CAN_AWUM; FunctionnalState CAN_NART; FunctionnalState CAN_RFLM; FunctionnalState CAN_TXFP; uint8_t CAN_Mode; uint8_t CAN_SJW; uint8_t CAN_BS1; uint8_t CAN_BS2; uint16_t CAN_Prescaler; } CAN_InitTypeDef;
CAN_TTCM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_ABOM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_AWUM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_AWUM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_AWUM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_AWUM | 説明 |
ENABLE | 有効 |
DISABLE | 無効 |
CAN_Mode | 説明 |
CAN_Mode_Normal | CAN hardware operates in normal mode |
CAN_Mode_Silent | CAN hardware operates in silent mode |
CAN_Mode_LoopBack | CAN hardware operates in loop back mode |
CAN_Mode_Silent_LoopBack | CAN hardware operates in loop back combined with silent mode |
CAN_SJW Description | 説明 |
CAN_SJW_1tq | Resynchronization Jump Width=1 time quantum |
CAN_SJW_2tq | Resynchronization Jump Width= 2 time quantum |
CAN_SJW_3tq | Resynchronization Jump Width= 3 time quantum |
CAN_SJW_4tq | Resynchronization Jump Width= 4 time quantum |
CAN_BS1 | 説明 |
CAN_BS1_1tq | Bit Segment 1= 1 time quantum |
CAN_BS1_2tq | Bit Segment 1= 2 time quantum |
CAN_BS1_3tq | Bit Segment 1= 3 time quantum |
CAN_BS1_4tq | Bit Segment 1= 4 time quantum |
CAN_BS1_5tq | Bit Segment 1= 5 time quantum |
CAN_BS1_6tq | Bit Segment 1= 6 time quantum |
CAN_BS1_7tq | Bit Segment 1= 7 time quantum |
CAN_BS1_8tq | Bit Segment 1= 8 time quantum |
CAN_BS1_9tq | Bit Segment 1= 9 time quantum |
CAN_BS1_10tq | Bit Segment 1= 10 time quantum |
CAN_BS1_11tq | Bit Segment 1= 11 time quantum |
CAN_BS1_12tq | Bit Segment 1= 12 time quantum |
CAN_BS1_13tq | Bit Segment 1= 13 time quantum |
CAN_BS1_14tq | Bit Segment 1= 14 time quantum |
CAN_BS1_15tq | Bit Segment 1= 15 time quantum |
CAN_BS1_16tq | Bit Segment 1= 16 time quantum |
CAN_BS2 | 説明 |
CAN_BS2_1tq | Bit Segment 2= 1 time quantum |
CAN_BS2_2tq | Bit Segment 2= 2 time quantum |
CAN_BS2_3tq | Bit Segment 2= 3 time quantum |
CAN_BS2_4tq | Bit Segment 2= 4 time quantum |
CAN_BS2_5tq | Bit Segment 2= 5 time quantum |
CAN_BS2_6tq | Bit Segment 2= 6 time quantum |
CAN_BS2_7tq | Bit Segment 2= 7 time quantum |
CAN_BS2_8tq | Bit Segment 2= 8 time quantum |
CAN_Init | 説明 |
CANINITFAILED | 初期化に失敗しました |
CANINITOK | 初期化に成功しました |
/* Initialize the CAN as 1Mb/s in normal mode, receive FIFO locked: */ CAN_InitTypeDef CAN_InitStructure; CAN_InitStructure.CAN_TTCM = DISABLE; CAN_InitStructure.CAN_ABOM = DISABLE; CAN_InitStructure.CAN_AWUM = DISABLE; CAN_InitStructure.CAN_NART = DISABLE; CAN_InitStructure.CAN_RFLM = ENABLE; CAN_InitStructure.CAN_TXFP = DISABLE; CAN_InitStructure.CAN_Mode = CAN_Mode_Normal; CAN_InitStructure.CAN_BS1 = CAN_BS1_4tq; CAN_InitStructure.CAN_BS2 = CAN_BS2_3tq; CAN_InitStructure.CAN_Prescaler = 0; CAN_Init(&CAN_InitStructure);