Go to the source code of this file.
Defines | |
#define | FOSC 4000 |
Functions | |
void | stopped (void) |
void | preOperational (void) |
void | operational (void) |
void | initialisation (void) |
void | InterruptHandlerHigh (void) |
This file contains the user-code. Therefore the user has to put his c-code into the correct state-machine functions.
|
This define is important especially for microcontrollers: it tells the slavelib the CPU speed. This is neccessary for setting up timers for heartbeat and the CAN controller (baudrate setting) |
|
This function is called automatically by the statemachine, when the microcontroller powers up. after execution of this function the state machine automatically changes into pre-operational state. So don't make loops here (while( getState( ) == INITIALISATION_NODE) ) |
|
|
|
The statemachine calles this function, if a NMT message was received from the NMT master that tells this node to change into operational state. in this state the CANopen device sends/receives PDOs and all other message types (but not: Boot-Up Object and LSS Objects) this function must contain a while-loop like this: while( bStateMachineState == OPERATIONAL ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); // user defined code follows here (or somewhere else in the while-loop) } |
|
This function is called automatically by the statemachine, when the microcontroller powers up. after execution of the function initialisation the state machine changes into pre-operational state. In this function you have to loop with a while-loop: while( bStateMachineState == PRE_OPERATIONAL ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); } |
|
This function is called, when a remote node tells this node to stopp this node. in this state, no SDO, no PDO, no SYNC, no Time stamp, no emergency messages are allowed to send/receive --> only NMT, LSS, and (in some cases) Error control Objects can be processed In this function you have to loop with a while-loop: while( bStateMachineState == STOPPED ) { // because sending of heartbeat must start just after bootup, lets do that... processLifeGuard( ); proccessRxCanMessages( ); } |