Javier Marcelo
/
STM32F103C8_Minimos
Programa de Minimos.
main.cpp@3:7d496863c448, 2019-09-13 (annotated)
- Committer:
- ArturoRiosRamos
- Date:
- Fri Sep 13 19:38:07 2019 +0000
- Revision:
- 3:7d496863c448
- Parent:
- 1:b5216422f915
- Child:
- 4:e8498d695fc2
Portada
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Antulius | 0:f680c41c1640 | 1 | /* ########################################################################### |
Antulius | 0:f680c41c1640 | 2 | ** Archivo : main.c |
ArturoRiosRamos | 3:7d496863c448 | 3 | ** Proyecto : STM32-103C8_Portada |
Antulius | 0:f680c41c1640 | 4 | ** Procesador : STM32F103C8 |
Antulius | 0:f680c41c1640 | 5 | ** Herramienta : Mbed |
Antulius | 0:f680c41c1640 | 6 | ** Version : Driver 01.01 |
Antulius | 0:f680c41c1640 | 7 | ** Compilador : GNU C Compiler |
Antulius | 0:f680c41c1640 | 8 | ** Fecha/Hora : 14-07-2015, 11:48, # CodeGen: 0 |
Antulius | 0:f680c41c1640 | 9 | ** Descripción : |
Antulius | 0:f680c41c1640 | 10 | ** Este proyecto muestra la configuración y uso de la Terminal Serial |
Antulius | 0:f680c41c1640 | 11 | ** This module contains user's application code. |
Antulius | 0:f680c41c1640 | 12 | ** Componentes : Timer, etc . |
Antulius | 0:f680c41c1640 | 13 | ** Configuraciones : Se puede seleccionar entre diferentes velocodades de |
Antulius | 0:f680c41c1640 | 14 | ** transmisión |
Antulius | 0:f680c41c1640 | 15 | ** Autores : |
Antulius | 0:f680c41c1640 | 16 | ** ATEAM Development Group: |
Antulius | 0:f680c41c1640 | 17 | ** - Antulio Morgado Valle |
ArturoRiosRamos | 3:7d496863c448 | 18 | Rios Ramos Arturo |
Antulius | 0:f680c41c1640 | 19 | ** |
Antulius | 0:f680c41c1640 | 20 | ** Versión : Beta |
Antulius | 0:f680c41c1640 | 21 | ** Revisión : A |
Antulius | 0:f680c41c1640 | 22 | ** Release : 0 |
Antulius | 0:f680c41c1640 | 23 | ** Bugs & Fixes : |
ArturoRiosRamos | 3:7d496863c448 | 24 | ** Date : 13/09/2019 |
ArturoRiosRamos | 3:7d496863c448 | 25 | ** Portada datos generales |
ArturoRiosRamos | 3:7d496863c448 | 26 | ** |
Antulius | 0:f680c41c1640 | 27 | ** |
Antulius | 0:f680c41c1640 | 28 | ** |
Antulius | 0:f680c41c1640 | 29 | ** ###########################################################################*/ |
Antulius | 0:f680c41c1640 | 30 | /* |
Antulius | 0:f680c41c1640 | 31 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
Antulius | 0:f680c41c1640 | 32 | : Includes |
Antulius | 0:f680c41c1640 | 33 | :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
Antulius | 0:f680c41c1640 | 34 | */ |
Antulius | 0:f680c41c1640 | 35 | |
Antulius | 0:f680c41c1640 | 36 | #include "stm32f103c8t6.h" |
Antulius | 0:f680c41c1640 | 37 | #include "mbed.h" |
Antulius | 0:f680c41c1640 | 38 | #include "Serial.h" |
Antulius | 0:f680c41c1640 | 39 | #include "stdio.h" |
Antulius | 0:f680c41c1640 | 40 | /* |
Antulius | 0:f680c41c1640 | 41 | :............................................................................... |
Antulius | 0:f680c41c1640 | 42 | : Definiciones |
Antulius | 0:f680c41c1640 | 43 | :............................................................................... |
Antulius | 0:f680c41c1640 | 44 | */ |
Antulius | 0:f680c41c1640 | 45 | #define on 0 // Estado para boton presionado |
Antulius | 0:f680c41c1640 | 46 | #define off 1 // Estado para boton sin presionar |
Antulius | 0:f680c41c1640 | 47 | #define hold 2 // Estado para boton mantenido |
Antulius | 0:f680c41c1640 | 48 | #define release 3 // Estado para boton liberado |
Antulius | 0:f680c41c1640 | 49 | #define FALSE 0 // Estado FALSO |
Antulius | 0:f680c41c1640 | 50 | #define TRUE 1 // Estado VERDADERO |
Antulius | 0:f680c41c1640 | 51 | /* |
Antulius | 0:f680c41c1640 | 52 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 53 | | Configuración de Puertos |
Antulius | 0:f680c41c1640 | 54 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 55 | */ |
Antulius | 0:f680c41c1640 | 56 | DigitalOut verde (LED1); // PC_13 (Green_Led) |
Antulius | 0:f680c41c1640 | 57 | DigitalOut rojo (PB_1); // NC (Red_Led) |
Antulius | 0:f680c41c1640 | 58 | |
Antulius | 0:f680c41c1640 | 59 | // ***** Host PC Terminal Communication channels |
Antulius | 0:f680c41c1640 | 60 | Serial terminal (PA_2, PA_3); // Inicializa la comunicación serial a la PC (Tx,Rx) |
Antulius | 0:f680c41c1640 | 61 | //Serial terminal(USBTX, USBRX,115200);// Tx, Rx Baud Rate - Terminal Serial por USB @ 115,200 Bauds |
Antulius | 0:f680c41c1640 | 62 | |
Antulius | 0:f680c41c1640 | 63 | /* |
Antulius | 0:f680c41c1640 | 64 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 65 | | Variables Globales de Usuario |
ArturoRiosRamos | 1:b5216422f915 | 66 | |
Antulius | 0:f680c41c1640 | 67 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 68 | */ |
ArturoRiosRamos | 1:b5216422f915 | 69 | int intentos=0; |
ArturoRiosRamos | 1:b5216422f915 | 70 | int respuesta; |
ArturoRiosRamos | 1:b5216422f915 | 71 | int secreto; |
Antulius | 0:f680c41c1640 | 72 | //uint32_t Baud_Rate = 9600; // Velocidad de Transmisión (Bauds) |
Antulius | 0:f680c41c1640 | 73 | /* |
Antulius | 0:f680c41c1640 | 74 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Antulius | 0:f680c41c1640 | 75 | | Definición de Funciones Prototipo y Rutinas de los Vectores de Interrupción |
Antulius | 0:f680c41c1640 | 76 | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
Antulius | 0:f680c41c1640 | 77 | */ |
ArturoRiosRamos | 3:7d496863c448 | 78 | void Portada(); |
Antulius | 0:f680c41c1640 | 79 | void Setup(void); |
Antulius | 0:f680c41c1640 | 80 | /* END definitions */ |
Antulius | 0:f680c41c1640 | 81 | |
Antulius | 0:f680c41c1640 | 82 | /* |
Antulius | 0:f680c41c1640 | 83 | #=============================================================================== |
Antulius | 0:f680c41c1640 | 84 | | |
Antulius | 0:f680c41c1640 | 85 | | P R O G R A M A P R I N C I P A L |
Antulius | 0:f680c41c1640 | 86 | | |
Antulius | 0:f680c41c1640 | 87 | #=============================================================================== |
Antulius | 0:f680c41c1640 | 88 | */ |
Antulius | 0:f680c41c1640 | 89 | int main() |
Antulius | 0:f680c41c1640 | 90 | { // Inicialización de variables, puertos e interrupciones |
Antulius | 0:f680c41c1640 | 91 | confSysClock(); // Configure system clock (72MHz HSE clock, 48MHz USB clock) |
Antulius | 0:f680c41c1640 | 92 | Setup(); // Inicialización del sistema |
Antulius | 0:f680c41c1640 | 93 | |
ArturoRiosRamos | 3:7d496863c448 | 94 | Portada(); |
ArturoRiosRamos | 3:7d496863c448 | 95 | |
ArturoRiosRamos | 3:7d496863c448 | 96 | |
Antulius | 0:f680c41c1640 | 97 | } |
Antulius | 0:f680c41c1640 | 98 | |
ArturoRiosRamos | 3:7d496863c448 | 99 | void Portada() |
ArturoRiosRamos | 3:7d496863c448 | 100 | { |
ArturoRiosRamos | 3:7d496863c448 | 101 | terminal.printf("\tESCUELA SUPERIOR DE INGENIERIA MECANICA Y ELECTRICA\n"); |
ArturoRiosRamos | 3:7d496863c448 | 102 | terminal.printf("\t Ingenieria en comunicaciones y electronica\n\n"); |
ArturoRiosRamos | 3:7d496863c448 | 103 | terminal.printf("\t\t\tAnalisis numerico\n\n"); |
ArturoRiosRamos | 3:7d496863c448 | 104 | terminal.printf("\t\t\tPrograma N. \n\n"); |
ArturoRiosRamos | 3:7d496863c448 | 105 | terminal.printf("\tArturo Rios Ramos \t\t\t4CV2\n\n"); |
ArturoRiosRamos | 3:7d496863c448 | 106 | } |
Antulius | 0:f680c41c1640 | 107 | /* END main */ |
Antulius | 0:f680c41c1640 | 108 | |
Antulius | 0:f680c41c1640 | 109 | /* |
Antulius | 0:f680c41c1640 | 110 | ................................................................................ |
Antulius | 0:f680c41c1640 | 111 | : Rutinas de los Vectores de Interrupción |
Antulius | 0:f680c41c1640 | 112 | ................................................................................ |
Antulius | 0:f680c41c1640 | 113 | */ |
Antulius | 0:f680c41c1640 | 114 | |
Antulius | 0:f680c41c1640 | 115 | /* END Events */ |
Antulius | 0:f680c41c1640 | 116 | /* |
Antulius | 0:f680c41c1640 | 117 | ________________________________________________________________________________ |
Antulius | 0:f680c41c1640 | 118 | | |
Antulius | 0:f680c41c1640 | 119 | | Funciones Prototipo |
Antulius | 0:f680c41c1640 | 120 | |_______________________________________________________________________________ |
Antulius | 0:f680c41c1640 | 121 | */ |
Antulius | 0:f680c41c1640 | 122 | // Las Funciones Prototipo van aquí ! |
Antulius | 0:f680c41c1640 | 123 | void Setup() |
Antulius | 0:f680c41c1640 | 124 | { |
Antulius | 0:f680c41c1640 | 125 | // terminal.baud(Baud_Rate); // Se configura la velocidad de transmisión e inicia la comunicación serial. |
Antulius | 0:f680c41c1640 | 126 | terminal.baud(115200); // Se configura la velocidad de transmisión e inicia la comunicación serial. |
Antulius | 0:f680c41c1640 | 127 | terminal.printf(" System is Wake Up!.\n\r"); |
Antulius | 0:f680c41c1640 | 128 | } |
Antulius | 0:f680c41c1640 | 129 | |
Antulius | 0:f680c41c1640 | 130 | /* END routines */ |
Antulius | 0:f680c41c1640 | 131 | |
Antulius | 0:f680c41c1640 | 132 | /* END program */ |
Antulius | 0:f680c41c1640 | 133 | |
Antulius | 0:f680c41c1640 | 134 | /* END documentation */ |
Antulius | 0:f680c41c1640 | 135 | /* |
ArturoRiosRamos | 3:7d496863c448 | 136 | |
Antulius | 0:f680c41c1640 | 137 | +-------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 138 | | |
Antulius | 0:f680c41c1640 | 139 | | T H E A N T U L I U S T E A M |
Antulius | 0:f680c41c1640 | 140 | | Research, Development, Systems Equipment, Support & Spare Parts I n c. |
Antulius | 0:f680c41c1640 | 141 | | (C) Copyright 1989-2014, All rigths Reserved |
Antulius | 0:f680c41c1640 | 142 | | |
Antulius | 0:f680c41c1640 | 143 | | This program is licensed under rules of |
Antulius | 0:f680c41c1640 | 144 | | THE BEANERS TECHNOLOGIES PROYECT |
Antulius | 0:f680c41c1640 | 145 | +------------------------------------------------------------------------------- |
Antulius | 0:f680c41c1640 | 146 | */ |
Antulius | 0:f680c41c1640 | 147 | /* END Mbed */ |