J1939 Documentation
Version 4.16.00
|
This module holds all functions for the initialisation and control of the J1939 stack. Some functions of this module need to be adopted to the application:
These functions are located in the j1939_user.c file.
Macros | |
#define | J1939_CONF_BITRATE_250K (uint16_t)(0x0000) |
#define | J1939_CONF_BITRATE_500K (uint16_t)(0x0001) |
#define | J1939_CONF_FD (uint16_t)(0x0100) |
#define | J1939_CONF_NMEA (uint16_t)(0x0200) |
Functions | |
void | J1939_MgrEventRcvTimeout (uint8_t ubNetV, uint32_t ulPgnV) |
uint8_t | J1939_MgrGetAddress (uint8_t ubNetV) |
uint8_t | J1939_MgrGetDestination (uint8_t ubNetV) |
J1939_Status_tv | J1939_MgrInit (uint8_t ubCanIfV, uint8_t ubNetV, uint8_t ubAddressV, uint16_t uwConfigV) |
void | J1939_MgrOnBusOff (uint8_t ubNetV) |
J1939_Status_tv | J1939_MgrProcess (void) |
J1939_Status_tv | J1939_MgrRelease (uint8_t ubNetV) |
void | J1939_MgrSetAddress (uint8_t ubNetV, uint8_t ubAddressV) |
J1939_Status_tv | J1939_MgrStart (uint8_t ubNetV) |
void J1939_MgrEventRcvTimeout | ( | uint8_t | ubNetV, |
uint32_t | ulPgnV ) |
[in] | ubNetV | J1939 Network channel |
[in] | ulPgnV | Parameter Group Number |
j1939_user.c
.This function is called by the stack if a timeout of a receive PDU occurs. The parameter uwPgnV defines the Parameter Group Number of the PDU where the timeout occurred.
uint8_t J1939_MgrGetAddress | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | J1939 Network channel |
The function returns the actual ECU address.
uint8_t J1939_MgrGetDestination | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | J1939 Network channel |
The function returns the destination address of the current PDU1 request.
J1939_Status_tv J1939_MgrInit | ( | uint8_t | ubCanIfV, |
uint8_t | ubNetV, | ||
uint8_t | ubAddressV, | ||
uint16_t | uwConfigV ) |
[in] | ubNetV | J1939 Network channel |
[in] | ubCanIfV | Physical CAN interface |
[in] | ubAddressV | Initial CA address |
[in] | uwConfigV | J1939 configuration |
The function is responsible for initialisation of the J1939 stack. The parameter ubAddressV denotes the initial CA address. The address can be in the range from 0 to 253. The parameter uwConfigV allows configuration of the stack during run-time. The bit-rate can be selected by either J1939_CONF_BITRATE_250K (default) or J1939_CONF_BITRATE_500K.
void J1939_MgrOnBusOff | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | J1939 Network channel |
j1939_user.c
.This function is called by the stack on a bus-off condition.
J1939_Status_tv J1939_MgrProcess | ( | void | ) |
Handle J1939 messages if they are not served within the CAN interrupt. Please note that this function serves all logical J1939 networks.
J1939_Status_tv J1939_MgrRelease | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | J1939 Network channel |
This function stops the J1939 protocol stack. Messages on the CAN bus are not further processed.
void J1939_MgrSetAddress | ( | uint8_t | ubNetV, |
uint8_t | ubAddressV ) |
[in] | ubNetV | J1939 Network channel |
[in] | ubAddressV | New ECU address |
The function sets the ECU address. The parameter ubAddressV must be in the range from 0 to 253.
J1939_Status_tv J1939_MgrStart | ( | uint8_t | ubNetV | ) |
[in] | ubNetV | J1939 Network channel |
This routine starts the J1939 protocol stack, i.e. the Address Claim message is sent.