nico@215: nico@215:
nico@215:#include <string.h>
#include <stdio.h>
#include <../include/hcs12/asm-m68hc12/portsaccess.h>
#include <../include/hcs12/asm-m68hc12/ports_def.h>
#include <../include/hcs12/asm-m68hc12/ports.h>
#include <../include/hcs12/interrupt.h>
#include "can.h"
nico@215: Include dependency graph for applicfg.h:
nico@215: Go to the source code of this file.
Defines | |
#define | CANOPEN_BIG_ENDIAN 1 |
Define the architecture : little_endian or big_endian. | |
#define | BUS_CLOCK 8 |
#define | SERIAL_SCI0_BAUD_RATE 38400 |
Configuration of the serials port SCI0 and SCI1. | |
#define | SERIAL_SCI1_BAUD_RATE 9600 |
#define | INTEGER8 signed char |
#define | INTEGER16 short |
#define | INTEGER24 |
#define | INTEGER32 long |
#define | INTEGER40 |
#define | INTEGER48 |
#define | INTEGER56 |
#define | INTEGER64 |
#define | UNS8 unsigned char |
#define | UNS16 unsigned short |
#define | UNS32 unsigned long |
#define | UNS24 |
#define | UNS40 |
#define | UNS48 |
#define | UNS56 |
#define | UNS64 |
#define | TIMEVAL UNS32 |
#define | TIMEVAL_MAX 0xFFFF |
#define | MS_TO_TIMEVAL(ms) (ms * 250) |
#define | US_TO_TIMEVAL(us) (us>>2) |
#define | REAL32 float |
#define | REAL64 double |
#define | MSG_ERR(num, str, val) |
Definition of MSG_ERR. | |
#define | MSG_WAR(num, str, val) |
Definition of MSG_WAR. | |
Functions | |
void | initSCI_0 (void) |
Initialisation of the serial port 0. | |
void | initSCI_1 (void) |
Initialisation of the serial port 1. | |
char * | hex_convert (char *buf, unsigned long value, char lastCar) |
void | printSCI_str (char sci, const char *str) |
void | printSCI_nbr (char sci, unsigned long nbr, char lastCar) |
void | initPLL (void) |
void | initHCS12 (void) |
Put here all the code to init the HCS12. |
#define BUS_CLOCK 8 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 65 of file applicfg.h. nico@215:
nico@215: Referenced by initSCI_0(), and initSCI_1(). nico@215:
#define CANOPEN_BIG_ENDIAN 1 | nico@215:
nico@215: Define the architecture : little_endian or big_endian. nico@215:
nico@215: nico@215:
nico@215: Definition at line 55 of file applicfg.h. nico@215:
nico@215: Referenced by _writeNetworkDict(), and getReadResultNetworkDict(). nico@215:
#define INTEGER16 short | nico@215:
nico@215: nico@215:
nico@215: Definition at line 130 of file applicfg.h. nico@215:
#define INTEGER24 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 131 of file applicfg.h. nico@215:
#define INTEGER32 long | nico@215:
nico@215: nico@215:
nico@215: Definition at line 132 of file applicfg.h. nico@215:
#define INTEGER40 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 133 of file applicfg.h. nico@215:
#define INTEGER48 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 134 of file applicfg.h. nico@215:
#define INTEGER56 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 135 of file applicfg.h. nico@215:
#define INTEGER64 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 136 of file applicfg.h. nico@215:
#define INTEGER8 signed char | nico@215:
nico@215: nico@215:
nico@215: Definition at line 129 of file applicfg.h. nico@215:
etisserant@240: Referenced by CopyBits(). etisserant@240:
#define MS_TO_TIMEVAL | nico@215:( | nico@215:ms | nico@215:nico@215: | ) | nico@215:(ms * 250) | nico@215:
nico@215: nico@215:
nico@215: Definition at line 156 of file applicfg.h. nico@215:
etisserant@240: Referenced by _sendPDOevent(), heartbeatInit(), and proceedNODE_GUARD(). etisserant@240:
#define MSG_ERR | nico@215:( | nico@215:num, | |||
nico@215: | nico@215: | str, | |||
nico@215: | nico@215: | val | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: Definition of MSG_ERR. nico@215:
nico@215: nico@215:
nico@215: Definition at line 177 of file applicfg.h. nico@215:
etisserant@240: Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), gene_SYNC_heartbeatError(), getReadResultNetworkDict(), getWriteResultNetworkDict(), lineToSDO(), proceedPDO(), proceedSDO(), SDOTimeoutAlarm(), SDOtoLine(), sendPDOrequest(), sendSDO(), and setSDOlineRestBytes(). etisserant@240:
#define MSG_WAR | nico@215:( | nico@215:num, | |||
nico@215: | nico@215: | str, | |||
nico@215: | nico@215: | val | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: Definition of MSG_WAR. nico@215:
nico@215: nico@215:
nico@215: Definition at line 190 of file applicfg.h. nico@215:
etisserant@240: Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), accessDictionaryError(), buildPDO(), canAddIdToFilter(), canInit1Filter(), canInitClock(), canInitFilter(), canMsgTransmit(), canSleepModeQ(), canSleepWupMode(), closeSDOtransfer(), DelAlarm(), failedSDO(), gene_SYNC_initialisation(), gene_SYNC_operational(), gene_SYNC_preOperational(), gene_SYNC_stopped(), initHCS12(), initSDOline(), initSensor(), main(), masterSendNMTnodeguard(), masterSendNMTstateChange(), objdictToSDOline(), proceedNMTstateChange(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), ProducerHearbeatAlarm(), resetSDOline(), SDOlineToObjdict(), SDOTimeoutAlarm(), sendPDOrequest(), sendSDO(), sendSDOabort(), sendSYNC(), and slaveSendBootUp(). etisserant@240:
#define REAL32 float | nico@215:
nico@215: nico@215:
nico@215: Definition at line 161 of file applicfg.h. nico@215:
#define REAL64 double | nico@215:
nico@215: nico@215:
nico@215: Definition at line 162 of file applicfg.h. nico@215:
#define SERIAL_SCI0_BAUD_RATE 38400 | nico@215:
nico@215: Configuration of the serials port SCI0 and SCI1. nico@215:
nico@215: nico@215:
nico@215: Definition at line 82 of file applicfg.h. nico@215:
nico@215: Referenced by initSCI_0(). nico@215:
#define SERIAL_SCI1_BAUD_RATE 9600 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 83 of file applicfg.h. nico@215:
nico@215: Referenced by initSCI_1(). nico@215:
#define TIMEVAL UNS32 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 150 of file applicfg.h. nico@215:
nico@215: Referenced by class_timers::get_timer(), heartbeatInit(), proceedNODE_GUARD(), StartTimerLoop(), TimeDispatch(), and class_timers::timer_loop_thread_proc(). nico@215:
#define TIMEVAL_MAX 0xFFFF | nico@215:
nico@215: nico@215:
nico@215: Definition at line 153 of file applicfg.h. nico@215:
nico@215: Referenced by class_timers::set_timer(), setTimer(), class_timers::start_timer_thread(), TimeDispatch(), and class_timers::timer_loop_thread_proc(). nico@215:
#define UNS16 unsigned short | nico@215:
nico@215: nico@215:
nico@215: Definition at line 140 of file applicfg.h. nico@215:
etisserant@240: Referenced by _readNetworkDict(), _sendPDOevent(), _writeNetworkDict(), buildPDO(), decompo_dcf(), gene_SYNC_operational(), heartbeatInit(), PDOInit(), PDOStop(), proceedPDO(), proceedSDO(), sendPDOrequest(), sendSDO(), setNodeId(), and setState(). etisserant@240:
#define UNS24 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 142 of file applicfg.h. nico@215:
#define UNS32 unsigned long | nico@215:
nico@215: nico@215:
nico@215: Definition at line 141 of file applicfg.h. nico@215:
etisserant@240: Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), ConsumerHearbeatAlarm(), decompo_dcf(), heartbeatInit(), main(), objdictToSDOline(), PDOInit(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), ReadSDO(), RegisterSetODentryCallBack(), SDOlineToObjdict(), sendPDOrequest(), sendSDO(), setNodeId(), setState(), TestMaster_initialisation(), and TestMaster_post_TPDO(). etisserant@240:
#define UNS40 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 143 of file applicfg.h. nico@215:
#define UNS48 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 144 of file applicfg.h. nico@215:
#define UNS56 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 145 of file applicfg.h. nico@215:
#define UNS64 | nico@215:
nico@215: nico@215:
nico@215: Definition at line 146 of file applicfg.h. etisserant@240:
etisserant@240: Referenced by _sendPDOevent(). etisserant@240:
#define UNS8 unsigned char | nico@215:
nico@215: nico@215:
nico@215: Definition at line 139 of file applicfg.h. nico@215:
etisserant@240: Referenced by _getODentry(), _readNetworkDict(), _sendPDOevent(), _setODentry(), _writeNetworkDict(), buildPDO(), canAddIdToFilter(), canInit1Filter(), canMsgTransmit(), canReceive_driver(), canSend(), canSend_driver(), closeSDOtransfer(), ConsumerHearbeatAlarm(), CopyBits(), decompo_dcf(), f_can_receive(), failedSDO(), gene_SYNC_operational(), can_uvccm_win32::get_can_data(), getReadResultNetworkDict(), getSDOfreeLine(), getSDOlineOnUse(), getSDOlineRestBytes(), getWriteResultNetworkDict(), heartbeatInit(), heartbeatStop(), initSensor(), lineToSDO(), main(), masterRequestNodeState(), objdictToSDOline(), PDOStop(), proceedNODE_GUARD(), proceedPDO(), proceedSDO(), proceedSYNC(), ProducerHearbeatAlarm(), ReadSDO(), resetSDO(), resetSDOline(), SDOlineToObjdict(), SDOTimeoutAlarm(), SDOtoLine(), sendSDO(), sendSDOabort(), sendSYNC(), setNodeId(), TestMaster_initialisation(), TestMaster_post_TPDO(), and TPDO_Communication_Parameter_Callback(). etisserant@240:
#define US_TO_TIMEVAL | nico@215:( | nico@215:us | nico@215:nico@215: | ) | nico@215:(us>>2) | nico@215:
nico@215: nico@215:
nico@215: Definition at line 157 of file applicfg.h. nico@215:
etisserant@240: Referenced by _sendPDOevent(), and startSYNC(). nico@215:
nico@215:
char* hex_convert | nico@215:( | nico@215:char * | nico@215:buf, | nico@215:|
nico@215: | nico@215: | unsigned long | nico@215:value, | nico@215:|
nico@215: | nico@215: | char | nico@215:lastCar | nico@215: |
nico@215: | ) | nico@215:nico@215: |
nico@215: Convert an integer to a string in hexadecimal format If you do not wants to use a lastCar, put lastCar = '' (end of string) ex : value = 0XABCDEF and lastCar = '
nico@215: ' buf[0] = '0' buf[1] = 'X' buf[2] = 'A' .... buf[7] = 'F' buf[8] = '
nico@215: ' buf[9] = ''
nico@215:
nico@215: Definition at line 135 of file canOpenDriver.c. nico@215:
nico@215: Referenced by printSCI_nbr(). nico@215:
void initHCS12 | nico@215:( | nico@215:void | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: Put here all the code to init the HCS12. nico@215:
nico@215: nico@215:
nico@215: Definition at line 199 of file canOpenDriver.c. nico@215:
nico@215: References initPLL(), and MSG_WAR. nico@215:
nico@215: Referenced by initSensor(). nico@215:
etisserant@240: Here is the call graph for this function:
void initPLL | nico@215:( | nico@215:void | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: to start using the PLL. Bus clock becomes 24 MHz if the quartz on the board is at 16 MHz nico@215:
nico@215: Definition at line 188 of file canOpenDriver.c. nico@215:
nico@215: References CLKSEL, CRGFLG, IO_PORTS_8, PLLCTL, REFDV, and SYNR. nico@215:
nico@215: Referenced by initHCS12(). nico@215:
void initSCI_0 | nico@215:( | nico@215:void | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: Initialisation of the serial port 0. nico@215:
nico@215: nico@215:
nico@215: Definition at line 115 of file canOpenDriver.c. nico@215:
nico@215: References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI0, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI0_BAUD_RATE. nico@215:
void initSCI_1 | nico@215:( | nico@215:void | nico@215:nico@215: | ) | nico@215:nico@215: |
nico@215: Initialisation of the serial port 1. nico@215:
nico@215: nico@215:
nico@215: Definition at line 124 of file canOpenDriver.c. nico@215:
nico@215: References BUS_CLOCK, IO_PORTS_16, IO_PORTS_8, SCI1, SCIBDH, SCICR1, SCICR2, and SERIAL_SCI1_BAUD_RATE. nico@215:
void printSCI_nbr | nico@215:( | nico@215:char | nico@215:sci, | nico@215:|
nico@215: | nico@215: | unsigned long | nico@215:nbr, | nico@215:|
nico@215: | nico@215: | char | nico@215:lastCar | nico@215: |
nico@215: | ) | nico@215:nico@215: |
nico@215: Print the number in hexadecimal to the serial port sci (sci takes the values SCI0 or SCI1) nico@215:
nico@215: Definition at line 179 of file canOpenDriver.c. nico@215:
nico@215: References hex_convert(), and printSCI_str(). nico@215:
etisserant@240: Here is the call graph for this function:
void printSCI_str | nico@215:( | nico@215:char | nico@215:sci, | nico@215:|
nico@215: | nico@215: | const char * | nico@215:str | nico@215: |
nico@215: | ) | nico@215:nico@215: |
nico@215: Print the string to the serial port sci (sci takes the values SCI0 or SCI1) nico@215:
nico@215: Definition at line 162 of file canOpenDriver.c. nico@215:
nico@215: References IO_PORTS_8, SCIDRL, and SCISR1. nico@215:
nico@215: Referenced by printSCI_nbr(). nico@215:
etisserant@240: