The field version of the solarnano grid on the ionQubes
Fork of SolarNanoGridv3 by
SolarNanoGrid.h@1:df924e0126d1, 2016-05-06 (annotated)
- Committer:
- defrost
- Date:
- Fri May 06 14:56:20 2016 +0000
- Revision:
- 1:df924e0126d1
- Parent:
- 0:dc8a45ec969a
- Child:
- 2:929cf7fc6998
- Started turning the battery into a class
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
defrost | 0:dc8a45ec969a | 1 | /** |
defrost | 0:dc8a45ec969a | 2 | * All the code associated to run the mbed as a battery |
defrost | 0:dc8a45ec969a | 3 | */ |
defrost | 0:dc8a45ec969a | 4 | |
defrost | 0:dc8a45ec969a | 5 | #ifndef SOLARNANOGRID_H |
defrost | 0:dc8a45ec969a | 6 | #define SOLARNANOGRID_H |
defrost | 1:df924e0126d1 | 7 | #include "mbed.h" |
defrost | 1:df924e0126d1 | 8 | #include "NRF2401P.h" |
defrost | 1:df924e0126d1 | 9 | #include "SDFileSystem.h" |
defrost | 0:dc8a45ec969a | 10 | #include "battery.h" |
defrost | 0:dc8a45ec969a | 11 | #include "locker.h" |
defrost | 0:dc8a45ec969a | 12 | |
defrost | 1:df924e0126d1 | 13 | class SolarNanoGrid |
defrost | 1:df924e0126d1 | 14 | { |
defrost | 1:df924e0126d1 | 15 | public: |
defrost | 1:df924e0126d1 | 16 | // ********************* |
defrost | 1:df924e0126d1 | 17 | // * Public variables: * |
defrost | 1:df924e0126d1 | 18 | // ********************* |
defrost | 1:df924e0126d1 | 19 | |
defrost | 1:df924e0126d1 | 20 | // Wireless module: |
defrost | 1:df924e0126d1 | 21 | NRF2401P* nrf1; |
defrost | 1:df924e0126d1 | 22 | InterruptIn* nrf1Int; // IRQ of nRF24 |
defrost | 1:df924e0126d1 | 23 | battery* SongBat; |
defrost | 1:df924e0126d1 | 24 | |
defrost | 1:df924e0126d1 | 25 | |
defrost | 1:df924e0126d1 | 26 | char role; |
defrost | 1:df924e0126d1 | 27 | int sdVersion; |
defrost | 1:df924e0126d1 | 28 | int id; |
defrost | 1:df924e0126d1 | 29 | |
defrost | 1:df924e0126d1 | 30 | // ********************* |
defrost | 1:df924e0126d1 | 31 | // * Public functions: * |
defrost | 1:df924e0126d1 | 32 | // ********************* |
defrost | 1:df924e0126d1 | 33 | |
defrost | 1:df924e0126d1 | 34 | // Constructor: |
defrost | 1:df924e0126d1 | 35 | SolarNanoGrid(SDFileSystem* sd); |
defrost | 1:df924e0126d1 | 36 | |
defrost | 1:df924e0126d1 | 37 | // Main loop function: |
defrost | 1:df924e0126d1 | 38 | void loop(void); |
defrost | 1:df924e0126d1 | 39 | |
defrost | 1:df924e0126d1 | 40 | // spi pin assignments: |
defrost | 1:df924e0126d1 | 41 | void spiNrf(void); |
defrost | 1:df924e0126d1 | 42 | void spiSD(void); |
defrost | 1:df924e0126d1 | 43 | |
defrost | 1:df924e0126d1 | 44 | |
defrost | 1:df924e0126d1 | 45 | |
defrost | 1:df924e0126d1 | 46 | |
defrost | 1:df924e0126d1 | 47 | private: |
defrost | 1:df924e0126d1 | 48 | // ********************** |
defrost | 1:df924e0126d1 | 49 | // * Private variables: * |
defrost | 1:df924e0126d1 | 50 | // ********************** |
defrost | 1:df924e0126d1 | 51 | |
defrost | 1:df924e0126d1 | 52 | // Pointer to sd filesystem: |
defrost | 1:df924e0126d1 | 53 | SDFileSystem* _sd; |
defrost | 1:df924e0126d1 | 54 | |
defrost | 1:df924e0126d1 | 55 | |
defrost | 1:df924e0126d1 | 56 | |
defrost | 1:df924e0126d1 | 57 | |
defrost | 1:df924e0126d1 | 58 | }; |
defrost | 0:dc8a45ec969a | 59 | |
defrost | 0:dc8a45ec969a | 60 | |
defrost | 0:dc8a45ec969a | 61 | #endif /* SOLARNANOGRID_H */ |