at91rm3400 ATMEL Corporation, at91rm3400 Datasheet - Page 66

no-image

at91rm3400

Manufacturer Part Number
at91rm3400
Description
Atmel Advanced At91 Arm Microcontroller
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
at91rm3400-AU-002
Manufacturer:
Atmel
Quantity:
10 000
Description of the
SvcXmodem Structure
66
AT91RM3400
The SvcXmodem service is a reusable implementation of the Xmodem protocol. It supports
only the 128-byte packet format and provides read and write functions. The SvcXmodem
structure defines:
With this structure, the Xmodem protocol can be used with all media (USART, USB, etc.).
Only private methods may be overloaded to adapt the Xmodem protocol to a new media.
The default implementation of the Xmodem uses a USART to send and receive packets. Read
and write functions implement peripheral data controller facilities to reduce interrupt overhead.
It assumes the USART is initialized, the memory buffer allocated and the interrupts
programmed.
A periodic timer is required by the service to manage timeouts and the periodic transmission of
the character “C” (Refer to Xmodem protocol). This feature is provided by the Tempo Service.
The following structure defines the Xmodem Service:
a pointer to a handler initialized to readHandler or writeHandler
a pointer to a function that processes the xmodem packet crc
a pointer to a function that checks the packet header
a pointer to a function that checks data
typedef struct _AT91PS_SvcXmodem {
csr);
csr);
} AT91S_SvcXmodem, *AT91PS_SvcXmodem
// Public Methods:
AT91S_SvcCommStatus (*Handler) (struct _AT91PS_SvcXmodem *, unsigned int);
AT91S_SvcCommStatus (*StartTx) (struct _AT91PS_SvcXmodem *, unsigned int);
AT91S_SvcCommStatus (*StopTx)
// Private Methods:
AT91S_SvcCommStatus (*ReadHandler)
AT91S_SvcCommStatus (*WriteHandler) (struct _AT91PS_SvcXmodem *, unsigned int
unsigned short
char
char
AT91S_SvcComm
AT91PS_USART pUsart;
AT91S_SvcTempo tempo; // Link to a AT91S_Tempo object
char
unsigned int
char
unsigned char packetId;
char
char
char
*pData;
dataSize;
packetDesc[AT91C_XMODEM_PACKET_SIZE];
packetStatus;
isPacketDesc;
eot;
parent;
(*GetCrc)
(*CheckHeader)
(*CheckData)
// Base class
// end of transmition
(struct _AT91PS_SvcXmodem *, unsigned int);
// = XMODEM_DATA_STX or XMODEM_DATA_SOH
// Current packet
(struct _AT91PS_SvcXmodem *, unsigned int
(char *ptr, unsigned int count);
(unsigned char currentPacket, char *packet);
(struct _AT91PS_SvcXmodem *);
1790A–ATARM–11/03

Related parts for at91rm3400