Provides an API software interface to TIMER2 to control upto four stepper motors.
Embed:
(wiki syntax)
Show/hide line numbers
SimpleStepperMbed.h
00001 /* 00002 Copyright (c) 2011 Andy Kirkham 00003 00004 Permission is hereby granted, free of charge, to any person obtaining a copy 00005 of this software and associated documentation files (the "Software"), to deal 00006 in the Software without restriction, including without limitation the rights 00007 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 00008 copies of the Software, and to permit persons to whom the Software is 00009 furnished to do so, subject to the following conditions: 00010 00011 The above copyright notice and this permission notice shall be included in 00012 all copies or substantial portions of the Software. 00013 00014 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 00015 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 00016 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 00017 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 00018 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 00019 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 00020 THE SOFTWARE. 00021 */ 00022 00023 #ifndef AJK_SIMPLESTEPPERMBED_H 00024 #define AJK_SIMPLESTEPPERMBED_H 00025 00026 #ifndef MBED_PINNAMES_H 00027 #define MBED_PINNAMES_H 00028 00029 #ifdef __cplusplus 00030 extern "C" { 00031 #endif 00032 00033 typedef enum { 00034 P0_0 = LPC_GPIO0_BASE, P0_1, P0_2, P0_3, P0_4, P0_5, P0_6, P0_7 00035 , P0_8, P0_9, P0_10, P0_11, P0_12, P0_13, P0_14, P0_15 00036 , P0_16, P0_17, P0_18, P0_19, P0_20, P0_21, P0_22, P0_23 00037 , P0_24, P0_25, P0_26, P0_27, P0_28, P0_29, P0_30, P0_31 00038 , P1_0, P1_1, P1_2, P1_3, P1_4, P1_5, P1_6, P1_7 00039 , P1_8, P1_9, P1_10, P1_11, P1_12, P1_13, P1_14, P1_15 00040 , P1_16, P1_17, P1_18, P1_19, P1_20, P1_21, P1_22, P1_23 00041 , P1_24, P1_25, P1_26, P1_27, P1_28, P1_29, P1_30, P1_31 00042 , P2_0, P2_1, P2_2, P2_3, P2_4, P2_5, P2_6, P2_7 00043 , P2_8, P2_9, P2_10, P2_11, P2_12, P2_13, P2_14, P2_15 00044 , P2_16, P2_17, P2_18, P2_19, P2_20, P2_21, P2_22, P2_23 00045 , P2_24, P2_25, P2_26, P2_27, P2_28, P2_29, P2_30, P2_31 00046 , P3_0, P3_1, P3_2, P3_3, P3_4, P3_5, P3_6, P3_7 00047 , P3_8, P3_9, P3_10, P3_11, P3_12, P3_13, P3_14, P3_15 00048 , P3_16, P3_17, P3_18, P3_19, P3_20, P3_21, P3_22, P3_23 00049 , P3_24, P3_25, P3_26, P3_27, P3_28, P3_29, P3_30, P3_31 00050 , P4_0, P4_1, P4_2, P4_3, P4_4, P4_5, P4_6, P4_7 00051 , P4_8, P4_9, P4_10, P4_11, P4_12, P4_13, P4_14, P4_15 00052 , P4_16, P4_17, P4_18, P4_19, P4_20, P4_21, P4_22, P4_23 00053 , P4_24, P4_25, P4_26, P4_27, P4_28, P4_29, P4_30, P4_31 00054 00055 // Mbed DIP Pin Names 00056 , p5 = P0_9, p6 = P0_8, p7 = P0_7, p8 = P0_6, p9 = P0_0, p10 = P0_1 00057 , p11 = P0_18, p12 = P0_17, p13 = P0_15, p14 = P0_16, p15 = P0_23 00058 , p16 = P0_24, p17 = P0_25, p18 = P0_26, p19 = P1_30, p20 = P1_31 00059 , p21 = P2_5, p22 = P2_4, p23 = P2_3, p24 = P2_2, p25 = P2_1 00060 , p26 = P2_0, p27 = P0_11, p28 = P0_10, p29 = P0_5, p30 = P0_4 00061 00062 // Other Mbed Pin Names 00063 , LED1 = P1_18, LED2 = P1_20, LED3 = P1_21, LED4 = P1_23 00064 , USBTX = P0_2, USBRX = P0_3 00065 00066 // Not connected 00067 , NC = (int)0xFFFFFFFF 00068 00069 } PinName; 00070 00071 typedef enum { 00072 PullUp = 0 00073 , Repeater = 1 00074 , PullNone = 2 00075 , PullDown = 3 00076 , OpenDrain = 4 00077 } PinMode; 00078 00079 #ifdef __cplusplus 00080 } 00081 #endif 00082 00083 #endif /* MBED_PINNAMES_H */ 00084 00085 #endif /* AJK_SIMPLESTEPPERMBED_H */
Generated on Thu Jul 14 2022 17:06:02 by 1.7.2