📄 binio.h
字号:
/****h* DE9901/binio.h
* COPYRIGHT
* (c) 2003-2005 Mobitex Technology AB - All rights reserved
*
* Redistribution and use in source and binary forms, with or without modification,
* are permitted provided that the following conditions are met:
* * 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* * 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* * 3. The name Mobitex Technology AB may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY MOBITEX TECHNOLOGY AB "AS IS" AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
* SHALL MOBITEX TECHNOLOGY AB BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* AUTHOR
* MPN/Lars Weber, MPN/Kjell Westerberg
* HISTORY
* Changes in the file are recorded in this list.
* Ver: Date: Responsible: Comment:
* R1A01 2005-01-17 Kjell Westerberg Approved.
* R1A06 2005-04-06 Kjell Westerberg Changed for EB40A.
* DESCRIPTION
* Definitions for the binary I/O module on DE9901.
***/
#ifndef BINIO_H_
#define BINIO_H_
/****************************************************************************
* Type definitions for the binary I/O module
****************************************************************************/
#ifdef DE9901_BOARD
typedef enum {
BINIO_SLEEP_BURST = 0x00, /* P0: Sleep_burst is high for 32 kHz system clock (input) */
BINIO_BIN3, /* P1: IO 3 (default input), SW3 */
BINIO_BIN4, /* P2: IO 4 (default input), SW4 */
BINIO_BIN2, /* P3: IO 2 (default input) */
BINIO_XTAL_32K, /* P4: 32 kHz input for calibration (input) */
BINIO_BIN1, /* P5: IO 1 (default input) */
BINIO_SPI_SO, /* P6: SPI bus SO line (not used) */
BINIO_SDA, /* P7: I2C Data line & SPI bus SCK line (handled by I2C) */
BINIO_SCL, /* P8: I2C Clock line & SPI bus SI line (handled by I2C) */
BINIO_CML_IRQ, /* P9: IRQ0 from CMX990 chip (handled by eCos), SW2 */
BINIO_RTS, /* P10: IRQ1 MASC port (input binio irq) */
BINIO_DTR, /* P11: IRQ2 MASC port (input binio irq) */
BINIO_DOWNLOAD, /* P12: Download signal for FLASH uploader (input), SW1 */
/* and NBUSY signal from FLASH memory. */
BINIO_VRX_ON, /* P13: RX Power on (output low) */
BINIO_TD, /* P14: MASC serial TD (handled by USART, eCos) */
BINIO_RD, /* P15: MASC serial RD (handled by USART, eCos) */
BINIO_SHIFT_CLK, /* P16: Shift between 19.2 MHz & 32 kHz (output low) */
BINIO_POW_ON, /* P17: Modem Power on signal (output high), LED2 */
BINIO_V_TCXO_OFF, /* P18: Ref. clock off signal (19.2 MHz) (output low) */
BINIO_VTX_ON, /* P19: TX Power on (VTX & VPA) (output low) */
BINIO_VRF_ON, /* P20: RF Power on (VRF) (output low) */
BINIO_TD_C, /* P21: Console serial TD (handled by USART, eCos) */
BINIO_RD_C, /* P22: Console serial RD (handled by USART, eCos) */
BINIO_BIN5, /* P23: IO 5 (default input) */
BINIO_TX_ON, /* P24: TX Switch on (output low) */
BINIO_MODE2, /* P25: Mode2 LED (output low) */
BINIO_MODE1, /* P26: Mode1 LED & SPI bus CS line (output low) */
BINIO_CTS, /* P27: MASC port (output high) */
BINIO_P28, /* P28: Don't use this port. Also A20 to Flash memory.*/
BINIO_DCD, /* P29: MASC port (output high) */
BINIO_DSR, /* P30: MASC port (output high) */
BINIO_RI /* P31: MASC port (output high) */
} BINIO_Port_t;
#endif
#ifdef EB40A_BOARD
typedef enum {
BINIO_A0 = 0x00, /* P0: CMX990 A0 (output) */
BINIO_SW3, /* P1: Switch 3 (default input), SW3 */
BINIO_SW4, /* P2: Switch 4 (default input), SW4 */
BINIO_A1, /* P3: CMX990 A1 (output), LED5 */
BINIO_A2, /* P4: CMX990 A2 (output), LED6 */
BINIO_A3, /* P5: CMX990 A3 (output), LED7 */
BINIO_A4, /* P6: CMX990 A4 (output), LED8 */
BINIO_SDA, /* P7: I2C Data line & SPI bus SCK line (handled by I2C) */
BINIO_SCL, /* P8: I2C Clock line & SPI bus SI line (handled by I2C) */
BINIO_SW2, /* P9: Switch 2 (default input IRQ0), SW2 */
BINIO_IRQ1, /* P10: NBUSY signal from FLASH memory (input IRQ1) */
BINIO_CML_IRQ, /* P11: IRQ from CMX990 chip (handled by eCos) */
BINIO_DOWNLOAD, /* P12: Download signal for FLASH uploader (input), SW1 */
BINIO_CSN, /* P13: CMX990 CSN (output) */
BINIO_TD, /* P14: MASC serial TD (handled by USART, eCos) */
BINIO_RD, /* P15: MASC serial RD (handled by USART, eCos) */
BINIO_RX_ON, /* P16: RX Switch on (output low), LED1 */
BINIO_TX_ON, /* P17: TX Switch on (output low), LED2 */
BINIO_A5, /* P18: CMX A5 (output), LED3 */
BINIO_RDN, /* P19: CMX990 RDN (output), LED4 */
BINIO_WRN, /* P20: CMX990 WRN (output) */
BINIO_TD_C, /* P21: Console serial TD (handled by USART, eCos) */
BINIO_RD_C, /* P22: Console serial RD (handled by USART, eCos) */
BINIO_D0, /* P23: CMX990 D0 (I/O) */
BINIO_D1, /* P24: CMX990 D1 (I/O) */
BINIO_D2, /* P25: CMX990 D2 (I/O) */
BINIO_D3, /* P26: CMX990 D3 (I/O) */
BINIO_D4, /* P27: CMX990 D4 (I/O) */
BINIO_P28, /* P28: Don't use this port. Also A20 to Flash memory.*/
BINIO_D5, /* P29: CMX990 D5 (I/O) */
BINIO_D6, /* P30: CMX990 D6 (I/O) */
BINIO_D7 /* P31: CMX990 D7 (I/O) */
} BINIO_Port_t;
#endif
typedef enum {
BINIO_IN = 0,
BINIO_OUT = 1
} BINIO_Direction_t;
typedef enum {
BINIO_LOW = 0,
BINIO_HIGH = 1
} BINIO_State_t;
/****************************************************************************
* Exported functions
****************************************************************************/
void BINIO_Init(void);
void BINIO_SetPort(BINIO_Port_t port, BINIO_State_t state);
BINIO_State_t BINIO_ReadPort(BINIO_Port_t port);
cyg_uint32 BINIO_Isr(cyg_vector_t vector, cyg_addrword_t data);
void BINIO_EnableBinioInterrupt(BINIO_Port_t port, bool enable);
void BINIO_EnableBinioFilter(BINIO_Port_t port, bool enable);
void BINIO_SetupInputPort(BINIO_Port_t port);
void BINIO_SetupOutputPort(BINIO_Port_t port, BINIO_State_t state);
BINIO_Direction_t BINIO_ReadDirection(BINIO_Port_t port);
#endif /* BINIO_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -