| AVR Z-LINKŪ |

# ftdi.c File Reference

## Detailed Description

This files contains the functions for initializing and sending data using the FTDI USB fifo on the STK541 board.

Application note:
  AVR414: User's Guide - ATAVRRZ502 - Accessory Kit

Documentation
  For comprehensive code documentation, supported compilers, compiler settings and supported devices see readme.html

Author:
  Atmel Corporation: http://www.atmel.com
  Support email: avr@atmel.com

Name

Revision
  1.2

RCSfile
  callbacks.c,v

Date
  2006/09/15 17:02:19

Definition in file ftdi.c.

`#include "ftdi.h"`

Include dependency graph for ftdi.c:

Go to the source code of this file.

## Functions
void | ftdiInitialization (void)
| Initialize the USB FIFO.
void | ftdiSendSymbol (const uint8_t symbol)
| Send one symbol to the USB FIFO.

## Function Documentation

void ftdiInitialization | ( | void |  | ) |

Initialize the USB FIFO.

Note:
  This function uses the external memory interface.

Definition at line 36 of file ftdi.c.

References FTDI_CONFIGURE_PIN_CHANGE_INTERRUPT, FTDI_ENABLE_RECEIVER, FTDI_ENABLE_TX, and XRAM_ENABLE.

Referenced by serialInterfaceInitialization().

    00036                                {
    00037
    00038         XRAM_ENABLE( );
    00039
    00040         /* make sure USB_RXF and USB_TXE are inputs */
    00041         FTDI_ENABLE_TX( );
    00042
    00043         //Enable external interrupt on FTDI_RX pin.
    00044         FTDI_CONFIGURE_PIN_CHANGE_INTERRUPT( );
    00045         FTDI_ENABLE_RECEIVER( );
    00046 }

void ftdiSendSymbol | ( | const uint8_t | symbol | ) |

Send one symbol to the USB FIFO.

This function passes one symbol (8 bits) to the FTDI USB FIFO chip.

Note:
  ftdiInitialization() must be called first.

Parameters:

  | symbol | Symbol to be sent.

Definition at line 57 of file ftdi.c.

References FTDI_Fifo, FTDI_PIN, FTDI_TX_MASK, and LOW.

Referenced by sendSymbol().

    00057                                            {
    00058
    00059         //Wait until the fifo is ready.
    00060         while( ( FTDI_TX_MASK & FTDI_PIN ) != LOW ){
    00061                 ;
    00062         }
    00063
    00064         //Write symbol to memory address.
    00065         *FTDI_Fifo = ( symbol );
    00066 }

@DOC_TITLE@