Alexandre Lemay
/
APP1_s5_A17
PARTYYYY
Afficheur.h@11:09317efe9bb5, 2017-09-06 (annotated)
- Committer:
- ThierryLeonard
- Date:
- Wed Sep 06 03:46:20 2017 +0000
- Revision:
- 11:09317efe9bb5
- Parent:
- 10:2836530d9a5e
Beautify LOL still ugly
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ThierryLeonard | 7:b1b4db3eedb4 | 1 | #ifndef AFFICHEUR_H |
ThierryLeonard | 7:b1b4db3eedb4 | 2 | #define AFFICHEUR_H |
ThierryLeonard | 7:b1b4db3eedb4 | 3 | |
ThierryLeonard | 7:b1b4db3eedb4 | 4 | |
ThierryLeonard | 2:3576839565ae | 5 | #include "mbed.h" |
ThierryLeonard | 2:3576839565ae | 6 | |
ThierryLeonard | 10:2836530d9a5e | 7 | |
ThierryLeonard | 10:2836530d9a5e | 8 | // Commenter cette ligner pour utiliser le UART pour communiquer avec l'afficheur 7 segments. Sinon, le SPI est utilisé. |
ThierryLeonard | 9:b9ac1d914762 | 9 | //#define USESPI |
ThierryLeonard | 9:b9ac1d914762 | 10 | |
ThierryLeonard | 9:b9ac1d914762 | 11 | #ifndef USESPI |
ThierryLeonard | 7:b1b4db3eedb4 | 12 | #include "CommUART.h" |
ThierryLeonard | 9:b9ac1d914762 | 13 | #endif |
ThierryLeonard | 9:b9ac1d914762 | 14 | |
ThierryLeonard | 2:3576839565ae | 15 | |
ThierryLeonard | 2:3576839565ae | 16 | class Afficheur |
ThierryLeonard | 2:3576839565ae | 17 | { |
ThierryLeonard | 9:b9ac1d914762 | 18 | #ifdef USESPI |
ThierryLeonard | 9:b9ac1d914762 | 19 | typedef SPI CommInterface; |
ThierryLeonard | 9:b9ac1d914762 | 20 | #else |
ThierryLeonard | 7:b1b4db3eedb4 | 21 | typedef CommUART3 CommInterface; |
ThierryLeonard | 9:b9ac1d914762 | 22 | #endif |
ThierryLeonard | 2:3576839565ae | 23 | public: |
ThierryLeonard | 2:3576839565ae | 24 | Afficheur(); |
ThierryLeonard | 2:3576839565ae | 25 | |
ThierryLeonard | 9:b9ac1d914762 | 26 | void write(char* characters,int length ,int commaFlags); |
ThierryLeonard | 2:3576839565ae | 27 | void write(char ch); |
ThierryLeonard | 2:3576839565ae | 28 | void resetDisplay(); |
ThierryLeonard | 9:b9ac1d914762 | 29 | void showDot(int commaFlags); |
ThierryLeonard | 2:3576839565ae | 30 | void hideDot(); |
ThierryLeonard | 2:3576839565ae | 31 | |
ThierryLeonard | 2:3576839565ae | 32 | private: |
ThierryLeonard | 7:b1b4db3eedb4 | 33 | CommInterface afficheur; |
ThierryLeonard | 2:3576839565ae | 34 | DigitalOut chipSelect; |
ThierryLeonard | 7:b1b4db3eedb4 | 35 | }; |
ThierryLeonard | 7:b1b4db3eedb4 | 36 | |
ThierryLeonard | 7:b1b4db3eedb4 | 37 | #endif |