Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
di.h
00001 #include "mbed.h" 00002 00003 00004 00005 //--------------------------------------- 00006 // Definitions 00007 //--------------------------------------- 00008 #define DI_PIN9_24_I2C_ADD ( I2C_BASE_ADDRESS + (6 << 1) ) // I2C_BASE_ADDRESS is defined in MCP23017 00009 #define DI_PIN1_8_I2C_ADD ( I2C_BASE_ADDRESS + (4 << 1) ) // I2C_BASE_ADDRESS is defined in MCP23017 00010 00011 // define pin number (0..15) of MCP23017 00012 typedef enum 00013 { 00014 DI_PIN1 = 7, 00015 DI_PIN2 = 6, 00016 DI_PIN3 = 5, 00017 DI_PIN4 = 4, 00018 DI_PIN5 = 3, 00019 DI_PIN6 = 2, 00020 DI_PIN7 = 1, 00021 DI_PIN8 = 0, 00022 DI_PIN9 = 15, 00023 DI_PIN10 = 14, 00024 DI_PIN11 = 13, 00025 DI_PIN12 = 12, 00026 DI_PIN13 = 11, 00027 DI_PIN14 = 10, 00028 DI_PIN15 = 9, 00029 DI_PIN16 = 8, 00030 DI_PIN17 = 7, 00031 DI_PIN18 = 6, 00032 DI_PIN19 = 5, 00033 DI_PIN20 = 4, 00034 DI_PIN21 = 3, 00035 DI_PIN22 = 2, 00036 DI_PIN23 = 1, 00037 DI_PIN24 = 0, 00038 //--------------- 00039 CNT_DI_ePinTable 00040 }DI_ePinTable; 00041 00042 #define DI_NUMBER_PINS ( 24 ) 00043 00044 #define DI_LEVEL_LOW ( 8 ) 00045 #define DI_LEVEL_HIGH ( 9 ) 00046 00047 00048 //--------------------------------------- 00049 // Enums 00050 //--------------------------------------- 00051 00052 // Global commands 0 - 20 are defined in interpret.h 00053 // Commands 21 - 127 are HW-unit commands 00054 typedef enum 00055 { 00056 DI_SET_LEVEL_LOW = 21, // 21: setLevelLow 00057 DI_GET_LEVEL_LOW, // 22: getLevelLow 00058 DI_SET_LEVEL_HIGH, // 23: setLevelHigh 00059 DI_GET_LEVEL_HIGH, // 24: getLevelHigh 00060 DI_SET_SINGLE, // 25: setSingle 00061 DI_CLEAR_SINGLE, // 26: clearSingle 00062 DI_GET_SINGLE, // 27: getSingle 00063 DI_SET_PORT, // 28: setPort 00064 DI_GET_PORT, // 29: getPort 00065 //---------------- 00066 CNT_eDI_command 00067 }eDI_command; 00068 00069 00070 00071 //--------------------------------------- 00072 // Structures 00073 //--------------------------------------- 00074 00075 00076 00077 //--------------------------------------- 00078 // Global Variables 00079 //--------------------------------------- 00080 00081 00082 00083 //--------------------------------------- 00084 // Global Functions 00085 //--------------------------------------- 00086 void DI_init( void ); 00087 void DI_deviceID_process( void );
Generated on Sat Jul 16 2022 03:23:51 by
