![]() |
ECAT_Slave_in_ПЧ2П_c402
0.8
Реализация EtherCAT Slave для CM TMS320F28388D
|
#include "ecat_def.h"Структуры данных | |
| struct | MBX_STRUCT_PACKED_START |
| CoE Mailbox header. Подробнее... | |
| struct | TMBXQUEUE |
| Mailbox queue. Подробнее... | |
Макросы | |
| #define | MBX_TYPE_AOE 1 |
| Mailbox type AoE. Подробнее... | |
| #define | MBX_TYPE_EOE 2 |
| Mailbox type EoE. Подробнее... | |
| #define | MBX_TYPE_COE 3 |
| Mailbox type CoE. Подробнее... | |
| #define | MBX_TYPE_FOE 4 |
| Mailbox type FoE. Подробнее... | |
| #define | MBX_TYPE_SOE 5 |
| Mailbox type SoE. Подробнее... | |
| #define | MBX_TYPE_VOE 15 |
| Mailbox type VoE. Подробнее... | |
| #define | EMCY_SERVICE ((UINT8) 0x0001) |
| Emergency service. Подробнее... | |
| #define | COE_SERVICE ((UINT8) 0x0002) |
| CoE service. Подробнее... | |
| #define | SOE_SERVICE ((UINT8) 0x0004) |
| SoE service. Подробнее... | |
| #define | EOE_SERVICE ((UINT8) 0x0008) |
| EoE service. Подробнее... | |
| #define | AOE_SERVICE ((UINT8) 0x0010) |
| AoE service. Подробнее... | |
| #define | VOE_SERVICE ((UINT8) 0x0020) |
| VoE service. Подробнее... | |
| #define | FOE_SERVICE ((UINT8) 0x0040) |
| FoE service. Подробнее... | |
| #define | FRAGMENTS_FOLLOW ((UINT8) 0x0080) |
| Fragments follow service. Подробнее... | |
| #define | MAX_MBX_QUEUE_SIZE 10 |
| Mailbox queue size. Подробнее... | |
| #define | MBXSERVICE_MBXERRORCMD 0x01 |
| Mailbox error command. Подробнее... | |
| #define | MBXERR_SYNTAX 0x01 |
| Mailbox error "syntax". Подробнее... | |
| #define | MBXERR_UNSUPPORTEDPROTOCOL 0x02 |
| Mailbox error "unsupported protocol". Подробнее... | |
| #define | MBXERR_INVALIDCHANNEL 0x03 |
| Mailbox error "invalid channel". Подробнее... | |
| #define | MBXERR_SERVICENOTSUPPORTED 0x04 |
| Mailbox error "service not supported". Подробнее... | |
| #define | MBXERR_INVALIDHEADER 0x05 |
| Mailbox error "invalid header". Подробнее... | |
| #define | MBXERR_SIZETOOSHORT 0x06 |
| Mailbox error "Size too short". Подробнее... | |
| #define | MBXERR_NOMOREMEMORY 0x07 |
| Mailbox error "No memory". Подробнее... | |
| #define | MBXERR_INVALIDSIZE 0x08 |
| Mailbox error "Invalid size". Подробнее... | |
| #define | MBXERR_SERVICEINWORK 0x09 |
| Mailbox error "Service in work". Подробнее... | |
| #define | MBX_OFFS_TYPE 1 |
| Protocol type offset. Подробнее... | |
| #define | MBX_OFFS_COUNTER 1 |
| Protocol counter offset. Подробнее... | |
| #define | MBX_MASK_TYPE 0x0F |
| Protocol type mask. Подробнее... | |
| #define | MBX_MASK_COUNTER 0xF0 |
| Protocol counter mask. Подробнее... | |
| #define | MBX_SHIFT_TYPE 0 |
| Protocol type shift. Подробнее... | |
| #define | MBX_SHIFT_COUNTER 4 |
| Protocol counter shift. Подробнее... | |
| #define | MBX_HEADER_SIZE 6 |
| Mailbox header size. Подробнее... | |
| #define | MAX_MBX_DATA_SIZE (MAX_MBX_SIZE - MBX_HEADER_SIZE) |
| Mailbox data size. Подробнее... | |
| #define | PROTO extern |
Определения типов | |
| typedef struct MBX_STRUCT_PACKED_START | TMBXHEADER |
| Mailbox header. Подробнее... | |
| typedef struct MBX_STRUCT_PACKED_START | TMBX |
| Mailbox datagram. Подробнее... | |
Функции | |
| void | MBX_Init (void) |
| This function intialize the Mailbox Interface. Подробнее... | |
| UINT16 | MBX_StartMailboxHandler (void) |
| This function includes the state transition from INIT to. Подробнее... | |
| void | MBX_StopMailboxHandler (void) |
| This function includes the state transition from. Подробнее... | |
| void | MBX_MailboxWriteInd (TMBX MBXMEM *pMbx) |
| This function is called when the Master has written the Receive-Mailbox. Подробнее... | |
| void | MBX_MailboxReadInd (void) |
| This function is called when the Master has read the Send-Mailbox. Подробнее... | |
| void | MBX_MailboxRepeatReq (void) |
| This function is called if the Master has requested a resending of the last. Подробнее... | |
| UINT8 | MBX_MailboxSendReq (TMBX MBXMEM *pMbx, UINT8 flags) |
| This function puts a new Mailbox service in the Send Mailbox. Подробнее... | |
| void | MBX_CheckAndCopyMailbox (void) |
| This function is used to check if the received mailbox command can be processed. Подробнее... | |
| UINT8 | MBX_CopyToSendMailbox (TMBX MBXMEM *pMbx) |
| This function copies data to the Send Mailbox. Подробнее... | |
| void | MBX_Main (void) |
| This function is called cyclically to check if a received Mailbox service was stored. Подробнее... | |
Changes to version V5.11:
V5.12 ECAT2: big endian changes
V5.12 MBX3: handle incomplete mailbox communication
Changes to version V5.01:
V5.11 ECAT10: change PROTO handling to prevent compiler errors
V5.11 MBX1: "return value of ""MBX_StartMailboxHandler()"" changed to UINT16"
V5.11 MBX3: set application triggered emergency and EoE data to pending if no mailbox queue is supported and another mailbox request is currently handled, Handle only one mailbox request at a time (in case that MAILBPX_QUEUE is disabled)
Changes to version - :
V5.01 : Start file change log
См. определение в файле mailbox.h