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@29:95469b25e187, 2016-04-20 (annotated)
- Committer:
- clementdoreau
- Date:
- Wed Apr 20 15:09:43 2016 +0000
- Revision:
- 29:95469b25e187
- Parent:
- 28:e932eb039271
- Child:
- 32:029962133529
Mise a jour de l'envoi du nombre de matrices
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| Willheisen | 9:6f3d8b714a59 | 1 | /* |
| Willheisen | 9:6f3d8b714a59 | 2 | * cSPI.h |
| Willheisen | 9:6f3d8b714a59 | 3 | * |
| Willheisen | 9:6f3d8b714a59 | 4 | * Created on: 5 avr. 2016 |
| Willheisen | 9:6f3d8b714a59 | 5 | * Author: clement |
| Willheisen | 9:6f3d8b714a59 | 6 | */ |
| Willheisen | 9:6f3d8b714a59 | 7 | |
| Willheisen | 9:6f3d8b714a59 | 8 | #ifndef CSPI_H_ |
| Willheisen | 9:6f3d8b714a59 | 9 | #define CSPI_H_ |
| Willheisen | 9:6f3d8b714a59 | 10 | |
| Willheisen | 9:6f3d8b714a59 | 11 | #include "mbed.h" |
| Willheisen | 9:6f3d8b714a59 | 12 | #include "cMatrice.h" |
| Willheisen | 9:6f3d8b714a59 | 13 | |
| Willheisen | 9:6f3d8b714a59 | 14 | class cSPI { |
| Willheisen | 9:6f3d8b714a59 | 15 | private: |
| Willheisen | 9:6f3d8b714a59 | 16 | unsigned int _freq; |
| clementdoreau | 29:95469b25e187 | 17 | unsigned int _mode; |
| clementdoreau | 29:95469b25e187 | 18 | unsigned int _bits; |
| clementdoreau | 29:95469b25e187 | 19 | unsigned int _nbMatrices; |
| Willheisen | 9:6f3d8b714a59 | 20 | public: |
| Willheisen | 9:6f3d8b714a59 | 21 | // CONSTRUCTEURS |
| Willheisen | 9:6f3d8b714a59 | 22 | cSPI(); |
| clementdoreau | 29:95469b25e187 | 23 | cSPI(unsigned int f, unsigned int m, unsigned int b); |
| Willheisen | 9:6f3d8b714a59 | 24 | // DESTRUCTEUR |
| Willheisen | 9:6f3d8b714a59 | 25 | ~cSPI(); |
| Willheisen | 9:6f3d8b714a59 | 26 | // GETTERS |
| Willheisen | 9:6f3d8b714a59 | 27 | unsigned int getFrequence(); |
| Willheisen | 9:6f3d8b714a59 | 28 | unsigned int getMode(); |
| clementdoreau | 29:95469b25e187 | 29 | unsigned int getBits(); |
| clementdoreau | 29:95469b25e187 | 30 | unsigned int getNbMatrices(); |
| Willheisen | 9:6f3d8b714a59 | 31 | // SETTERS |
| Willheisen | 9:6f3d8b714a59 | 32 | void setFrequence(unsigned int freq); |
| Willheisen | 9:6f3d8b714a59 | 33 | void setMode(unsigned int mode); |
| clementdoreau | 29:95469b25e187 | 34 | void setBits(unsigned int bits); |
| clementdoreau | 29:95469b25e187 | 35 | void setNbMatrices(unsigned int nb); |
| Willheisen | 9:6f3d8b714a59 | 36 | // METHODES |
| Willheisen | 9:6f3d8b714a59 | 37 | void initSPI(unsigned int frequence, unsigned int bits, unsigned int mode); |
| Willheisen | 9:6f3d8b714a59 | 38 | int envoyerMatrice(cMatrice &); // Renvoi la reponse SPI |
| clementdoreau | 29:95469b25e187 | 39 | void configurerNbMatrices(const int nb); |
| Willheisen | 9:6f3d8b714a59 | 40 | |
| Willheisen | 9:6f3d8b714a59 | 41 | }; |
| Willheisen | 9:6f3d8b714a59 | 42 | |
| Willheisen | 9:6f3d8b714a59 | 43 | #endif /* CSPI_H_ */ |