add support for XMC DAVE toolchain
parent
6bb5aa643b
commit
e27c903b9d
|
@ -7,7 +7,7 @@ project (SOES)
|
|||
|
||||
set (SOES_VERSION_MAJOR 2)
|
||||
set (SOES_VERSION_MINOR 1)
|
||||
set (SOES_VERSION_PATCH 0)
|
||||
set (SOES_VERSION_PATCH 1)
|
||||
|
||||
# Generate version numbers
|
||||
configure_file (
|
||||
|
|
|
@ -12,7 +12,7 @@ SOES is an EtherCAT slave stack written in c. Its purpose is to learn and
|
|||
to use. All users are invited to study the source to get an understanding
|
||||
how an EtherCAT slave functions.
|
||||
|
||||
Features as of 2.1.0:
|
||||
Features as of 2.1.1:
|
||||
- Address offset based HAL for easy ESC read/write access via any
|
||||
interface
|
||||
- Mailbox with data link layer
|
||||
|
|
|
@ -224,8 +224,6 @@ void soes_init (void)
|
|||
{
|
||||
DPRINT ("SOES (Simple Open EtherCAT Slave)\n");
|
||||
|
||||
ESC_reset();
|
||||
|
||||
// configure I/O
|
||||
XMC_GPIO_Init(P_BTN, &gpio_config_btn);
|
||||
XMC_GPIO_Init(P_LED, &gpio_config_led);
|
||||
|
|
|
@ -11,7 +11,9 @@
|
|||
* registers and memory.
|
||||
*/
|
||||
|
||||
#include "esc_hw.h"
|
||||
#include "esc.h"
|
||||
#include "esc_hw_eep.h"
|
||||
#include "esc_eep.h"
|
||||
|
||||
#include "xmc_gpio.h"
|
||||
|
@ -286,6 +288,14 @@ void ESC_write (uint16_t address, void *buf, uint16_t len)
|
|||
memcpy(ESCADDR(address), buf, len);
|
||||
}
|
||||
|
||||
/** ESC emulated EEPROM handler
|
||||
*/
|
||||
void ESC_eep_handler(void)
|
||||
{
|
||||
EEP_process ();
|
||||
EEP_hw_process();
|
||||
}
|
||||
|
||||
void ESC_reset (void)
|
||||
{
|
||||
/* disable ESC to force reset */
|
||||
|
@ -295,10 +305,12 @@ void ESC_reset (void)
|
|||
EEP_init();
|
||||
}
|
||||
|
||||
void ESC_init (const void * arg)
|
||||
void ESC_init (const esc_cfg_t * cfg)
|
||||
{
|
||||
XMC_ECAT_CONFIG_t ecat_config;
|
||||
|
||||
ESC_reset();
|
||||
|
||||
/* configure inputs */
|
||||
init_input(ECAT_P0_LINK_STATUS);
|
||||
init_input(ECAT_P0_RXD3);
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
* Licensed under the GNU General Public License version 2 with exceptions. See
|
||||
* LICENSE file in the project root for full license information
|
||||
*/
|
||||
|
||||
/** \file
|
||||
* \brief
|
||||
* Headerfile for esc_hw.c
|
||||
*/
|
||||
|
||||
/*
|
||||
* Licensed under the GNU General Public License version 2 with exceptions. See
|
||||
* LICENSE file in the project root for full license information
|
||||
*/
|
||||
|
||||
#ifndef __esc_hw__
|
||||
#define __esc_hw__
|
||||
|
||||
void ESC_eep_handler(void);
|
||||
|
||||
#endif
|
|
@ -11,9 +11,8 @@
|
|||
#ifndef __esc_hw_eep__
|
||||
#define __esc_hw_eep__
|
||||
|
||||
#include "esc_hw.h"
|
||||
#include "cc.h"
|
||||
#include "esc_eep.h"
|
||||
|
||||
#include "xmc_gpio.h"
|
||||
#include "xmc_flash.h"
|
||||
#include "xmc_fce.h"
|
||||
|
|
|
@ -21,6 +21,14 @@ extern "C"
|
|||
#include <machine/endian.h>
|
||||
#endif
|
||||
|
||||
#ifndef MIN
|
||||
#define MIN(a,b) (((a)<(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#ifndef MAX
|
||||
#define MAX(a,b) (((a)>(b))?(a):(b))
|
||||
#endif
|
||||
|
||||
#define CC_PACKED_BEGIN
|
||||
#define CC_PACKED_END
|
||||
#define CC_PACKED __attribute__((packed))
|
||||
|
|
Loading…
Reference in New Issue