The field version of the solarnano grid on the ionQubes
Fork of SolarNanoGridv3 by
SolarNanoGrid.h@2:929cf7fc6998, 2016-05-09 (annotated)
- Committer:
- defrost
- Date:
- Mon May 09 14:08:59 2016 +0000
- Revision:
- 2:929cf7fc6998
- Parent:
- 1:df924e0126d1
- Child:
- 5:57b06b4b47c6
- battery, locker, and SNG class created; - can't communicate yet;
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 | 2:929cf7fc6998 | 24 | locker* SongLock; |
defrost | 2:929cf7fc6998 | 25 | InterruptIn* button; |
defrost | 1:df924e0126d1 | 26 | |
defrost | 1:df924e0126d1 | 27 | |
defrost | 1:df924e0126d1 | 28 | char role; |
defrost | 1:df924e0126d1 | 29 | int sdVersion; |
defrost | 1:df924e0126d1 | 30 | int id; |
defrost | 1:df924e0126d1 | 31 | |
defrost | 1:df924e0126d1 | 32 | // ********************* |
defrost | 1:df924e0126d1 | 33 | // * Public functions: * |
defrost | 1:df924e0126d1 | 34 | // ********************* |
defrost | 1:df924e0126d1 | 35 | |
defrost | 1:df924e0126d1 | 36 | // Constructor: |
defrost | 2:929cf7fc6998 | 37 | SolarNanoGrid(SDFileSystem* sd, DigitalOut* led_1, DigitalOut* led_2); |
defrost | 1:df924e0126d1 | 38 | |
defrost | 1:df924e0126d1 | 39 | // Main loop function: |
defrost | 1:df924e0126d1 | 40 | void loop(void); |
defrost | 1:df924e0126d1 | 41 | |
defrost | 1:df924e0126d1 | 42 | // spi pin assignments: |
defrost | 1:df924e0126d1 | 43 | void spiNrf(void); |
defrost | 1:df924e0126d1 | 44 | void spiSD(void); |
defrost | 1:df924e0126d1 | 45 | |
defrost | 1:df924e0126d1 | 46 | |
defrost | 1:df924e0126d1 | 47 | |
defrost | 1:df924e0126d1 | 48 | |
defrost | 1:df924e0126d1 | 49 | private: |
defrost | 1:df924e0126d1 | 50 | // ********************** |
defrost | 1:df924e0126d1 | 51 | // * Private variables: * |
defrost | 1:df924e0126d1 | 52 | // ********************** |
defrost | 1:df924e0126d1 | 53 | |
defrost | 1:df924e0126d1 | 54 | // Pointer to sd filesystem: |
defrost | 1:df924e0126d1 | 55 | SDFileSystem* _sd; |
defrost | 1:df924e0126d1 | 56 | |
defrost | 1:df924e0126d1 | 57 | |
defrost | 1:df924e0126d1 | 58 | |
defrost | 1:df924e0126d1 | 59 | |
defrost | 1:df924e0126d1 | 60 | }; |
defrost | 0:dc8a45ec969a | 61 | |
defrost | 0:dc8a45ec969a | 62 | |
defrost | 0:dc8a45ec969a | 63 | #endif /* SOLARNANOGRID_H */ |