/********************************************************************* * * Microchip USB C18 Firmware Version 1.0 * ********************************************************************* * FileName: io_cfg.h * Dependencies: See INCLUDES section below * Processor: PIC18 * Compiler: C18 2.30.01+ * Company: Microchip Technology, Inc. * * Author Date Comment *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * Rawin Rojvanit 21/07/04 Original. * Dario Greggio 28/02/05 . ********************************************************************/ #ifndef IO_CFG_H #define IO_CFG_H /** I N C L U D E S *************************************************/ #include "autofiles\usbcfg.h" /** T R I S *********************************************************/ #define INPUT_PIN 1 #define OUTPUT_PIN 0 /** U S B ***********************************************************/ #define usb_bus_sense 1 #define self_power 1 /** I N P U T / O U T P U T *****************************************************/ // port A #define Led1Bit 0 #define m_Led1Bit LATAbits.LATA0 #define Led2Bit 1 #define m_Led2Bit LATAbits.LATA1 #define Led3Bit 2 #define m_Led3Bit LATAbits.LATA2 #define SPIClkBit 3 #define m_SPIClkBit LATAbits.LATA3 #define SPIDataIBit 4 #define m_SPIDataIBit PORTAbits.RA4 //#define ErrBit 4 // open-collector ?? 18? //#define m_ErrBit LATAbits.LATA4 // 5 : per causa di ADCON1 (se USATO, v. conf.), questo e' solo IN-analogico (non digitale) opp. OUTPUT! //#define Puls2Bit 5 // no! SOLO OUTPUT! //#define m_Puls2Bit PORTBbits.RA5 // port B #define HoldMemBit 2 #define m_HoldMemBit LATBbits.LATB2 #define CSMemBit 3 #define m_CSMemBit LATBbits.LATB3 #define SPIDataOBit 5 #define m_SPIDataOBit LATBbits.LATB5 #define SuonaBit 7 #define m_SuonaBit PORTBbits.RB7 #define SuonaStopBit 7 #define m_SuonaStopBit PORTBbits.RB7 #define Puls1Bit 6 #define m_Puls1Bit PORTBbits.RB6 // port C // #define ;BeepBit equ 2 #define AddrBranoBit 1 // 2..3 = brano default 1..4 (se AddrTipoBit=0) #define m_AddrBranoBit PORTCbits.RC1 #define SuonaBrano0Bit 1 // suona brano 0 (x Sttrama 2006) #define m_SuonaBrano0Bit PORTCbits.RC1 #define AddrTipoBit 0 // 0= brano default scelto da hardware, 1=scelto da software #define m_AddrTipoBit PORTCbits.RC0 #define SuonaBrano1Bit 0 // suona brano 1 (x Sttrama 2006) #define m_SuonaBrano1Bit PORTCbits.RC0 #define CSDABit 7 #define m_CSDABit LATCbits.LATC7 #define Led1Val (1 << Led1Bit) #define Led2Val (1 << Led2Bit) #define Led3Val (1 << Led3Bit) #define CSMemVal (1 << CSMemBit) #define CSDAVal (1 << CSDABit) #define ErrVal (1 << ErrBit) #define Puls1Val (1 << Puls1Bit) #define Puls2Val (1 << Puls2Bit) #define SuonaVal (1 << SuonaBit) #define AddrTipoVal (1 << AddrTipoBit) #define AddrBranoVal (1 << AddrBranoBit) #define SPIDataIVal (1 << SPIDataIBit) #define SPIDataOVal (1 << SPIDataOBit) #define SPIClkVal (1 << SPIClkBit) #define HoldMemVal (1 << HoldMemBit) #endif //IO_CFG_H