/************************** Copyright (c) **********************************
|
** FUZHOU FUGUANG ELECTRONICS Co.,LTD.
|
** ¸£Öݸ£¹âµç×ÓÓÐÏÞ¹«Ë¾
|
** http://www.fuguang.com
|
**
|
**-------------- File Info -------------------------------------------------
|
** File name: AD7843_Driver.h
|
** Last modified Date: 2008-11-16
|
** Last Version: 1.0
|
** Descriptions: AD7843 Drivers lib
|
**
|
**--------------------------------------------------------------------------
|
** Created by: mxpopstar
|
** Created date: 2008-11-16
|
** Version: 1.0
|
** Descriptions: The original version
|
**
|
**--------------------------------------------------------------------------
|
** Modified by: mxpopstar
|
** Modified date: 2008-11-20
|
** Version:
|
** Descriptions: AD7843 Drivers lib
|
**
|
***************************************************************************/
|
//
|
|
#ifndef AD7843_Driver_H
|
#define AD7843_Driver_H
|
//----------------------------------------------------------------------------------
|
//--------------------- IOPORT -----------------------------------------------------
|
#define AD7843_CS_DDR DDRA
|
#define AD7843_CS_PORT PORTA
|
#define AD7843_CS_PIN PA7
|
#define AD7843_CS_1 AD7843_CS_PORT |= (1<<AD7843_CS_PIN) //PINA7
|
#define AD7843_CS_0 AD7843_CS_PORT &= ~(1<<AD7843_CS_PIN)
|
//----------------------------------------------------------------------------------
|
#define AD7843_MOSI_DDR DDRB
|
#define AD7843_MOSI_PORT PORTB
|
#define AD7843_MOSI_PIN PB2
|
#define AD7843_MOSI_1 AD7843_MOSI_PORT |= (1<<AD7843_MOSI_PIN) //PINB2
|
#define AD7843_MOSI_0 AD7843_MOSI_PORT &= ~(1<<AD7843_MOSI_PIN)
|
//----------------------------------------------------------------------------------
|
#define AD7843_MISO_DDR DDRB
|
#define AD7843_MISO_PORT PORTB
|
#define AD7843_MISO_PIN PB3
|
#define AD7843_MISO_PNAME PINB
|
#define AD7843_MISO_1 (AD7843_MISO_PNAME & (1<<AD7843_MISO_PIN)) //PINB3
|
//----------------------------------------------------------------------------------
|
#define AD7843_SCK_DDR DDRB
|
#define AD7843_SCK_PORT PORTB
|
#define AD7843_SCK_PIN PB1
|
#define AD7843_SCK_1 AD7843_SCK_PORT |= (1<<AD7843_SCK_PIN) //PINB1
|
#define AD7843_SCK_0 AD7843_SCK_PORT &= ~(1<<AD7843_SCK_PIN)
|
//----------------------------------------------------------------------------------
|
#define AD7843_PENIRQ_DDR DDRD
|
#define AD7843_PENIRQ_PORT PORTD
|
#define AD7843_PENIRQ_PIN PD1
|
#define AD7843_PENIRQ_PNAME PIND
|
#define AD7843_PENIRQ_1 AD7843_PENIRQ_PORT |= (1<<AD7843_PENIRQ_PIN)
|
#define NO_AD7843_PENIRQ (AD7843_PENIRQ_PNAME & (1<<AD7843_PENIRQ_PIN)) //PIND1
|
//----------------------------------------------------------------------------------
|
|
#define ButtonNull 0
|
#define Button0 1
|
#define Button1 2
|
#define Button2 3
|
#define Button3 4
|
#define Button4 5
|
#define Button5 6
|
#define Button6 7
|
#define Button7 8
|
#define Button8 9
|
|
#define MenuItem0 10
|
#define MenuItem1 11
|
#define MenuItem2 12
|
#define MenuItem3 13
|
#define MenuItem4 14
|
#define MenuItem5 15
|
|
#define ButtonOK 2
|
#define ButtonCancel 4
|
#define ButtonSingleOK 3
|
|
#include<avr/io.h>
|
#include <util/delay.h>
|
#include "Buzzer_Driver.h"
|
|
void InitIo_AD7843(void);
|
void SpiWrite_AD7843(const unsigned char byte);
|
unsigned char SpiRead_AD7843(void);
|
void GetAndDSPKeyboardSel(void);
|
void SetKeyboardSel(const unsigned char settype);
|
unsigned char GetTouchLocal(void);
|
unsigned char GetButtonDown(const unsigned char x, const unsigned char y);
|
void EnableCustomInput(void);
|
void DisableCustomInput(void);
|
|
#endif
|
//
|