[[ファームウェア関数一覧>ファームウェア関数一覧#n7b42187]] *CAN_FilterInit [#c021e67e] #contents **ヘッダ宣言 [#edea9c32] **関数プロトタイプ [#i32060a3] void CAN_FilterInit(CAN_FilterInitTypeDef* CAN_FilterInitStruct) **動作 [#vf8a718e] -CAN_FilterInitStruct構造体のパラメータに従ってCAN周辺回路を初期化します。 **引数 [#s5cbb242] -CAN_FilterInitStruct '''tm32f10x_can.h'''ファイルで定義されている構造体です。 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; |CENTER:CAN_FilterMode|CENTER:説明|h |CAN_FilterMode_IdMask|id/mask mode| |CAN_FilterMode_IdList|identifier list mode| --CAN_FilterScale&br; フィルタスケールの設定ほ以下のマクロから選択します。&br; &br; |CENTER:CAN_FilterScale|CENTER:説明|h |CAN_FilterScale_Two16bit|Two 16-bit filters| |CAN_FilterScale_One32bit|One 32-bit filter| --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; --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; --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; --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; --CAN_FilterFIFO&br; FIFO (0 又は 1) のどちらを割り付けるか以下のマクロで選択します。&br; &br; |CENTER:CAN_FilterFIFO|CENTER:説明|h |CAN_FilterFIFO0|Filter FIFO 0 filter x に割り付けます| |CAN_FilterFIFO1|Filter FIFO 1 filter x に割り付けます| --CAN_FilterActivation&br; フィルタの有効・無効を行います。&br; &br; |CENTER:CAN_FilterActivation|CENTER:説明|h |ENABLE|有効| |DISABLE|無効| **戻り値 [#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] -