The J1939 protocol stack is initialized with J1939_MgrInit(). This routine will setup the CAN controller and initialize all necessary services. Afterwards the stack can be started by calling the J1939_MgrStart() function.
In summary four steps are necessary to run the J1939 protocol stack:
The initialization functions of the J1939 protocol stack have to be executed prior to any other API functions.
Initialization of J1939 protocol stack
void MyJ1939_Init(void)
{
}
@ eCP_CHANNEL_1
Definition canpie.h:732
#define J1939_CONF_BITRATE_250K
Definition j1939_mgr.h:79
@ eJ1939_NET_1
Definition j1939_defs.h:117
J1939_PGN_Entry_ts atsPgnListEcu1[]
J1939_Status_tv J1939_MgrInit(uint8_t ubCanIfV, uint8_t ubNetV, uint8_t ubAddressV, uint16_t uwConfigV)
J1939_Status_tv J1939_MgrStart(uint8_t ubNetV)
J1939_Status_tv J1939_PgnAddList(uint8_t ubNetV, J1939_PGN_Entry_ts *ptsPgnListV)
void J1939_TmrEvent(void)
Execute Timer-based Services.
@ eTMR_CTRL_START
Definition mc_tmr.h:164
void McTmrInit(void)
Initialise Timer.
Status_tv McTmrFunctionInit(TmrHandler_fn fnHandlerV, uint32_t ulTicksV, uint8_t ubControlV)
Initialise function timer.
uint32_t McTmrTimeToTicks(uint32_t ulTimeV)
Convert time value to ticks.
After calling J1939_MgrStart() the J1939 Protocol Stack is running and an Address Claiming Message (ACM) is send on the CAN bus (i.e. the identifier 18EEFF00h + ECU-address).