1
0
Fork 0
Commit graph

78 commits

Author SHA1 Message Date
Janez
9dce037ecb Add data storage, common and Linux specific functions, tested in Linux. 2021-01-25 12:42:10 +01:00
Janez
5538b5e1f8 Remove CO_errinfo() from driver and put errInfo into CO_CANopenInit() as arg 2021-01-20 12:49:20 +01:00
Janez
51d64df860 OD interface simplified #162
OD_extension is now configurable by application only.
2021-01-07 08:34:53 +01:00
Janez
7b5de9f383 Replace type char with uint8_t, where appropriate.
Fix typos and clarify CO_ODinterface.
Remove unnecessary types from CO_driver.h.
2021-01-05 12:27:22 +01:00
Janez
d62de8dc64 Minor updates 2020-12-28 13:23:57 +01:00
Janez
9e9fce74a9 Updates and testing of OD interface, SDO server, SDO client, gateway, etc.
- SDO server: Change behavior for string data type + fixes + test all
- SDO client: fixes + test all
- OD interface: Special behavior for string data type
- CO_driver.h: added default debug configuration macros + fix spelling
- Gateway + fifo: added base64 support + updates
- CO_CANopenInit() - added arguments.
- update some documentation
- CO_epoll_interface fixes.
- CO_main_basic.c updates
2020-12-24 14:15:10 +01:00
Janez
a6ce313387 New Object Dictionary project file, etc. Remove old OD. Update doc. 2020-11-28 12:17:48 +01:00
Janez
ee1d8d0c81 Restore CO_CONFIG_HB_CONS_CALLBACK_CHANGE option, same as #241 2020-10-26 19:05:26 +01:00
Janez
0e317dddf3 Add CO_errinfo() into CO_driver.h and driver_targets.
Add additional error info for 'CO_ERROR_OD_PARAMETERS'.
2020-10-26 18:05:47 +01:00
Janez
cf9fb2a547 Some updates in OD interface.
It matches newly generated OD.h and OD.c files from libedssharp
2020-10-21 11:29:03 +02:00
Janez
f73025ef65 CANopenNode V2.0 pre-release 2020-10-07 17:50:25 +02:00
Janez
7a43f98f24 Configuration macros updated 2020-10-07 13:47:07 +02:00
Janez
ac4ca2893a Remove duplicated CANopenConfiguredOK from main functions. Use CO->nodeIdUnconfigured instead. 2020-09-23 09:06:57 +02:00
Janez
a528eb1669 Better organised configuration macros (CO_config.h):
- rearranged and better documented
 - default values moved from CO_driver.h into appropriate files
 - rearranged also in CO_driver_target.h files
 - parts of the stack or whole objects can be disabled.
 - configuration is verified for depencies

Additional:
 - renamed some members of CO_Default_CAN_ID_t
 - moved helpers CO_setUint32() etc from CO_SDOserver.h into CO_driver.h.
 - change wrong CO_ERROR_PARAMETERS to CO_ERROR_ILLEGAL_ARGUMENT.
 - renamed CO_ERROR_PARAMETERS to CO_ERROR_OD_PARAMETERS
2020-09-14 15:50:21 +02:00
Janez
d98fb635f5 Added CO_ODinterface 2020-07-13 14:08:16 +02:00
gotocoffee
0f7b3e2d17
CANopen Safety (SRDO according to DIN EN 50325-5:2016) (#196)
* CANopen Safety (SRDO according to DIN EN 50325-5:2016)

* GFC code and docs

* clang-format on GFC

Co-authored-by: rg1 <r.gruening@miunske.com>
2020-06-22 10:14:14 +02:00
Janez
ca452c47cc CO_driver interface: remove Emergency object dependency for reporting CAN
errors, use CANerrorStatus own variable instead. Emergency object updated.
2020-06-13 14:06:35 +02:00
Janez
dd1677b5bc Integrate LSS slave into CANopenNode more directly.
- CO_LSSslave: move expensive code from CAN receive (interrupt) to mainline
  CO_LSSslave_process() function.
- LSS slave now runs in parallel to other CANopen objects.
- LSS slave and master can run both on same device.
- LSS slave, LSS master and gateway-ascii(CiA309) LSS functions tested.
- LSSusage.md updated.
2020-06-09 14:55:07 +02:00
Janez
bd3326fed9 Make own file for CANopen status LED diodesLED indicator indication
(CiA303-3) moved from NMT into own files. Now fully comply to standard.
2020-06-05 18:02:26 +02:00
Janez
ae220f9115 Configuration for LSS updated. 2020-05-29 09:56:05 +02:00
Janez
cb9b2cce42 Add printout of message log from CANopen gateway-ascii (non-standard). 2020-05-29 07:36:23 +02:00
Janez
f41069561a Make SDO client and NMT master optional in gateway_ascii 2020-05-28 16:40:21 +02:00
Janez
c1a30b8a03 Some style corrections
- add CO_fifo_st enumerator for use in CO_fifo_cpyTok2xx functions.
- 309/CO_gateway_ascii: add x8 to x64 nonstandard data types
- example compiles now
- Fix "unused argument" warnings in socketCAN
2020-05-15 15:52:22 +02:00
Janez
b5bfeec42a Added CANopen gateway-ascii command interface according to CiA309-3 as a
microcontroller independent module.
It includes NMT master, LSS master and SDO client interface.
Interface is non-blocking, it is added to mainline.
Example for Linux stdio and socket is included.

Added CO_fifo.h/c for fifo data buffer, used with rewritten SDO client, etc

SDO client is rewritten. Now includes r/w fifo interface to transfer data.

doc/gettingStarted.md is updated.
2020-05-12 18:11:43 +02:00
Freddie Chopin
b4b0fe069f Convert {T,R}PDO_CALLS_EXTENSION to CO_CONFIG_{T,R}PDO_CALLS_EXTENSION
User can now enable extension callbacks in RPDO/TPDO handling paths
simply by configuration flags instead of modifying sources or by passing
the defines directly to the compiler.
2020-05-06 18:22:50 +02:00
Freddie Chopin
9b8a296fb7 Add CO_TIME_initCallbackPre() for received TIME messages
This optional mechanism allows to immediatelly wake the thread that
processes TIME, without waiting for its next tick.
2020-05-06 18:08:45 +02:00
Freddie Chopin
aa6075b3c8
Add CO_..._initCallbackPre() for RPDO and SYNC (#178)
* Merge two parts of CO_PDO_receive() into single common code

* Add CO_RPDO_initCallbackPre() for received RPDO messages

This optional mechanism allows to immediatelly wake the thread that
processes RPDO, without waiting for its next tick.

* Add CO_SYNC_initCallbackPre() for received SYNC messages

This optional mechanism allows to immediatelly wake the thread that
processes SYNC, without waiting for its next tick.
2020-05-05 13:23:26 +02:00
Freddie Chopin
4c3011d34a
Replace all memcpy/memset-like functions with standard <string.h> functions (#175)
* Use standard memcpy() instead of CO_memcpy()

* Remove CO_memcpy()

* Use standard memset() instead of CO_memset()

* Remove CO_memset()

* Move helper functions from CO_SDOserver.c to header and make them inline

* Implement CO_getUint16() with memcpy()

* Implement CO_getUint32() with memcpy()

* Implement CO_setUint16() with memcpy()

* Implement CO_setUint32() with memcpy()

* Define memcpy() as CO_memcpySwapX() for little-endian systems

* Fix several writes past the buffer due to hardcoded sizes

Use more "generic" sizes (via sizeof()) instead of hardcoded number in
all calls to memset() to avoid 1-byte errors which result in writes past
the buffer, for example:

memset(&LSSslave->TXbuff->data[5], 0, 4);
in CO_LSSslave_serviceInquire()

memset(&LSSmaster->TXbuff->data[6], 0, 3);
in CO_LSSmaster_switchStateSelectInitiate()

* Use "generic" size in calls to memcpy() where possible

* Remove CO_bytes_t

This type was used only for CO_{get,set}Uint{16,32}().
2020-05-04 11:22:32 +02:00
Janez
5a2a1e85cf Update configuration macros. SDO state machine preview. 2020-04-29 13:12:07 +02:00
Janez
ffd5027cb2 Make SYNC optional in TPDO and RPDO. 2020-03-20 18:47:16 +01:00
Janez
6e28914ca9 Make calculation of timerNext_us optional. 2020-03-20 16:44:37 +01:00
Janez
c88194e813 Add Stack configuration macros to most of CANopenNode objects.
Add CO_NMT_initCallbackPre()
2020-03-19 18:07:23 +01:00
Janez
794c0f903a Added file CO_config.h for stack configuration. Added CO_HBconsumer_initCallback() 2020-03-18 21:06:15 +01:00
Janez
02e2cc5860 Stack configuration added do CO_driver.h
Change macro CO_USE_LEDS -> CO_CONFIG_NMT_LEDS 1
Change macro CO_SDO_BUFFER_SIZE -> CO_CONFIG_SDO_BUFFER_SIZE
2020-03-07 16:26:52 +01:00
Janez
a98492ecaf Add heapMemoryUsed info from CO_new() 2020-03-06 11:33:25 +01:00
Janez
02a734a832 Move socketCAN/Makefile into base directory
Partially update sockeCAN/main.c and rename to sockeCAN/CO_main_basic.c.
Fix some warnings in socketCAN.
2020-03-02 09:17:52 +01:00
Janez
a513d84e45 Move Makefile into example/
Renamed to example/CO_driver_blank.c and example/main_blank.c
Copied socketCAN/main.c from CANopenSocket project.
2020-02-26 13:01:53 +01:00
Janez
9c0b16f981 minor corrections 2020-02-06 07:52:41 +01:00
Janez
ae48e57c33 CANopen.h/.c revision.
- example/main.c updated to microsecond time base.
- NMT master moved from CANopen.h/.c into 301/CO_NMT_Heartbeat.h/.c.
- CANopen.h/.c files revised, changes in interface, compare example/main.c.
- Removed CO_init() from CANopen.h/.c. Use separate functions instead.
- CO_USE_GLOBALS and global definitions removed from CANopen.c.
- CO_USE_OWN_CRC16 removed from CANopen.c. Use CO_driver_target.h.
2020-02-06 00:15:54 +01:00
Janez
62ffc7c9f5 Drivers removed from stack, directory structure rearranged.
- Change log added to README.
- Doxygen documentation updated.
2020-02-05 10:52:56 +01:00
Janez
4495e32fe8 Rename macros CO_CANrxNew_* into CO_FLAG_* 2020-02-04 20:39:10 +01:00
Janez
d50e50e2c6 socketCAN related updates
- move stack/socketCAN/CO_OD_storage.* in socketCAN/CO_OD_storage.*
- CO_CANrxNew_ macros updated
- some corrections
2020-01-25 12:57:17 +01:00
Janez
23a37f0d92 New socketCAN/CO_driver_target.h
- Reduce CO_driver.h and CO_driver_base.h into CO_driver_target.h
- New functions: CO_CANrxMsg_readIdent, _DLC, _data
- rxArray[i].pFunct  changed to   -> rxArray[i].CANrx_callback
- (*pFunct)(void *object, const CO_CANrxMsg_t *message))  changed to
  (*CANrx_callback)(void *object, void *message))
- change to '#define CO_CANrxNew_READ(rxNew) ((bool_t)rxNew)'
2020-01-24 14:59:45 +01:00
Janez
efe87c8b7c minor corrections
example/application.* removed
2020-01-22 07:57:42 +01:00
Janez
63df34d194 Rename CANdriverState to CANptr 2020-01-21 00:16:51 +01:00
Janez
8e33f80b8f minor corrections 2020-01-19 02:36:18 +01:00
Janez
c2d0290ac1 Merge branch 'master' into split-driver
update the split-driver with current master
2020-01-19 02:12:14 +01:00
Janez
12fa8e5173 Extract target specific code from CO_driver.h into /example/CO_driver_target.h
- Keep example code CO_driver_target.h also in CO_driver.h (for doxygen).
- Add extra members into enum CO_ReturnError_t
- Move enum CO_Default_CAN_ID_t from CANopen.h into CO_driver.h
- Make files in 'stack' directory independent form CANopen.h.
  CANopen.h file is more part of the application example than the stack.
- Second argument to receive callback function is 'void*' instead of
  'const CO_CANrxMsg_t*'. New (macros) are introduced:
  CO_CANrxMsg_readIdent(), CO_CANrxMsg_readDLC() and CO_CANrxMsg_readData()
  CAN receive functions in all source files are updated.
- IS_CANrxNew, SET_CANrxNew and CLEAR_CANrxNew renamed to CO_CANrxNew_READ,
  CO_CANrxNew_SET and CO_CANrxNew_CLEAR. Replace broken link in doc.
- Doxyfile: parameter change 'INPUT = README.md stack'. CANopen.h is
  excluded and updated. Doxywizard saved file to newer version of doxygen.
- Documentation in CO_driver.h is updated.
- Full documentation for CO_driver_target.h file is added to CO_driver.h.
- used clang-format on the CO_driver.h
2020-01-19 02:06:46 +01:00
Janez
06a0493c78 fix NMTstartup handling - update README and default values 2020-01-16 08:06:16 +01:00
Janez
1459c7d154 Move files from stack/drvTemplate to stack/ and example/. Makefile updated. 2020-01-14 16:56:41 +01:00