[[ファームウェア関数一覧>ファームウェア関数一覧#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 { uint_t8 CAN_FilterNumber; uint_t8 CAN_FilterMode; uint_t8 CAN_FilterScale; uint_t16 CAN_FilterIdHigh; uint_t16 CAN_FilterIdLow; uint_t16 CAN_FilterMaskIdHigh; uint_t16 CAN_FilterMaskIdLow; uint_t16 CAN_FilterFIFOAssignment; FunctionalState CAN_FilterActivation; } CAN_FilterInitTypeDef; --CAN_FilterNumber CAN_FilterNumber selects the filter which will be initialized. It ranges from 0 to 13. |CAN_FilterMode Description CAN_FilterMode_IdMask id/mask mode CAN_FilterMode_IdList identifier list mode --CAN_FilterMode CAN_FilterScale Description CAN_FilterScale_Two16bit Two 16-bit filters CAN_FilterScale_One32bit One 32-bit filter --CAN_FilterScale CAN_FilterIdHigh is used to select the filter identification number (MSBs for a 32-bit configuration, first one for a 16-bit configuration). 0x0000 to 0xFFFF --CAN_FilterIdHigh CAN_FilterIdLow is used to select the filter identification number (LSBs for a 32-bit configuration, second one for a 16-bit configuration). --CAN_FilterIdLow 0x0000 to 0xFFFF --CAN_FilterMaskIdHigh 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). It ranges from 0x0000 to 0xFFFF. --CAN_FilterMaskIdLow CAN_FilterMaskIdLow 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). It ranges from 0x0000 to 0xFFFF. --CAN_FilterFIFOAssignment CAN_FilterFIFO Description CAN_FilterFIFO0 Filter FIFO 0 assignment for filter x CAN_FilterFIFO1 Filter FIFO 1assignment for filter x --FunctionalState CAN_FilterActivation CAN_FilterActivation CAN_FilterActivation enables or disables the filter. It can be set either to ENABLE or 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] -