lib_Mbed_LPS
lib_Mbed_LPS.h@1:4d90513f226d, 2015-10-23 (annotated)
- Committer:
- YSI
- Date:
- Fri Oct 23 08:28:11 2015 +0000
- Revision:
- 1:4d90513f226d
- Parent:
- 0:a217c0617441
- Child:
- 3:660de8a5eff2
up doc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
YSI | 0:a217c0617441 | 1 | /** Lib Mbed LPS |
YSI | 0:a217c0617441 | 2 | * |
YSI | 0:a217c0617441 | 3 | * Copyright (c) 2014, cstyles (http://mbed.org) |
YSI | 0:a217c0617441 | 4 | * |
YSI | 0:a217c0617441 | 5 | * Exemple: |
YSI | 0:a217c0617441 | 6 | * @code |
YSI | 0:a217c0617441 | 7 | * #include "mbed.h" |
YSI | 0:a217c0617441 | 8 | * #include "lib_Mbed_LPS.h" |
YSI | 0:a217c0617441 | 9 | * |
YSI | 0:a217c0617441 | 10 | * |
YSI | 0:a217c0617441 | 11 | * Serial pc(USBTX,USBRX); |
YSI | 0:a217c0617441 | 12 | * |
YSI | 0:a217c0617441 | 13 | * void interruption_serie(void); |
YSI | 0:a217c0617441 | 14 | * |
YSI | 0:a217c0617441 | 15 | * |
YSI | 0:a217c0617441 | 16 | * int main() |
YSI | 0:a217c0617441 | 17 | * { |
YSI | 0:a217c0617441 | 18 | * if(checkIDs()) return 0; |
YSI | 0:a217c0617441 | 19 | * pc.attach(&interruption_serie); |
YSI | 0:a217c0617441 | 20 | * |
YSI | 0:a217c0617441 | 21 | * while(1) |
YSI | 0:a217c0617441 | 22 | * { |
YSI | 0:a217c0617441 | 23 | * wait(0.25); |
YSI | 0:a217c0617441 | 24 | * } |
YSI | 0:a217c0617441 | 25 | * } |
YSI | 0:a217c0617441 | 26 | * |
YSI | 0:a217c0617441 | 27 | * void interruption_serie(void) |
YSI | 0:a217c0617441 | 28 | * { |
YSI | 0:a217c0617441 | 29 | * char caractere = pc.getc(); |
YSI | 0:a217c0617441 | 30 | * switch(caractere) |
YSI | 0:a217c0617441 | 31 | * { |
YSI | 0:a217c0617441 | 32 | * case '?': |
YSI | 0:a217c0617441 | 33 | * pc.printf("%s\r\n",getLastMbedFileName()); |
YSI | 0:a217c0617441 | 34 | * break; |
YSI | 0:a217c0617441 | 35 | * } |
YSI | 0:a217c0617441 | 36 | * } |
YSI | 0:a217c0617441 | 37 | * @endcode |
YSI | 0:a217c0617441 | 38 | * @file lib_Mbed_LPS.h |
YSI | 0:a217c0617441 | 39 | * @purpose library for Mbed LPS |
YSI | 0:a217c0617441 | 40 | * @date 2015 |
YSI | 0:a217c0617441 | 41 | * @author Yannic Simon |
YSI | 0:a217c0617441 | 42 | */ |
YSI | 0:a217c0617441 | 43 | |
YSI | 0:a217c0617441 | 44 | #ifndef DEF_lib_Mbed_LPS_H |
YSI | 0:a217c0617441 | 45 | #define DEF_lib_Mbed_LPS_H |
YSI | 0:a217c0617441 | 46 | |
YSI | 0:a217c0617441 | 47 | #include "mbed.h" |
YSI | 0:a217c0617441 | 48 | |
YSI | 1:4d90513f226d | 49 | /** Renvoie l'ID unique du Mbed |
YSI | 1:4d90513f226d | 50 | * |
YSI | 1:4d90513f226d | 51 | * @param ID pointeur sur une chaine de caractere contenant l'ID unique du Mbed |
YSI | 1:4d90513f226d | 52 | */ |
YSI | 0:a217c0617441 | 53 | void getMbedID(char *ID); |
YSI | 0:a217c0617441 | 54 | |
YSI | 1:4d90513f226d | 55 | /** Renvoie true si l'ID unique du Mbed correspond à celui attendu |
YSI | 1:4d90513f226d | 56 | * |
YSI | 1:4d90513f226d | 57 | */ |
YSI | 0:a217c0617441 | 58 | bool checkIDs(void); |
YSI | 0:a217c0617441 | 59 | |
YSI | 1:4d90513f226d | 60 | /** Renvoie une chaine de caractere contenant le nom du dernier fichier cree sur le Mbed |
YSI | 1:4d90513f226d | 61 | * |
YSI | 1:4d90513f226d | 62 | */ |
YSI | 0:a217c0617441 | 63 | char * getLastMbedFileName(void); |
YSI | 0:a217c0617441 | 64 | |
YSI | 0:a217c0617441 | 65 | #endif |