Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MODSERIAL mbed KL25Z_ClockControl
Fork of EtherCAT by
EtherCAT/cpuinit.cpp@17:c5946a0fde83, 2015-03-05 (annotated)
- Committer:
- vsluiter
- Date:
- Thu Mar 05 22:22:47 2015 +0000
- Revision:
- 17:c5946a0fde83
- Parent:
- 13:5e4dcbd44786
- Child:
- 18:6629e8c5d59e
BusMaster working. Added code to copy sensor data, not tested yet.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vsluiter | 1:5e22bf1a3817 | 1 | /* |
vsluiter | 1:5e22bf1a3817 | 2 | * SOES Simple Open EtherCAT Slave |
vsluiter | 1:5e22bf1a3817 | 3 | * |
vsluiter | 1:5e22bf1a3817 | 4 | * File : cpuinit.c |
vsluiter | 1:5e22bf1a3817 | 5 | * Version : 0.9.2 |
vsluiter | 1:5e22bf1a3817 | 6 | * Date : 22-02-2010 |
vsluiter | 1:5e22bf1a3817 | 7 | * Copyright (C) 2007-2010 Arthur Ketels |
vsluiter | 1:5e22bf1a3817 | 8 | * |
vsluiter | 1:5e22bf1a3817 | 9 | * SOES is free software; you can redistribute it and/or modify it under |
vsluiter | 1:5e22bf1a3817 | 10 | * the terms of the GNU General Public License version 2 as published by the Free |
vsluiter | 1:5e22bf1a3817 | 11 | * Software Foundation. |
vsluiter | 1:5e22bf1a3817 | 12 | * |
vsluiter | 1:5e22bf1a3817 | 13 | * SOES is distributed in the hope that it will be useful, but WITHOUT ANY |
vsluiter | 1:5e22bf1a3817 | 14 | * WARRANTY; without even the implied warranty of MERCHANTABILITY or |
vsluiter | 1:5e22bf1a3817 | 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
vsluiter | 1:5e22bf1a3817 | 16 | * for more details. |
vsluiter | 1:5e22bf1a3817 | 17 | * |
vsluiter | 1:5e22bf1a3817 | 18 | * As a special exception, if other files instantiate templates or use macros |
vsluiter | 1:5e22bf1a3817 | 19 | * or inline functions from this file, or you compile this file and link it |
vsluiter | 1:5e22bf1a3817 | 20 | * with other works to produce a work based on this file, this file does not |
vsluiter | 1:5e22bf1a3817 | 21 | * by itself cause the resulting work to be covered by the GNU General Public |
vsluiter | 1:5e22bf1a3817 | 22 | * License. However the source code for this file must still be made available |
vsluiter | 1:5e22bf1a3817 | 23 | * in accordance with section (3) of the GNU General Public License. |
vsluiter | 1:5e22bf1a3817 | 24 | * |
vsluiter | 1:5e22bf1a3817 | 25 | * This exception does not invalidate any other reasons why a work based on |
vsluiter | 1:5e22bf1a3817 | 26 | * this file might be covered by the GNU General Public License. |
vsluiter | 1:5e22bf1a3817 | 27 | * |
vsluiter | 1:5e22bf1a3817 | 28 | * The EtherCAT Technology, the trade name and logo "EtherCAT" are the intellectual |
vsluiter | 1:5e22bf1a3817 | 29 | * property of, and protected by Beckhoff Automation GmbH. |
vsluiter | 1:5e22bf1a3817 | 30 | */ |
vsluiter | 1:5e22bf1a3817 | 31 | //#include <avr/io.h> |
vsluiter | 1:5e22bf1a3817 | 32 | #include "cpuinit.h" |
vsluiter | 1:5e22bf1a3817 | 33 | #include "mbed.h" |
vsluiter | 1:5e22bf1a3817 | 34 | |
vsluiter | 5:6d75f432a41f | 35 | |
vsluiter | 1:5e22bf1a3817 | 36 | void cpuinit(void) |
vsluiter | 1:5e22bf1a3817 | 37 | { |
vsluiter | 1:5e22bf1a3817 | 38 | //shoe_serial.baud(921600); |
vsluiter | 1:5e22bf1a3817 | 39 | //et1100_spi.format(8,3); |
vsluiter | 8:09dcef3ed467 | 40 | et1100_spi.frequency(1000000); |
vsluiter | 13:5e4dcbd44786 | 41 | |
vsluiter | 13:5e4dcbd44786 | 42 | xbus.baud(115200); |
vsluiter | 13:5e4dcbd44786 | 43 | wait(1);//because Xbus master and IMU's need to boot. |
vsluiter | 17:c5946a0fde83 | 44 | XbusSetupReceiver(&xbus_master); //initialize struct |
vsluiter | 13:5e4dcbd44786 | 45 | XbusInitializeXbusMaster(); |
vsluiter | 13:5e4dcbd44786 | 46 | |
vsluiter | 5:6d75f432a41f | 47 | wait_ms(20); |
vsluiter | 13:5e4dcbd44786 | 48 | |
vsluiter | 1:5e22bf1a3817 | 49 | |
vsluiter | 1:5e22bf1a3817 | 50 | } |
vsluiter | 1:5e22bf1a3817 | 51 |