Added missing documentation.

This commit is contained in:
Florian Pose 2006-06-26 16:05:30 +00:00
parent 3671557429
commit 92a035f82b
10 changed files with 75 additions and 66 deletions

View File

@ -55,7 +55,11 @@
/*****************************************************************************/
struct ec_device;
typedef struct ec_device ec_device_t;
typedef struct ec_device ec_device_t; /**< \see ec_device */
/**
Interrupt-Service-Routine Type
*/
typedef irqreturn_t (*ec_isr_t)(int, void *, struct pt_regs *);

View File

@ -60,13 +60,13 @@
/*****************************************************************************/
struct ec_master;
typedef struct ec_master ec_master_t;
typedef struct ec_master ec_master_t; /**< \see ec_master */
struct ec_domain;
typedef struct ec_domain ec_domain_t;
typedef struct ec_domain ec_domain_t; /**< \see ec_domain */
struct ec_slave;
typedef struct ec_slave ec_slave_t;
typedef struct ec_slave ec_slave_t; /**< \see ec_slave */
/**
Initialization type for field registrations.

View File

@ -54,10 +54,6 @@ int ec_slave_fetch_sdo_entries(ec_slave_t *, ec_command_t *,
/*****************************************************************************/
const ec_code_msg_t sdo_abort_messages[];
/*****************************************************************************/
/**
Reads 32 bit of a CANopen SDO in expedited mode.
\return 0 in case of success, else < 0
@ -529,26 +525,12 @@ int ec_slave_fetch_sdo_entries(ec_slave_t *slave, /**< EtherCAT slave */
/*****************************************************************************/
/**
Outputs an SDO abort message.
SDO abort messages.
The "abort SDO transfer request" supplies an abort code,
which can be translated to clear text. This table does
the mapping of the codes and messages.
*/
void ec_canopen_abort_msg(uint32_t abort_code)
{
const ec_code_msg_t *abort_msg;
for (abort_msg = sdo_abort_messages; abort_msg->code; abort_msg++) {
if (abort_msg->code == abort_code) {
EC_ERR("SDO abort message 0x%08X: \"%s\".\n",
abort_msg->code, abort_msg->message);
return;
}
}
EC_ERR("Unknown SDO abort code 0x%08X.\n", abort_code);
}
/*****************************************************************************/
const ec_code_msg_t sdo_abort_messages[] = {
{0x05030000, "Toggle bit not changed"},
{0x05040000, "SDO protocol timeout"},
@ -586,6 +568,27 @@ const ec_code_msg_t sdo_abort_messages[] = {
{}
};
/*****************************************************************************/
/**
Outputs an SDO abort message.
*/
void ec_canopen_abort_msg(uint32_t abort_code)
{
const ec_code_msg_t *abort_msg;
for (abort_msg = sdo_abort_messages; abort_msg->code; abort_msg++) {
if (abort_msg->code == abort_code) {
EC_ERR("SDO abort message 0x%08X: \"%s\".\n",
abort_msg->code, abort_msg->message);
return;
}
}
EC_ERR("Unknown SDO abort code 0x%08X.\n", abort_code);
}
/******************************************************************************
* Realtime interface
*****************************************************************************/

View File

@ -47,6 +47,14 @@
#include "mailbox.h"
#include "ethernet.h"
/**
Defines the debug level of EoE processing
0 = No debug messages.
1 = Output actions.
2 = Output actions and frame data.
*/
#define EOE_DEBUG_LEVEL 0
/*****************************************************************************/

View File

@ -61,7 +61,7 @@ ec_eoe_frame_t;
/*****************************************************************************/
typedef struct ec_eoe ec_eoe_t;
typedef struct ec_eoe ec_eoe_t; /**< \see ec_eoe */
/**
Ethernet-over-EtherCAT (EoE) handler.

View File

@ -44,10 +44,6 @@
/*****************************************************************************/
const ec_code_msg_t al_status_messages[];
/*****************************************************************************/
void ec_fsm_master_start(ec_fsm_t *);
void ec_fsm_master_broadcast(ec_fsm_t *);
void ec_fsm_master_proc_states(ec_fsm_t *);
@ -1674,6 +1670,32 @@ void ec_fsm_change_status(ec_fsm_t *fsm /**< finite state machine */)
/*****************************************************************************/
/**
Application layer status messages.
*/
const ec_code_msg_t al_status_messages[] = {
{0x0001, "Unspecified error"},
{0x0011, "Invalud requested state change"},
{0x0012, "Unknown requested state"},
{0x0013, "Bootstrap not supported"},
{0x0014, "No valid firmware"},
{0x0015, "Invalid mailbox configuration"},
{0x0016, "Invalid mailbox configuration"},
{0x0017, "Invalid sync manager configuration"},
{0x0018, "No valid inputs available"},
{0x0019, "No valid outputs"},
{0x001A, "Synchronisation error"},
{0x001B, "Sync manager watchdog"},
{0x0020, "Slave needs cold start"},
{0x0021, "Slave needs INIT"},
{0x0022, "Slave needs PREOP"},
{0x0023, "Slave needs SAVEOP"},
{}
};
/*****************************************************************************/
/**
Change state: CODE.
*/
@ -1790,29 +1812,3 @@ void ec_fsm_change_error(ec_fsm_t *fsm /**< finite state machine */)
}
/*****************************************************************************/
/**
Application layer status messages.
*/
const ec_code_msg_t al_status_messages[] = {
{0x0001, "Unspecified error"},
{0x0011, "Invalud requested state change"},
{0x0012, "Unknown requested state"},
{0x0013, "Bootstrap not supported"},
{0x0014, "No valid firmware"},
{0x0015, "Invalid mailbox configuration"},
{0x0016, "Invalid mailbox configuration"},
{0x0017, "Invalid sync manager configuration"},
{0x0018, "No valid inputs available"},
{0x0019, "No valid outputs"},
{0x001A, "Synchronisation error"},
{0x001B, "Sync manager watchdog"},
{0x0020, "Slave needs cold start"},
{0x0021, "Slave needs INIT"},
{0x0022, "Slave needs PREOP"},
{0x0023, "Slave needs SAVEOP"},
{}
};
/*****************************************************************************/

View File

@ -47,9 +47,7 @@
/*****************************************************************************/
typedef struct ec_fsm ec_fsm_t;
/*****************************************************************************/
typedef struct ec_fsm ec_fsm_t; /**< \see ec_fsm */
/**
Finite state machine of an EtherCAT master.

View File

@ -115,7 +115,7 @@ struct ec_master
ec_fsm_t fsm; /**< master state machine */
ec_master_mode_t mode; /**< master mode */
struct timer_list eoe_timer; /** EoE timer object */
struct timer_list eoe_timer; /**< EoE timer object */
unsigned int eoe_running; /**< non-zero, if EoE processing is active. */
struct list_head eoe_handlers; /**< Ethernet-over-EtherCAT handlers */
spinlock_t internal_lock; /**< spinlock used in freerun mode */

View File

@ -66,9 +66,9 @@ void __exit ec_cleanup_module(void);
/*****************************************************************************/
static int ec_master_count = 1;
static int ec_eoe_devices = 0;
static struct list_head ec_masters;
static int ec_master_count = 1; /**< parameter value, number of masters */
static int ec_eoe_devices = 0; /**< parameter value, number of EoE interf. */
static struct list_head ec_masters; /**< list of masters */
/*****************************************************************************/

View File

@ -47,8 +47,8 @@
/*****************************************************************************/
#define EC_MAX_FIELDS 10
#define EC_MAX_SYNC 16
#define EC_MAX_FIELDS 10 /**< maximal number of data fields per sync manager */
#define EC_MAX_SYNC 16 /**< maximal number of sync managers per type */
/*****************************************************************************/