目录
https://blog.csdn.net/m0_56344230/article/details/118915769
继续上一篇的分析:
6、参考代码
就是按照文档中的流程写得,代码挺多,先去找从standby mode切换到normal mode,EnterNormalOperation();
/// Transition to normal operation
/** This function enter Normal Mode by writing the \link #MCR_MC_MASK Mode Control (MC)\endlink bits in the
* \link #MCR_ADDRESS_MASK Mode Control Register (MCR)\endlink. After that the TransceiverControl() function
* is called
* \author jfleis
* \version 1.0 initial version
* \date 28.5.2009
*/
void EnterNormalOperation(){
word UJA107xA_MCR;
// Change to normal mode
UJA107xA_MCR = MCR_Normal; /* = MCR_ADDRESS_MASK | MCR_MC_MASK | MCR_ENC_MASK | MCR_WBC_MASK; */
SpiSend(&UJA107xA_MCR);
// Enable Transceiver
TransceiverControl();
}
行12:想知道怎么配置的需要先找下MCR_Normal的赋值,在函数InitApplication()找到了它的赋值,还有其他模式的赋值。
byte InitApplication(void){
// Init all global variables
OverflowCnt=0;
OperationModeChangeCnt = 0;
PreviousOperationMode