CAN_Init
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
|
ログイン
]
開始行:
[[ファームウェア関数一覧>ファームウェア関数一覧#n7b42187]]
*CAN_Init [#r91bb04c]
#contents
**ヘッダ宣言 [#zb0adb30]
**関数プロトタイプ [#tb8dbac7]
uint8_t CAN_Init(CAN_InitTypeDef* CAN_InitStruct)
**動作 [#d12c16eb]
-CAN周辺回路を初期化します
**引数 [#h476d710]
-
'''stm32f10x_can.h'''で定義されている構造体です。
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&br;
TTCM((time triggered communication mode))使用の有効・無効...
&br;
#include(Macro/CAN_TTCM,notitle)
&br;
--CAN_ABOM&br;
ABOM((automatic bus-off management))使用の有効・無効化を...
&br;
#include(Macro/CAN_ABOM,notitle)
&br;
--CAN_AWUM&br;
AWUM((automatic wake-up mode))使用の有効・無効化を指定し...
&br;
#include(Macro/CAN_AWUM,notitle)
&br;
--CAN_NART&br;
NART((no-automatic retransmission mode))使用の有効・無効...
&br;
#include(Macro/CAN_NART,notitle)
&br;
--CAN_RFLM&br;
RFLM((Receive Fifo Locked mode))使用の有効・無効化を指定...
&br;
#include(Macro/CAN_RFLM,notitle)
&br;
--CAN_TXFP&br;
TXFP((the transmit FIFO priority))使用の有効・無効化を指...
&br;
#include(Macro/CAN_TXFP,notitle)
&br;
--CAN_Mode
CANの運用モードを設定します。&br;
&br;
#include(Macro/CAN_Mode,notitle)
&br;
--CAN_SJW&br;
CAN_SJW configures the maximum number of time quanta the ...
&br;
#include(Macro/CAN_SJW,notitle)
&br;
--CAN_BS1&br;
CAN_BS1 configures the number of time quanta in Bit Segme...
&br;
#include(Macro/CAN_BS1,notitle)
&br;
--CAN_BS2&br;
CAN_BS2 configures the number of time quanta in Bit Segme...
&br;
#include(Macro/CAN_BS2,notitle)
&br;
--CAN_Prescaler&br;
CAN_Prescaler configures the length of a time quantum.&br;
設定できる値は1から1024までの間です。&br;
**戻り値 [#s1d5ae95]
-CAN_Init&br;
&br;
#include(Macro/CAN_Init,notitle)
**場所 [#nb1ba73e]
**呼び出し関数 [#r4d4dfba]
-無し
**サンプル [#za99025b]
/* Initialize the CAN as 1Mb/s in normal mode, receive F...
*/
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);
**参照 [#td68aa82]
-
終了行:
[[ファームウェア関数一覧>ファームウェア関数一覧#n7b42187]]
*CAN_Init [#r91bb04c]
#contents
**ヘッダ宣言 [#zb0adb30]
**関数プロトタイプ [#tb8dbac7]
uint8_t CAN_Init(CAN_InitTypeDef* CAN_InitStruct)
**動作 [#d12c16eb]
-CAN周辺回路を初期化します
**引数 [#h476d710]
-
'''stm32f10x_can.h'''で定義されている構造体です。
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&br;
TTCM((time triggered communication mode))使用の有効・無効...
&br;
#include(Macro/CAN_TTCM,notitle)
&br;
--CAN_ABOM&br;
ABOM((automatic bus-off management))使用の有効・無効化を...
&br;
#include(Macro/CAN_ABOM,notitle)
&br;
--CAN_AWUM&br;
AWUM((automatic wake-up mode))使用の有効・無効化を指定し...
&br;
#include(Macro/CAN_AWUM,notitle)
&br;
--CAN_NART&br;
NART((no-automatic retransmission mode))使用の有効・無効...
&br;
#include(Macro/CAN_NART,notitle)
&br;
--CAN_RFLM&br;
RFLM((Receive Fifo Locked mode))使用の有効・無効化を指定...
&br;
#include(Macro/CAN_RFLM,notitle)
&br;
--CAN_TXFP&br;
TXFP((the transmit FIFO priority))使用の有効・無効化を指...
&br;
#include(Macro/CAN_TXFP,notitle)
&br;
--CAN_Mode
CANの運用モードを設定します。&br;
&br;
#include(Macro/CAN_Mode,notitle)
&br;
--CAN_SJW&br;
CAN_SJW configures the maximum number of time quanta the ...
&br;
#include(Macro/CAN_SJW,notitle)
&br;
--CAN_BS1&br;
CAN_BS1 configures the number of time quanta in Bit Segme...
&br;
#include(Macro/CAN_BS1,notitle)
&br;
--CAN_BS2&br;
CAN_BS2 configures the number of time quanta in Bit Segme...
&br;
#include(Macro/CAN_BS2,notitle)
&br;
--CAN_Prescaler&br;
CAN_Prescaler configures the length of a time quantum.&br;
設定できる値は1から1024までの間です。&br;
**戻り値 [#s1d5ae95]
-CAN_Init&br;
&br;
#include(Macro/CAN_Init,notitle)
**場所 [#nb1ba73e]
**呼び出し関数 [#r4d4dfba]
-無し
**サンプル [#za99025b]
/* Initialize the CAN as 1Mb/s in normal mode, receive F...
*/
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);
**参照 [#td68aa82]
-
ページ名: