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@6:b4dae934e1ea, 2012-04-01 (annotated)
- Committer:
- Yo_Robot
- Date:
- Sun Apr 01 20:03:42 2012 +0000
- Revision:
- 6:b4dae934e1ea
- Parent:
- 4:552beeda4722
- Child:
- 7:d9aca501126f
v0.1 Serial No RPC. sistema base para la comunicacion con la libreria ASM
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 | 6:b4dae934e1ea | 16 | /*@brief: Esta Funcion enciende el pin conectado a la |
Yo_Robot | 6:b4dae934e1ea | 17 | * salida ServoOn. |
Yo_Robot | 6:b4dae934e1ea | 18 | */ |
Yo_Robot | 6:b4dae934e1ea | 19 | void setSON( int onOff); |
Yo_Robot | 6:b4dae934e1ea | 20 | |
Yo_Robot | 6:b4dae934e1ea | 21 | |
Yo_Robot | 6:b4dae934e1ea | 22 | /*@brief: Esta Funcion enciende el pin conectado a la |
Yo_Robot | 6:b4dae934e1ea | 23 | * salida de dirección del Servo SIGN+. |
Yo_Robot | 6:b4dae934e1ea | 24 | */ |
Yo_Robot | 6:b4dae934e1ea | 25 | void setDir( int dir ); |
Yo_Robot | 6:b4dae934e1ea | 26 | |
Yo_Robot | 6:b4dae934e1ea | 27 | |
Yo_Robot | 6:b4dae934e1ea | 28 | /*@brief: Esta Funcion cambia el valor de la salida |
Yo_Robot | 6:b4dae934e1ea | 29 | * analógica del mbed |
Yo_Robot | 6:b4dae934e1ea | 30 | */ |
Yo_Robot | 6:b4dae934e1ea | 31 | void setAout( float value ); |
Yo_Robot | 6:b4dae934e1ea | 32 | |
Yo_Robot | 6:b4dae934e1ea | 33 | |
Yo_Robot | 6:b4dae934e1ea | 34 | |
Yo_Robot | 6:b4dae934e1ea | 35 | /** @brief: Esta es la rutina que maneja la interrupcion |
Yo_Robot | 6:b4dae934e1ea | 36 | * de alarma |
Yo_Robot | 6:b4dae934e1ea | 37 | */ |
Yo_Robot | 6:b4dae934e1ea | 38 | void ISR_Alarm(); |
Yo_Robot | 6:b4dae934e1ea | 39 | |
Yo_Robot | 6:b4dae934e1ea | 40 | |
Yo_Robot | 6:b4dae934e1ea | 41 | |
Yo_Robot | 4:552beeda4722 | 42 | /** @brief: Esta es la rutina que maneja las interrupciones |
Yo_Robot | 4:552beeda4722 | 43 | * seriales, al recibir un caracter. |
Yo_Robot | 4:552beeda4722 | 44 | */ |
Yo_Robot | 2:a1b556d78a7f | 45 | void ISR_Serial(); |
Yo_Robot | 2:a1b556d78a7f | 46 | |
Yo_Robot | 4:552beeda4722 | 47 | |
Yo_Robot | 4:552beeda4722 | 48 | /** @brief: Esta Funcion cambia el valor del Registro 2 |
Yo_Robot | 4:552beeda4722 | 49 | */ |
Yo_Robot | 3:8d5a9e3cd680 | 50 | void setMR2( int newValue ); |
Yo_Robot | 4:552beeda4722 | 51 | |
Yo_Robot | 4:552beeda4722 | 52 | |
Yo_Robot | 4:552beeda4722 | 53 | /** @brief: Esta Funcion detiene el timer |
Yo_Robot | 4:552beeda4722 | 54 | */ |
Yo_Robot | 3:8d5a9e3cd680 | 55 | void stopTimer2(); |
Yo_Robot | 4:552beeda4722 | 56 | |
Yo_Robot | 4:552beeda4722 | 57 | |
Yo_Robot | 4:552beeda4722 | 58 | /** @brief: Esta Funcion arranca el timer |
Yo_Robot | 4:552beeda4722 | 59 | */ |
Yo_Robot | 3:8d5a9e3cd680 | 60 | void startTimer2(); |
Yo_Robot | 2:a1b556d78a7f | 61 | |
Yo_Robot | 4:552beeda4722 | 62 | |
Yo_Robot | 4:552beeda4722 | 63 | /** @brief: Esta Funcion calcula el valor necesario |
Yo_Robot | 4:552beeda4722 | 64 | * en el MatchRegister para obtener una frecuencia |
Yo_Robot | 4:552beeda4722 | 65 | * de salida. |
Yo_Robot | 4:552beeda4722 | 66 | * @param fout Frecuencia de salida deseada |
Yo_Robot | 4:552beeda4722 | 67 | * @return El valor que debe tener el MatchRegister |
Yo_Robot | 4:552beeda4722 | 68 | */ |
Yo_Robot | 4:552beeda4722 | 69 | int getMRvalue( int fout ); |
Yo_Robot | 4:552beeda4722 | 70 | |
Yo_Robot | 4:552beeda4722 | 71 | |
Yo_Robot | 4:552beeda4722 | 72 | // Legacy |
Yo_Robot | 4:552beeda4722 | 73 | void setMR3( int newValue ); |
Yo_Robot | 4:552beeda4722 | 74 | void setPrescaler( int newValue ); |
Yo_Robot | 4:552beeda4722 | 75 | |
Yo_Robot | 4:552beeda4722 | 76 | |
Yo_Robot | 2:a1b556d78a7f | 77 | #endif |