util.h File Reference


Detailed Description

AVR Util Stuff.

Author:
Ricardo Castro (sirpdc@gmail.com)

Definition in file util.h.

#include <avr/io.h>
#include <stdlib.h>
#include <inttypes.h>
#include <avr/delay.h>
#include <avr/pgmspace.h>

Go to the source code of this file.

Defines

#define ASYNC_MODE   (0<<UMSEL)
#define SYNC_MODE   (1<<UMSEL)
#define PARITY_DISABLE   (0<<UPM1 | 0<<UPM0)
#define PARITY_EVEN   (1<<UPM1 | 0<<UPM0)
#define PARITY_ODD   (1<<UPM1 | 1<<UPM0)
#define STOP_BITS1   (0<<USBS)
#define STOP_BITS2   (1<<USBS)
#define DATA_SIZE8   (0<<UCSZ2 | 1<<UCSZ1 | 1<<UCSZ0)
#define DATA_SIZE9   (1<<UCSZ2 | 1<<UCSZ1 | 1<<UCSZ0)
#define TxStr_P(_PSTR_)   _TxStr_P( PSTR(_PSTR_) )
#define TxStrk(_str_)
#define TxStrk_P(_str_)
#define TxUintk(_uint_)
#define TxEolk()
#define TxHexk(_uint_)
#define TxChark(_char_)

Functions

void USART_Init (unsigned int uiBaud, unsigned char ucConf)
void _TxStr_P (const char *str_flash)
void TxChar (unsigned char ucData)
void TxStr (const char *strBuff)
void TxUint (uint16_t number)
void TxEol (void)
void TxHex (unsigned char ucData)
unsigned char RxChar (void)
void delay (uint16_t d)
void delay_u (uint16_t d)


Define Documentation

#define ASYNC_MODE   (0<<UMSEL)
 

Definition at line 26 of file util.h.

Referenced by USART_Init().

#define DATA_SIZE8   (0<<UCSZ2 | 1<<UCSZ1 | 1<<UCSZ0)
 

Definition at line 36 of file util.h.

Referenced by main().

#define DATA_SIZE9   (1<<UCSZ2 | 1<<UCSZ1 | 1<<UCSZ0)
 

Definition at line 37 of file util.h.

#define PARITY_DISABLE   (0<<UPM1 | 0<<UPM0)
 

Definition at line 29 of file util.h.

Referenced by main().

#define PARITY_EVEN   (1<<UPM1 | 0<<UPM0)
 

Definition at line 30 of file util.h.

#define PARITY_ODD   (1<<UPM1 | 1<<UPM0)
 

Definition at line 31 of file util.h.

#define STOP_BITS1   (0<<USBS)
 

Definition at line 33 of file util.h.

Referenced by main().

#define STOP_BITS2   (1<<USBS)
 

Definition at line 34 of file util.h.

#define SYNC_MODE   (1<<UMSEL)
 

Definition at line 27 of file util.h.

#define TxChark _char_   ) 
 

Definition at line 80 of file util.h.

Referenced by ei_receive(), and ei_transmit().

 
#define TxEolk  ) 
 

Definition at line 78 of file util.h.

Referenced by ei_receive(), ei_transmit(), ei_tx_err(), and ei_tx_intr().

#define TxHexk _uint_   ) 
 

Definition at line 79 of file util.h.

Referenced by ei_receive(), and ei_tx_err().

#define TxStr_P _PSTR_   )     _TxStr_P( PSTR(_PSTR_) )
 

Definition at line 44 of file util.h.

Referenced by ei_init(), and main().

#define TxStrk _str_   ) 
 

Definition at line 75 of file util.h.

#define TxStrk_P _str_   ) 
 

Definition at line 76 of file util.h.

Referenced by ei_receive(), ei_transmit(), ei_tx_err(), ei_tx_intr(), and udp_app().

#define TxUintk _uint_   ) 
 

Definition at line 77 of file util.h.

Referenced by ei_receive().


Function Documentation

void _TxStr_P const char *  str_flash  ) 
 

Definition at line 79 of file util.c.

References c, and TxChar().

void delay uint16_t  d  ) 
 

Definition at line 162 of file util.c.

References i.

Referenced by main().

void delay_u uint16_t  d  ) 
 

Definition at line 177 of file util.c.

References i.

unsigned char RxChar void   ) 
 

Definition at line 116 of file util.c.

Referenced by RxFrame().

void TxChar unsigned char  ucData  ) 
 

Definition at line 45 of file util.c.

Referenced by _TxStr_P(), ei_init(), nic_mem_test(), TxEol(), TxFrame(), TxHex(), and TxStr().

void TxEol void   ) 
 

Definition at line 105 of file util.c.

References TxChar().

Referenced by ei_init(), main(), and nic_mem_test().

void TxHex unsigned char  ucData  ) 
 

Definition at line 131 of file util.c.

References TxChar(), and TxUint().

Referenced by ei_init(), and nic_mem_test().

void TxStr const char *  strBuff  ) 
 

Definition at line 59 of file util.c.

References i, and TxChar().

Referenced by nic_mem_test(), and TxUint().

void TxUint uint16_t  number  ) 
 

Definition at line 93 of file util.c.

References TxStr().

Referenced by TxHex().

void USART_Init unsigned int  uiBaud,
unsigned char  ucConf
 

Definition at line 26 of file util.c.

References ASYNC_MODE.

Referenced by main().


Generated on Fri Jan 6 22:23:17 2006 for EtherProgs by  doxygen 1.4.5