⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ma_io.h

📁 avr Rtos 255 Task avr Rtos 255 Task
💻 H
字号:

/*
*****************************************************************************
**
**      Project     : My project
**
**      Component   : test (ATmega128)
**
**      Modulename  : I/O
**
**      Filename    : ma_io.h
**
**      Abstract    : This is the device driver header file for the I/O 
**                    module.
**
**      Compiler    : IAR C compiler
**
**      Date        : 2005-10-21 16:57:06
**
**      License no. : N/A     Administrator
**
**      Warning     : This file has been automatically generated.
**                    Do not edit this file if you intend to regenerate it.
**
**      This device driver was created by IAR MakeApp version 
**      4.01A (Atmel megaAVR: 4.00A) for the Atmel megaAVR series of
**      microcontrollers.
**
**      (c)Copyright 2003 IAR Systems.
**      Your rights to this file are explained in the IAR MakeApp 
**      License Agreement. All other rights reserved.
**
*****************************************************************************
*/

/*
**===========================================================================
**  1       GENERAL
**  1.1     Revisions
**
**  Please read the IAR MakeApp for Atmel megaAVR readme file 
**  
**
**===========================================================================
*/

/*
**===========================================================================
**  1.2     References
** 
**  No   Identification          Name or Description
**  ==   ===================     ================================
**  1    2467G-AVR-09/02         ATmega128 Hardware Manual
** 
**===========================================================================
*/

/*
**===========================================================================
**  1.3     Re-definition guard
**===========================================================================
*/

/*--- Avoid including this file more than once ---*/
#ifndef _IS_INCLUDED_IO_H
#define _IS_INCLUDED_IO_H

/*
**===========================================================================
**  2.      INCLUDE FILES
**  2.1     Standard include files
**===========================================================================
*/

/*
**===========================================================================
**  2.2     Application include files
**===========================================================================
*/

#include "ma_tgt.h"

/*
**===========================================================================
**  3.      DECLARATIONS
**  3.1     Global constants
**===========================================================================
*/


/*--- Port constants ---*/
#define MA_PORTA  0x0a
#define MA_PORTB  0x0b
#define MA_PORTC  0x0c
#define MA_PORTD  0x0d
#define MA_PORTE  0x0e
#define MA_PORTF  0x0f
#define MA_PORTG  0x10

/*--- Port B ---*/
#define MA_USEPIN_OC2_IO          DDRB |= 0x80
#define MA_USEPIN_OC1C_IO         DDRB |= 0x80
#define MA_USEPIN_OC1B_IO         DDRB |= 0x40
#define MA_USEPIN_OC1A_IO         DDRB |= 0x20
#define MA_USEPIN_OC0_IO          DDRB |= 0x10
#define MA_USEPIN_MISO_OUTPUT_IO  DDRB |= 0x08
#define MA_USEPIN_MISO_INPUT_IO   DDRB &= ~0x08
#define MA_USEPIN_MOSI_OUTPUT_IO  DDRB |= 0x04
#define MA_USEPIN_MOSI_INPUT_IO   DDRB &= ~0x04
#define MA_USEPIN_SCK_OUTPUT_IO   DDRB |= 0x02
#define MA_USEPIN_SCK_INPUT_IO    DDRB &= ~0x02
#define MA_USEPIN_SS_OUTPUT_IO    DDRB |= 0x01
#define MA_USEPIN_SS_INPUT_IO     DDRB &= ~0x01

/*--- Port C ---*/
#define MA_USEPIN_A15_IO          DDRC |= 0x80
#define MA_USEPIN_A14_IO          DDRC |= 0x40
#define MA_USEPIN_A13_IO          DDRC |= 0x20
#define MA_USEPIN_A12_IO          DDRC |= 0x10
#define MA_USEPIN_A11_IO          DDRC |= 0x08
#define MA_USEPIN_A10_IO          DDRC |= 0x04
#define MA_USEPIN_A9_IO           DDRC |= 0x02
#define MA_USEPIN_A8_IO           DDRC |= 0x01

/*--- Port D ---*/
#define MA_USEPIN_T2_IO           DDRD &= ~0x80
#define MA_USEPIN_T1_IO           DDRD &= ~0x40
#define MA_USEPIN_XCK1_INPUT_IO   DDRD &= ~0x20
#define MA_USEPIN_XCK1_OUTPUT_IO  DDRD |= 0x20
#define MA_USEPIN_IC1_IO          DDRD &= ~0x10
#define MA_USEPIN_INT3_IO         DDRD &= ~0x08
#define MA_USEPIN_INT2_IO         DDRD &= ~0x04
#define MA_USEPIN_INT1_IO         DDRD &= ~0x02
#define MA_USEPIN_INT0_IO         DDRD &= ~0x01
#define MA_USEPIN_TXD1_IO         DDRD |= 0x08
#define MA_USEPIN_RXD1_IO         DDRD &= ~0x04

/*--- Port E ---*/
#define MA_USEPIN_INT7_IO         DDRE &= ~0x80
#define MA_USEPIN_INT6_IO         DDRE &= ~0x40
#define MA_USEPIN_INT5_IO         DDRE &= ~0x20
#define MA_USEPIN_INT4_IO         DDRE &= ~0x10
#define MA_USEPIN_IC3_IO          DDRE &= ~0x80
#define MA_USEPIN_T3_IO           DDRE &= ~0x40
#define MA_USEPIN_OC3C_IO         DDRE |= 0x20
#define MA_USEPIN_OC3B_IO         DDRE |= 0x10
#define MA_USEPIN_OC3A_IO         DDRE |= 0x08
#define MA_USEPIN_AIN1_IO         DDRE &= ~0x08
#define MA_USEPIN_AIN0_IO         DDRE &= ~0x04
#define MA_USEPIN_XCK0_INPUT_IO   DDRE &= ~0x04
#define MA_USEPIN_XCK0_OUTPUT_IO  DDRE |= 0x04
#define MA_USEPIN_TXD0_IO         DDRE |= 0x02
#define MA_USEPIN_RXD0_IO         DDRE &= ~0x01

/*--- Port F ---*/
#define MA_USEPIN_ADC7_IO         DDRF &= ~0x80
#define MA_USEPIN_ADC6_IO         DDRF &= ~0x40
#define MA_USEPIN_ADC5_IO         DDRF &= ~0x20
#define MA_USEPIN_ADC4_IO         DDRF &= ~0x10
#define MA_USEPIN_ADC3_IO         DDRF &= ~0x08
#define MA_USEPIN_ADC2_IO         DDRF &= ~0x04
#define MA_USEPIN_ADC1_IO         DDRF &= ~0x02
#define MA_USEPIN_ADC0_IO         DDRF &= ~0x01
#define MA_USEPIN_TDI_IO          DDRF &= ~0x80
#define MA_USEPIN_TDO_IO          DDRF |= 0x40
#define MA_USEPIN_TMS_IO          DDRF &= ~0x20
#define MA_USEPIN_TCK_IO          DDRF &= ~0x10

/*--- Port G ---*/
#define MA_USEPIN_TOSC1_IO        DDRG &= ~0x10
#define MA_USEPIN_TOSC2_IO        DDRG |= 0x08
#define MA_USEPIN_ALE_IO          DDRG |= 0x04
#define MA_USEPIN_RD_IO           DDRG |= 0x02
#define MA_USEPIN_WR_IO           DDRG |= 0x01


/*
**===========================================================================
**  3.2     Global macros
**===========================================================================
*/

/*
**===========================================================================
**  3.3     Global type definitions
**===========================================================================
*/

/*
**===========================================================================
**  3.4     Global variables (defined in some implementation file)
**===========================================================================
*/


/*
**===========================================================================
**  4.      GLOBAL FUNCTIONS (defined in some implementation file)
**===========================================================================
*/

extern void MA_Init_IO( void );
extern void MA_Reset_IO( void );
extern S8 MA_SetPortIn_IO( U8 Port, U8 BitMask );
extern S8 MA_SetPortOut_IO( U8 Port, U8 BitMask );
extern S8 MA_ReadPort_IO( U8 Port );
extern S8 MA_WritePort_IO( U8 Port, U8 Value, U8 BitMask );


#endif /* Match the re-definition guard */


/*
**===========================================================================
** END OF FILE
**===========================================================================
*/ 


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -