1
0
Fork 0
Commit graph

47 commits

Author SHA1 Message Date
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
229b5c5fd3 Change optional arguments in CO_RPDO_init(), CO_TPDO_init(), CO_GTWA_init() 2020-05-31 22:08:36 +02:00
Janez
92a803f169 Add LSS master into gateway-ascii (CiA309).
- Rename local variable 'token' into 'tok' in CO_GTWA_process().
- CO_LSSmaster: replace CO_LSSmaster_InquireNodeId() with more generic
  CO_LSSmaster_Inquire(). CiA309-3 command 'lss_inquire_addr' now works
  also according to standard.
- CANopen.h: fix doxygen.
- gettingStarted.md: Change example "master" device from node-Id=3 to 1...
2020-05-31 14:31:30 +02:00
Janez
ae220f9115 Configuration for LSS updated. 2020-05-29 09:56:05 +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
Janez
5a2a1e85cf Update configuration macros. SDO state machine preview. 2020-04-29 13:12:07 +02: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
d9c44c69d1 Change non-descriptive CO_***_initCallback() into CO_***_initCallbackPre().
Change CO_NMT_initCallback() into CO_NMT_initCallbackChange().
Change type of NMT->operatingState from uint8_t into enum CO_NMT_internalState_t.
2020-03-18 23:19:29 +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
9d17b0d671 socketCAN driver:
- Always enable CANptr and timestamp info in CO_CANrx_t.
- Update documentation
2020-02-29 22:34:48 +01:00
Janez
78487ba89f Clarify EM, SDOserver, SDOclient and LSSmaster callback functions.
callback functions called also from SDO_blockTransferInProgress.
Clarify timerNext_us parameter to CO_process() function.
2020-02-27 16:43:27 +01:00
Janez
3fc564b72f Remove CO_CANopenInitCallback() from CANopen.h/.c (revert) 2020-02-27 15:25:59 +01:00
Janez
8fb48173c6 Add CO_CANopenInitCallback() into CANopen.h/.c.
Change CO_*_initCallback() functions - add 'void *object' argument.
2020-02-27 13:09:48 +01:00
Janez
e55674bf6f Documentation updated, ChangeLog deviceSupport and gettingStarted added.
CANopen.h fixed.
2020-02-15 16:35:39 +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
c19879b659 Time base CHANGED TO MICROSECONDS in all objects. FIX OS!
- Necessary to update Time base in OS too - call to CO_process() function.
- timerNext_us info to OS implemented in in all objects.
- CO_NMT_blinkingProcess50ms() moved inside CO_NMT_process().
- CO_HBconsumer_process() function optimized and revised.
- Bugfix "timeDifference_us = 0;" inside the for loop.
2020-02-04 20:28:33 +01:00
Miles Simpson
38d5181807 Implemented changes based on PR feedback 2020-01-31 17:13:04 +01:00
Miles Simpson
729a139c12 Implementing PDO and SYNC timerNext_us return value 2020-01-31 17:13:04 +01:00
Janez
63df34d194 Rename CANdriverState to CANptr 2020-01-21 00:16:51 +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
Oleg
f2283e3ca9 Warnings omitted (#144)
* All Warnings omitted
Now all warnings that came up in previous versions are fixed in a clean way directly in the code.
Inlcudes:
Shadowing
Missing default cases
Missing cases in switch statements
unused variables
Pointer problems
Function declarations' visibility

* Default case for NMTsendCommand
Default case was not catched before and could led to errors.

* fix typo when omitting warnings

* Omitting more warnings, and fix TIME->CANrxNew nulling

Inlcudes:
large integer implicitly truncated to unsigned type
this statement may fall through

* rename CO_this to co

* fix CO_process_SYNC name (CANopenNode master merging issue)

Co-authored-by: Michele B. <MicheleBlank@gmx-topmail.de>

----
Verified before merge. It is cleanup, no deep changes.
2020-01-15 13:40:30 +01:00
Janez
eab1f2d54f License changed to Apache 2.0 - part2 2020-01-08 18:31:31 +01:00
Janez
9c2f0a1c64 License changed to Apache 2.0 - main part 2020-01-08 14:52:56 +01:00
Wilkins White
f6d93fc300 change SYNC module to be optional
allows CO_NO_SYNC to be zero
2019-12-10 16:33:21 -08:00
Martin Wagner
96fd0aa02b
Merge pull request #110 from JuPrgn/FeatTimestamp
feat: Add TimeStamp feature
2019-12-09 08:23:16 +01:00
Olivier Desenfans
02fd8ee9da Renaming CANdevicePtr to CANdriverState 2019-11-13 08:34:42 +01:00
Julien PEYREGNE
bba140f943 feat: Add TIME producer and refactor TIME consumer 2019-11-12 12:28:33 +01:00
Olivier Desenfans
e7d9652658 Use a void pointer for the CAN device address
Previously, the address of the CAN device (`CANbaseAddress`)
was specified as a signed or unsigned integer of variable size.
This made the ABI specific for each driver and is not generic
enough for some use cases.

Replaced all usages by using a void pointer instead.
Renamed `CANbaseAddress` to `CANdevicePtr`.
Refactored the code where it needed to be (some comparisons to -1).

Use a pointer to a user-defined variable/structure instead of
a 32-bit integer for CANbaseAddress. Renamed CANbaseAddress
to CANbaseStruct to reflect that change in behavior.

This is more modular and avoids casts.
2019-11-10 13:14:53 +01:00
Julien PEYREGNE
e8262dc88f feat: Add TimeStamp feature 2019-10-09 14:31:26 +02:00
Martin Wagner
5601770589 Changed sdo client to support multiple sdo servers.
for existing code, you need to add "[0]" to the sdo function parameter CO->SDOclient (so you get CO->SDOclient[0]).
2018-09-13 09:12:21 +02:00
Benoit Rapidel
c0ec1da5ef CO_sendNMTcommand must return a CO_ReturnError_t, not a uint16_t 2018-09-05 09:10:15 +02:00
Martin Wagner
9dbd2fc966 First try on LSS master addon...
- needs #define CO_NO_LSS_CLIENT 1 in CO_OD.h. This will need a change in the OD editor.
- still no fastscan support
- bitrate settin API untested
- some changes on LSS slave where necessary
2017-07-03 11:14:07 +02:00
Martin Wagner
03982ad8e3 First try on LSS slave addon...
- needs #define CO_NO_LSS_SERVER 1 in CO_OD.h. This will need a change in the OD editor.
- no Fastscan support yet
- bitrate setting API untested
- https://github.com/CANopenNode/CANopenNode/issues/46 (driver stuff)
- changed some of the other stack files, tried my best to remain compatible with standard non LSS CANopenNode
2017-06-26 13:04:02 +02:00
Martin Wagner
f023106e5a Added guards for c++ compilation 2017-05-10 15:30:25 +02:00
Janez
85fc85482e Added trace interface for monitoring variables. 2016-03-24 22:01:44 +01:00
Janez
41b8d903b7 License changed to the GNU General Public License version 2 with the classpath exception. 2016-01-10 00:15:50 +01:00
Jens Nielsen
13be332db3 Allow multiple SDO objects 2015-12-07 18:37:01 +01:00
JanezXD
b716643845 timerNext_ms returned from CO_process() and others. 2015-09-04 18:31:21 +02:00
Janez_dw
69293ab422 CANopen.c: Node ID and CAN bit rate added as argument to CO_init(). 2015-08-28 07:27:40 +02:00
Janez_dw
345b37b573 Some cleanup. 2015-08-27 18:57:34 +02:00
Janez_DW
8427cbcc90 Added testing against null pointers in _init functions.
Updated CO_process_SYNC_RPDO and CO_process_TPDO in CANopen.c.
2015-08-26 15:41:21 +02:00
Janez_DW
730bc57a42 Revision of the CANopen SYNC message. Received synchronous PDOs are now processed after the SYNC. 2015-08-25 19:17:18 +02:00
JanezXD
12f33a4a7b Example files moved to base directory. Added template for socketCAN drivers (based on BECK SC 243) 2015-07-30 19:58:06 +02:00
Renamed from example/CANopen.h (Browse further)