[[ファームウェア関数一覧>ファームウェア関数一覧#n7b42187]] *CAN_FilterInit [#c021e67e] #contents **ヘッダ宣言 [#edea9c32] **関数プロトタイプ [#i32060a3] void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct) **動作 [#vf8a718e] -CAN_FilterInitStruct構造体のパラメータに従ってCAN周辺回路を初期化します。 **引数 [#s5cbb242] -CAN_FilterInitStruct '''tm32f10x_can.h'''ファイルで定義されている構造体です。 -CAN_FilterInitStruct&br; '''tm32f10x_can.h'''ファイルで定義されている構造体です。&br; typedef struct { uint8_t CAN_FilterNumber; uint8_t CAN_FilterMode; uint8_t CAN_FilterScale; uint16_t CAN_FilterIdHigh; uint16_t CAN_FilterIdLow; uint16_t CAN_FilterMaskIdHigh; uint16_t CAN_FilterMaskIdLow; uint16_t CAN_FilterFIFOAssignment; FunctionalState CAN_FilterActivation; } CAN_FilterInitTypeDef; --CAN_FilterNumber&br; CAN_FilterNumber selects the filter which will be initialized. &br; 指定できる範囲は0から13の間です。&br; &br; --CAN_FilterMode&br; フィルタモードの初期化を以下のマクロから選択します。&br; &br; #include(Macro/CAN_FilterMode,notitle) &br; --CAN_FilterScale&br; フィルタスケールの設定を以下のマクロから選択します。&br; &br; #include(Macro/CAN_FilterScale,notitle) &br; --CAN_FilterIdHigh&br; CAN_FilterIdHigh is used to select the filter identification number (MSBs for a 32-bit configuration, first one for a 16-bit configuration).&br; 選択できる範囲は0x0000 から 0xFFFF の間です。&br; &br; --CAN_FilterIdLow&br; CAN_FilterIdLow is used to select the filter identification number (LSBs for a 32-bit configuration, second one for a 16-bit configuration).&br; 選択できる範囲は0x0000 から 0xFFFF の間です。&br; &br; --CAN_FilterMaskIdHigh&br; CAN_FilterMaskIdHigh is used to select the filter mask number or identification number,according to the mode (MSBs for a 32-bit configuration, first one for a 16-bit configuration).&br; 選択できる範囲は0x0000 から 0xFFFF の間です。&br; &br; --CAN_FilterMaskIdLow&br; CAN_FilterMaskIdLow is used to select the filter mask number or identification number,according to the mode (LSBs for a 32-bit configuration, second one for a 16-bit configuration). &br; 選択できる範囲は0x0000 から 0xFFFF の間です。&br; &br; --CAN_FilterFIFO&br; FIFO (0 又は 1) のどちらを割り付けるか以下のマクロで選択します。&br; &br; #include(Macro/CAN_FilterFIFO,notitle) &br; --CAN_FilterActivation&br; フィルタの有効・無効を行います。&br; &br; #include(Macro/CAN_FilterActivation,notitle) &br; **戻り値 [#h134c5da] -無し **場所 [#d13dbabe] **呼び出し関数 [#k687b885] -無し **サンプル [#w3192ba3] /* Initialize the CAN filter 2 */ CAN_FilterInitTypeDef CAN_FilterInitStructure; CAN_FilterInitStructure.CAN_FilterNumber = 2; CAN_FilterInitStructure.CAN_FilterMode = CAN_FilterMode_IdMask; CAN_FilterInitStructure.CAN_FilterScale = CAN_FilterScale_One32bit; CAN_FilterInitStructure.CAN_FilterIdHigh = 0x0F0F; CAN_FilterInitStructure.CAN_FilterIdLow = 0xF0F0; CAN_FilterInitStructure.CAN_FilterMaskIdHigh = 0xFF00; CAN_FilterInitStructure.CAN_FilterMaskIdLow = 0x00FF; CAN_FilterInitStructure.CAN_FilterFIFO = CAN_FilterFIFO0; CAN_FilterInitStructure.CAN_FilterActivation = ENABLE; CAN_FilterInit(&CAN_InitStructure); **参照 [#wd39cc89] -