📄 io.h
字号:
/******************************************************************************
COPYRIGHT 2002 STMicroelectronics
Source File Nam e : IO.h
Group : IPSW,CMG-IPDF
Author : MCD Application Team
Date First Issued : 07/03/2002
********************************Documentation**********************************
General Purpose - Contains prototypes for all the functions of IO
********************************Revision History*******************************
_______________________________________________________________________________
Date :07/03/2002 Release:1.0
Date :16/09/2003 Release:2.0 (for Lite2) No changes done
Date :28/04/04 MISRA changes
Date :16/03/2006 BETA Release: Add IO_LITEUS. Only PORT A available for UltraLite
******************************************************************************/
#ifndef IO_H
#define IO_H
#include "ST7lib_config.h"
/*---------------------------------------------------------------------------*/
/* enumarated data types declaration */
/* Input mode configuration parameters */
typedef enum {
IO_FLOATING = (unsigned char) 0x00,
IO_FLOATING_IT = (unsigned char) 0x8C,
IO_PULL_UP = (unsigned char) 0xFF,
IO_PULL_UP_IT = (unsigned char) 0x77
}IO_Input_Mode;
/* Port names configuration parameters */
typedef enum {
IO_PORT_A = (unsigned char) 0x00,
IO_PORT_B = (unsigned char) 0x01
}IO_Port;
/* Port pin configuration parameters */
typedef enum {
IO_PIN_0 = (unsigned char) 0x01,
IO_PIN_1 = (unsigned char) 0x02,
IO_PIN_2 = (unsigned char) 0x04,
IO_PIN_3 = (unsigned char) 0x08,
IO_PIN_4 = (unsigned char) 0x10,
IO_PIN_5 = (unsigned char) 0x20,
IO_PIN_6 = (unsigned char) 0x40,
IO_PIN_7 = (unsigned char) 0x80
}IO_Pin;
/* Output mode configuration parameters */
typedef enum {
IO_OPEN_DRAIN = (unsigned char) 0x01,
IO_PUSH_PULL = (unsigned char) 0x02
}IO_Output_Mode ;
/* Write data values */
typedef enum {
IO_DATA_HIGH = (unsigned char) 0x01,
IO_DATA_LOW = (unsigned char) 0x02,
IO_DATA_TOGGLE = (unsigned char) 0x03
}IO_Write_Data;
/*---------------------------------------------------------------------------*/
/* Description of all the functions defined in this module */
void IO_Init (void); /* Initialise IO Port registers */
/* Configure the IO ports in input mode */
void IO_Input (IO_Input_Mode Input_Val, IO_Port Port_Val1, IO_Pin Pin_Val1);
/* Configure the IO ports in output mode */
void IO_Output (IO_Output_Mode Output_Val,IO_Port Port_Val2, IO_Pin Pin_Val2);
/* Reads the port and returns the value to user */
unsigned char IO_Read (IO_Port Read_Val);
/* Writes the data into the port pin */
void IO_Write (IO_Port Port_Val3,IO_Pin Pin_Val3, IO_Write_Data Data_Val);
/* Writes data byte in port register*/
void IO_ByteWrite (IO_Port Port_Val4,unsigned char IO_ByteData);
#endif
/**** (c) 2002 STMicroelectronics *************************** END OF FILE **/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -