Proyecto de Tesis en Mecatrónica. Universidad Técnica del Norte. Ernesto Palacios <mecatronica.mid@gmail.com>

Dependencies:   EthernetNetIf HTTPServer QEI_hw RPCInterface mbed

Committer:
Yo_Robot
Date:
Thu Apr 26 04:35:21 2012 +0000
Revision:
16:d50665706f21
Parent:
15:a1ffa32ce9d1
Child:
18:cf1e07d82630
Version 1.3 Se cambio los pines de ALM, HTTP, baudios

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Yo_Robot 2:a1b556d78a7f 1
Yo_Robot 2:a1b556d78a7f 2 #ifndef SETUP_H
Yo_Robot 2:a1b556d78a7f 3 #define SETUP_H
Yo_Robot 2:a1b556d78a7f 4
Yo_Robot 2:a1b556d78a7f 5 #include "mbed.h"
Yo_Robot 2:a1b556d78a7f 6
Yo_Robot 4:552beeda4722 7
Yo_Robot 4:552beeda4722 8 /** @brief: Esta funcion configura al Timer2
Yo_Robot 4:552beeda4722 9 * para que las salidas p5 y p6 del mbed
Yo_Robot 4:552beeda4722 10 * se alternen cada vez que se iguala al
Yo_Robot 4:552beeda4722 11 * registro MR2 y MR3.
Yo_Robot 4:552beeda4722 12 */
Yo_Robot 4:552beeda4722 13 void setTimer2();
Yo_Robot 4:552beeda4722 14
Yo_Robot 4:552beeda4722 15
Yo_Robot 4:552beeda4722 16 /** @brief: Esta es la rutina que maneja las interrupciones
Yo_Robot 4:552beeda4722 17 * seriales, al recibir un caracter.
Yo_Robot 4:552beeda4722 18 */
Yo_Robot 2:a1b556d78a7f 19 void ISR_Serial();
Yo_Robot 2:a1b556d78a7f 20
Yo_Robot 4:552beeda4722 21
Yo_Robot 12:c02b08dacc45 22 /** @brief: Esta es la rutina que cambia la frecuencia
Yo_Robot 12:c02b08dacc45 23 * de salida del Micro en Serial
Yo_Robot 4:552beeda4722 24 */
Yo_Robot 12:c02b08dacc45 25 void setPTO( int freq );
Yo_Robot 4:552beeda4722 26
Yo_Robot 4:552beeda4722 27
Yo_Robot 12:c02b08dacc45 28 /** @brief: Esta es la rutina que cambia la frecuencia
Yo_Robot 12:c02b08dacc45 29 * de salida del Micro en comunicacion Ethernet
Yo_Robot 4:552beeda4722 30 */
Yo_Robot 12:c02b08dacc45 31 void setPTO_eth ( char * input, char * output );
Yo_Robot 4:552beeda4722 32
Yo_Robot 4:552beeda4722 33
Yo_Robot 12:c02b08dacc45 34 /** @brief: Esta es la rutina que maneja la interrupcion
Yo_Robot 12:c02b08dacc45 35 * de alarma
Yo_Robot 4:552beeda4722 36 */
Yo_Robot 12:c02b08dacc45 37 void ISR_Alarm();
Yo_Robot 2:a1b556d78a7f 38
Yo_Robot 4:552beeda4722 39
Yo_Robot 4:552beeda4722 40 /** @brief: Esta Funcion calcula el valor necesario
Yo_Robot 4:552beeda4722 41 * en el MatchRegister para obtener una frecuencia
Yo_Robot 4:552beeda4722 42 * de salida.
Yo_Robot 4:552beeda4722 43 * @param fout Frecuencia de salida deseada
Yo_Robot 4:552beeda4722 44 * @return El valor que debe tener el MatchRegister
Yo_Robot 4:552beeda4722 45 */
Yo_Robot 4:552beeda4722 46 int getMRvalue( int fout );
Yo_Robot 4:552beeda4722 47
Yo_Robot 4:552beeda4722 48
Yo_Robot 12:c02b08dacc45 49 /** @brief: Esta Funcion cambia el valor del Registro 2
Yo_Robot 12:c02b08dacc45 50 */
Yo_Robot 12:c02b08dacc45 51 void setMR2( int newValue );
Yo_Robot 12:c02b08dacc45 52
Yo_Robot 12:c02b08dacc45 53
Yo_Robot 12:c02b08dacc45 54 /** @brief: Esta Funcion arranca el timer
Yo_Robot 12:c02b08dacc45 55 */
Yo_Robot 12:c02b08dacc45 56 void startTimer2();
Yo_Robot 12:c02b08dacc45 57
Yo_Robot 12:c02b08dacc45 58
Yo_Robot 12:c02b08dacc45 59 /** @brief: Esta Funcion detiene el timer
Yo_Robot 12:c02b08dacc45 60 */
Yo_Robot 12:c02b08dacc45 61 void stopTimer2();
Yo_Robot 12:c02b08dacc45 62
Yo_Robot 12:c02b08dacc45 63
Yo_Robot 12:c02b08dacc45 64 /** @brief: Esta Funcion cambia el voltaje de salida el
Yo_Robot 12:c02b08dacc45 65 * valor ingresado debe ser en porcentaje.
Yo_Robot 12:c02b08dacc45 66 * Desde -100% hasta +100% dependiendo de la velocidad
Yo_Robot 12:c02b08dacc45 67 * y el sentido de giro
Yo_Robot 12:c02b08dacc45 68 */
Yo_Robot 12:c02b08dacc45 69 void setAout_eth( char * input, char * output );
Yo_Robot 12:c02b08dacc45 70
Yo_Robot 12:c02b08dacc45 71
Yo_Robot 12:c02b08dacc45 72 /** @brief: Cambiar Direccion @ PTO
Yo_Robot 12:c02b08dacc45 73 */
Yo_Robot 12:c02b08dacc45 74 void setDir_eth ( char * input, char * output );
Yo_Robot 12:c02b08dacc45 75
Yo_Robot 12:c02b08dacc45 76
Yo_Robot 12:c02b08dacc45 77 /** @brief: Cambiar Direccion @ PTO
Yo_Robot 12:c02b08dacc45 78 */
Yo_Robot 12:c02b08dacc45 79 void setSON_eth ( char * input, char * output );
Yo_Robot 12:c02b08dacc45 80
Yo_Robot 12:c02b08dacc45 81
Yo_Robot 15:a1ffa32ce9d1 82 /** @brief: Cambiar Direccion @ PTO
Yo_Robot 15:a1ffa32ce9d1 83 */
Yo_Robot 15:a1ffa32ce9d1 84 void setANG_eth( char * input, char * output );
Yo_Robot 15:a1ffa32ce9d1 85
Yo_Robot 15:a1ffa32ce9d1 86
Yo_Robot 15:a1ffa32ce9d1 87 /** @brief: Cambiar Direccion @ PTO
Yo_Robot 15:a1ffa32ce9d1 88 */
Yo_Robot 16:d50665706f21 89 void setSPD_eth( char * input, char * output );
Yo_Robot 15:a1ffa32ce9d1 90
Yo_Robot 15:a1ffa32ce9d1 91
Yo_Robot 15:a1ffa32ce9d1 92 /** @brief: Cambiar Direccion @ PTO
Yo_Robot 15:a1ffa32ce9d1 93 */
Yo_Robot 16:d50665706f21 94 void getENC_eth( char * input, char * output );
Yo_Robot 12:c02b08dacc45 95
Yo_Robot 12:c02b08dacc45 96
Yo_Robot 4:552beeda4722 97 // Legacy
Yo_Robot 4:552beeda4722 98 void setMR3( int newValue );
Yo_Robot 4:552beeda4722 99 void setPrescaler( int newValue );
Yo_Robot 4:552beeda4722 100
Yo_Robot 4:552beeda4722 101
Yo_Robot 2:a1b556d78a7f 102 #endif