![](/media/cache/profiles/e32084632d369461572832e6582aac36.50x50_q85.jpg)
Proyecto de Tesis en Mecatrónica. Universidad Técnica del Norte. Ernesto Palacios <mecatronica.mid@gmail.com>
Dependencies: EthernetNetIf HTTPServer QEI_hw RPCInterface mbed
setup.h@20:4b154134ab20, 2012-06-06 (annotated)
- Committer:
- Yo_Robot
- Date:
- Wed Jun 06 03:08:27 2012 +0000
- Revision:
- 20:4b154134ab20
- Parent:
- 18:cf1e07d82630
- Child:
- 21:353b0fe8fc54
Version 1.9 - Limpiar el cdigo - Se configura la alta velocidad a travez de archivo de configuracion - ; ; Falta I2C Encoder y Alarmas.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Yo_Robot | 20:4b154134ab20 | 1 | /** |
Yo_Robot | 20:4b154134ab20 | 2 | * @file setup.h |
Yo_Robot | 20:4b154134ab20 | 3 | * @author Ernesto Palacios |
Yo_Robot | 20:4b154134ab20 | 4 | * @brief decalracion de funciones |
Yo_Robot | 20:4b154134ab20 | 5 | * |
Yo_Robot | 20:4b154134ab20 | 6 | * Created on 25 de Marzo de 2012 |
Yo_Robot | 20:4b154134ab20 | 7 | * |
Yo_Robot | 20:4b154134ab20 | 8 | * Licencia GPL v3.0 |
Yo_Robot | 20:4b154134ab20 | 9 | * http://www.gnu.org/licenses/gpl-3.0.html |
Yo_Robot | 20:4b154134ab20 | 10 | */ |
Yo_Robot | 20:4b154134ab20 | 11 | |
Yo_Robot | 2:a1b556d78a7f | 12 | |
Yo_Robot | 2:a1b556d78a7f | 13 | #ifndef SETUP_H |
Yo_Robot | 2:a1b556d78a7f | 14 | #define SETUP_H |
Yo_Robot | 2:a1b556d78a7f | 15 | |
Yo_Robot | 2:a1b556d78a7f | 16 | #include "mbed.h" |
Yo_Robot | 18:cf1e07d82630 | 17 | #include "EthernetNetIf.h" |
Yo_Robot | 18:cf1e07d82630 | 18 | |
Yo_Robot | 4:552beeda4722 | 19 | /** @brief: Esta funcion configura al Timer2 |
Yo_Robot | 4:552beeda4722 | 20 | * para que las salidas p5 y p6 del mbed |
Yo_Robot | 4:552beeda4722 | 21 | * se alternen cada vez que se iguala al |
Yo_Robot | 4:552beeda4722 | 22 | * registro MR2 y MR3. |
Yo_Robot | 4:552beeda4722 | 23 | */ |
Yo_Robot | 4:552beeda4722 | 24 | void setTimer2(); |
Yo_Robot | 4:552beeda4722 | 25 | |
Yo_Robot | 4:552beeda4722 | 26 | |
Yo_Robot | 20:4b154134ab20 | 27 | /** @brief: Esta es la rutina para obtener la onfiguracion |
Yo_Robot | 20:4b154134ab20 | 28 | * de la velocidad serial para el puerto MAX_232 |
Yo_Robot | 20:4b154134ab20 | 29 | */ |
Yo_Robot | 20:4b154134ab20 | 30 | int configurarBaudios() |
Yo_Robot | 20:4b154134ab20 | 31 | |
Yo_Robot | 20:4b154134ab20 | 32 | |
Yo_Robot | 4:552beeda4722 | 33 | /** @brief: Esta es la rutina que maneja las interrupciones |
Yo_Robot | 4:552beeda4722 | 34 | * seriales, al recibir un caracter. |
Yo_Robot | 4:552beeda4722 | 35 | */ |
Yo_Robot | 2:a1b556d78a7f | 36 | void ISR_Serial(); |
Yo_Robot | 2:a1b556d78a7f | 37 | |
Yo_Robot | 4:552beeda4722 | 38 | |
Yo_Robot | 12:c02b08dacc45 | 39 | /** @brief: Esta es la rutina que cambia la frecuencia |
Yo_Robot | 12:c02b08dacc45 | 40 | * de salida del Micro en Serial |
Yo_Robot | 4:552beeda4722 | 41 | */ |
Yo_Robot | 12:c02b08dacc45 | 42 | void setPTO( int freq ); |
Yo_Robot | 4:552beeda4722 | 43 | |
Yo_Robot | 4:552beeda4722 | 44 | |
Yo_Robot | 12:c02b08dacc45 | 45 | /** @brief: Esta es la rutina que cambia la frecuencia |
Yo_Robot | 12:c02b08dacc45 | 46 | * de salida del Micro en comunicacion Ethernet |
Yo_Robot | 4:552beeda4722 | 47 | */ |
Yo_Robot | 12:c02b08dacc45 | 48 | void setPTO_eth ( char * input, char * output ); |
Yo_Robot | 4:552beeda4722 | 49 | |
Yo_Robot | 4:552beeda4722 | 50 | |
Yo_Robot | 12:c02b08dacc45 | 51 | /** @brief: Esta es la rutina que maneja la interrupcion |
Yo_Robot | 12:c02b08dacc45 | 52 | * de alarma |
Yo_Robot | 4:552beeda4722 | 53 | */ |
Yo_Robot | 12:c02b08dacc45 | 54 | void ISR_Alarm(); |
Yo_Robot | 2:a1b556d78a7f | 55 | |
Yo_Robot | 4:552beeda4722 | 56 | |
Yo_Robot | 4:552beeda4722 | 57 | /** @brief: Esta Funcion calcula el valor necesario |
Yo_Robot | 4:552beeda4722 | 58 | * en el MatchRegister para obtener una frecuencia |
Yo_Robot | 4:552beeda4722 | 59 | * de salida. |
Yo_Robot | 4:552beeda4722 | 60 | * @param fout Frecuencia de salida deseada |
Yo_Robot | 4:552beeda4722 | 61 | * @return El valor que debe tener el MatchRegister |
Yo_Robot | 4:552beeda4722 | 62 | */ |
Yo_Robot | 4:552beeda4722 | 63 | int getMRvalue( int fout ); |
Yo_Robot | 4:552beeda4722 | 64 | |
Yo_Robot | 4:552beeda4722 | 65 | |
Yo_Robot | 12:c02b08dacc45 | 66 | /** @brief: Esta Funcion cambia el valor del Registro 2 |
Yo_Robot | 12:c02b08dacc45 | 67 | */ |
Yo_Robot | 12:c02b08dacc45 | 68 | void setMR2( int newValue ); |
Yo_Robot | 12:c02b08dacc45 | 69 | |
Yo_Robot | 12:c02b08dacc45 | 70 | |
Yo_Robot | 12:c02b08dacc45 | 71 | /** @brief: Esta Funcion arranca el timer |
Yo_Robot | 12:c02b08dacc45 | 72 | */ |
Yo_Robot | 12:c02b08dacc45 | 73 | void startTimer2(); |
Yo_Robot | 12:c02b08dacc45 | 74 | |
Yo_Robot | 12:c02b08dacc45 | 75 | |
Yo_Robot | 12:c02b08dacc45 | 76 | /** @brief: Esta Funcion detiene el timer |
Yo_Robot | 12:c02b08dacc45 | 77 | */ |
Yo_Robot | 12:c02b08dacc45 | 78 | void stopTimer2(); |
Yo_Robot | 12:c02b08dacc45 | 79 | |
Yo_Robot | 12:c02b08dacc45 | 80 | |
Yo_Robot | 12:c02b08dacc45 | 81 | /** @brief: Esta Funcion cambia el voltaje de salida el |
Yo_Robot | 12:c02b08dacc45 | 82 | * valor ingresado debe ser en porcentaje. |
Yo_Robot | 12:c02b08dacc45 | 83 | * Desde -100% hasta +100% dependiendo de la velocidad |
Yo_Robot | 12:c02b08dacc45 | 84 | * y el sentido de giro |
Yo_Robot | 12:c02b08dacc45 | 85 | */ |
Yo_Robot | 12:c02b08dacc45 | 86 | void setAout_eth( char * input, char * output ); |
Yo_Robot | 12:c02b08dacc45 | 87 | |
Yo_Robot | 12:c02b08dacc45 | 88 | |
Yo_Robot | 12:c02b08dacc45 | 89 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 12:c02b08dacc45 | 90 | */ |
Yo_Robot | 12:c02b08dacc45 | 91 | void setDir_eth ( char * input, char * output ); |
Yo_Robot | 12:c02b08dacc45 | 92 | |
Yo_Robot | 12:c02b08dacc45 | 93 | |
Yo_Robot | 12:c02b08dacc45 | 94 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 12:c02b08dacc45 | 95 | */ |
Yo_Robot | 12:c02b08dacc45 | 96 | void setSON_eth ( char * input, char * output ); |
Yo_Robot | 12:c02b08dacc45 | 97 | |
Yo_Robot | 12:c02b08dacc45 | 98 | |
Yo_Robot | 15:a1ffa32ce9d1 | 99 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 15:a1ffa32ce9d1 | 100 | */ |
Yo_Robot | 15:a1ffa32ce9d1 | 101 | void setANG_eth( char * input, char * output ); |
Yo_Robot | 15:a1ffa32ce9d1 | 102 | |
Yo_Robot | 15:a1ffa32ce9d1 | 103 | |
Yo_Robot | 15:a1ffa32ce9d1 | 104 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 15:a1ffa32ce9d1 | 105 | */ |
Yo_Robot | 16:d50665706f21 | 106 | void setSPD_eth( char * input, char * output ); |
Yo_Robot | 15:a1ffa32ce9d1 | 107 | |
Yo_Robot | 15:a1ffa32ce9d1 | 108 | |
Yo_Robot | 15:a1ffa32ce9d1 | 109 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 15:a1ffa32ce9d1 | 110 | */ |
Yo_Robot | 16:d50665706f21 | 111 | void getENC_eth( char * input, char * output ); |
Yo_Robot | 12:c02b08dacc45 | 112 | |
Yo_Robot | 12:c02b08dacc45 | 113 | |
Yo_Robot | 4:552beeda4722 | 114 | // Legacy |
Yo_Robot | 4:552beeda4722 | 115 | void setMR3( int newValue ); |
Yo_Robot | 4:552beeda4722 | 116 | void setPrescaler( int newValue ); |
Yo_Robot | 20:4b154134ab20 | 117 | EthernetNetIf configurarEthernet(); |
Yo_Robot | 4:552beeda4722 | 118 | |
Yo_Robot | 4:552beeda4722 | 119 | |
Yo_Robot | 2:a1b556d78a7f | 120 | #endif |