Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed APDS_9960 mbed-rtos
include/cSPI.h@36:f58a566595ad, 2016-04-24 (annotated)
- Committer:
- Willheisen
- Date:
- Sun Apr 24 15:47:15 2016 +0000
- Revision:
- 36:f58a566595ad
- Parent:
- 35:7aef0bbdf335
- Child:
- 38:418278e5eb6b
a
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Willheisen | 9:6f3d8b714a59 | 1 | #ifndef CSPI_H_ |
| Willheisen | 9:6f3d8b714a59 | 2 | #define CSPI_H_ |
| Willheisen | 9:6f3d8b714a59 | 3 | |
| Willheisen | 9:6f3d8b714a59 | 4 | #include "mbed.h" |
| Willheisen | 9:6f3d8b714a59 | 5 | #include "cMatrice.h" |
| Willheisen | 9:6f3d8b714a59 | 6 | |
| Willheisen | 36:f58a566595ad | 7 | // Définition de la classe cSPI |
| Willheisen | 36:f58a566595ad | 8 | // Classe de gestion de la liaison SPI (initialisation et envoi de la matrice). |
| Willheisen | 36:f58a566595ad | 9 | |
| Willheisen | 9:6f3d8b714a59 | 10 | class cSPI { |
| Willheisen | 9:6f3d8b714a59 | 11 | private: |
| Willheisen | 9:6f3d8b714a59 | 12 | unsigned int _freq; |
| Willheisen | 9:6f3d8b714a59 | 13 | unsigned char _mode; |
| Willheisen | 9:6f3d8b714a59 | 14 | unsigned char _bits; |
| Willheisen | 9:6f3d8b714a59 | 15 | |
| Willheisen | 9:6f3d8b714a59 | 16 | public: |
| Willheisen | 9:6f3d8b714a59 | 17 | // CONSTRUCTEURS |
| Willheisen | 9:6f3d8b714a59 | 18 | cSPI(); |
| Willheisen | 9:6f3d8b714a59 | 19 | // DESTRUCTEUR |
| Willheisen | 9:6f3d8b714a59 | 20 | ~cSPI(); |
| Willheisen | 9:6f3d8b714a59 | 21 | // GETTERS |
| Willheisen | 9:6f3d8b714a59 | 22 | unsigned int getFrequence(); |
| Willheisen | 9:6f3d8b714a59 | 23 | unsigned int getMode(); |
| Willheisen | 9:6f3d8b714a59 | 24 | unsigned char getBits(); |
| Willheisen | 9:6f3d8b714a59 | 25 | |
| Willheisen | 9:6f3d8b714a59 | 26 | // SETTERS |
| Willheisen | 9:6f3d8b714a59 | 27 | void setFrequence(unsigned int freq); |
| Willheisen | 9:6f3d8b714a59 | 28 | void setMode(unsigned int mode); |
| Willheisen | 9:6f3d8b714a59 | 29 | void setBits(unsigned char bits); |
| Willheisen | 9:6f3d8b714a59 | 30 | // METHODES |
| clementdoreau | 35:7aef0bbdf335 | 31 | void initSPI(unsigned int frequence); |
| Willheisen | 9:6f3d8b714a59 | 32 | int envoyerMatrice(cMatrice &); // Renvoi la reponse SPI |
| clementdoreau | 35:7aef0bbdf335 | 33 | void setNbMatrice(unsigned int nb); |
| Willheisen | 9:6f3d8b714a59 | 34 | }; |
| Willheisen | 9:6f3d8b714a59 | 35 | |
| Willheisen | 9:6f3d8b714a59 | 36 | #endif /* CSPI_H_ */ |