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@11:30408c8f722a, 2012-04-06 (annotated)
- Committer:
- Yo_Robot
- Date:
- Fri Apr 06 02:15:47 2012 +0000
- Revision:
- 11:30408c8f722a
- Parent:
- 7:d9aca501126f
v0.3 Serial No RPC. Se igualan los archivos setup.h y setup.cpp para serial y ethernet
Who changed what in which revision?
User | Revision | Line number | New 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 | 11:30408c8f722a | 16 | /** @brief: Esta es la rutina que maneja las interrupciones |
Yo_Robot | 11:30408c8f722a | 17 | * seriales, al recibir un caracter. |
Yo_Robot | 11:30408c8f722a | 18 | */ |
Yo_Robot | 11:30408c8f722a | 19 | void ISR_Serial(); |
Yo_Robot | 11:30408c8f722a | 20 | |
Yo_Robot | 11:30408c8f722a | 21 | |
Yo_Robot | 7:d9aca501126f | 22 | /** @brief: Esta es la rutina que cambia la frecuencia |
Yo_Robot | 11:30408c8f722a | 23 | * de salida del Micro en Serial |
Yo_Robot | 6:b4dae934e1ea | 24 | */ |
Yo_Robot | 7:d9aca501126f | 25 | void setPTO( int freq ); |
Yo_Robot | 6:b4dae934e1ea | 26 | |
Yo_Robot | 6:b4dae934e1ea | 27 | |
Yo_Robot | 11:30408c8f722a | 28 | /** @brief: Esta es la rutina que cambia la frecuencia |
Yo_Robot | 11:30408c8f722a | 29 | * de salida del Micro en comunicacion Ethernet |
Yo_Robot | 11:30408c8f722a | 30 | */ |
Yo_Robot | 11:30408c8f722a | 31 | void setPTO_eth ( char * input, char * output ); |
Yo_Robot | 11:30408c8f722a | 32 | |
Yo_Robot | 6:b4dae934e1ea | 33 | |
Yo_Robot | 6:b4dae934e1ea | 34 | /** @brief: Esta es la rutina que maneja la interrupcion |
Yo_Robot | 6:b4dae934e1ea | 35 | * de alarma |
Yo_Robot | 6:b4dae934e1ea | 36 | */ |
Yo_Robot | 6:b4dae934e1ea | 37 | void ISR_Alarm(); |
Yo_Robot | 6:b4dae934e1ea | 38 | |
Yo_Robot | 6:b4dae934e1ea | 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 | 11:30408c8f722a | 49 | /** @brief: Esta Funcion cambia el valor del Registro 2 |
Yo_Robot | 11:30408c8f722a | 50 | */ |
Yo_Robot | 11:30408c8f722a | 51 | void setMR2( int newValue ); |
Yo_Robot | 11:30408c8f722a | 52 | |
Yo_Robot | 11:30408c8f722a | 53 | |
Yo_Robot | 11:30408c8f722a | 54 | /** @brief: Esta Funcion arranca el timer |
Yo_Robot | 11:30408c8f722a | 55 | */ |
Yo_Robot | 11:30408c8f722a | 56 | void startTimer2(); |
Yo_Robot | 11:30408c8f722a | 57 | |
Yo_Robot | 11:30408c8f722a | 58 | |
Yo_Robot | 11:30408c8f722a | 59 | /** @brief: Esta Funcion detiene el timer |
Yo_Robot | 11:30408c8f722a | 60 | */ |
Yo_Robot | 11:30408c8f722a | 61 | void stopTimer2(); |
Yo_Robot | 11:30408c8f722a | 62 | |
Yo_Robot | 11:30408c8f722a | 63 | |
Yo_Robot | 11:30408c8f722a | 64 | /** @brief: Esta Funcion cambia el voltaje de salida el |
Yo_Robot | 11:30408c8f722a | 65 | * valor ingresado debe ser en porcentaje. |
Yo_Robot | 11:30408c8f722a | 66 | * Desde -100% hasta +100% dependiendo de la velocidad |
Yo_Robot | 11:30408c8f722a | 67 | * y el sentido de giro |
Yo_Robot | 11:30408c8f722a | 68 | */ |
Yo_Robot | 11:30408c8f722a | 69 | void setAout_eth( char * input, char * output ); |
Yo_Robot | 11:30408c8f722a | 70 | |
Yo_Robot | 11:30408c8f722a | 71 | |
Yo_Robot | 11:30408c8f722a | 72 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 11:30408c8f722a | 73 | */ |
Yo_Robot | 11:30408c8f722a | 74 | void setDir_eth ( char * input, char * output ); |
Yo_Robot | 11:30408c8f722a | 75 | |
Yo_Robot | 11:30408c8f722a | 76 | |
Yo_Robot | 11:30408c8f722a | 77 | /** @brief: Cambiar Direccion @ PTO |
Yo_Robot | 11:30408c8f722a | 78 | */ |
Yo_Robot | 11:30408c8f722a | 79 | void setSON_eth ( char * input, char * output ); |
Yo_Robot | 11:30408c8f722a | 80 | |
Yo_Robot | 11:30408c8f722a | 81 | |
Yo_Robot | 11:30408c8f722a | 82 | |
Yo_Robot | 11:30408c8f722a | 83 | |
Yo_Robot | 4:552beeda4722 | 84 | // Legacy |
Yo_Robot | 4:552beeda4722 | 85 | void setMR3( int newValue ); |
Yo_Robot | 4:552beeda4722 | 86 | void setPrescaler( int newValue ); |
Yo_Robot | 4:552beeda4722 | 87 | |
Yo_Robot | 4:552beeda4722 | 88 | |
Yo_Robot | 2:a1b556d78a7f | 89 | #endif |