Bob Giesberts / Bob

Dependencies:   WakeUp PinDetect

Dependents:   Inductive_Sensor Inductive_Sensor_Jasper Inductive_Sensor_3

Committer:
bobgiesberts
Date:
Wed Sep 07 09:58:19 2016 +0000
Revision:
7:0b23995256e7
Parent:
6:0e7c0ad0508b
Child:
9:3fe744aca1c0
No big changes

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bobgiesberts 0:17943815800f 1 #ifndef _Bob_H_
bobgiesberts 0:17943815800f 2 #define _Bob_H_
bobgiesberts 0:17943815800f 3
bobgiesberts 0:17943815800f 4 /**
bobgiesberts 0:17943815800f 5 * @file Bob.h
bobgiesberts 0:17943815800f 6 * @brief collection of some functions to communicate
bobgiesberts 0:17943815800f 7 * with the processor board. LEDs, SD, etc.
bobgiesberts 0:17943815800f 8 *
bobgiesberts 0:17943815800f 9 * @author Bob Giesberts
bobgiesberts 0:17943815800f 10 *
bobgiesberts 0:17943815800f 11 * @date 2015-12-18
bobgiesberts 0:17943815800f 12 */
bobgiesberts 0:17943815800f 13
bobgiesberts 0:17943815800f 14 #include "mbed.h"
bobgiesberts 6:0e7c0ad0508b 15 #include "PinDetect.h"
bobgiesberts 0:17943815800f 16
bobgiesberts 0:17943815800f 17 class Bob {
bobgiesberts 0:17943815800f 18 public:
bobgiesberts 0:17943815800f 19
bobgiesberts 6:0e7c0ad0508b 20 /** Construct a new instance of the class Bob
bobgiesberts 6:0e7c0ad0508b 21 * @param process_led Pin connected to the green led, used for processing
bobgiesberts 6:0e7c0ad0508b 22 * @param error_led Pin connected to the red led, used for errors
bobgiesberts 6:0e7c0ad0508b 23 * @param button Pin connected to the I/O button
bobgiesberts 7:0b23995256e7 24 * @param enable Pin connected to the SD card system and the crystal
bobgiesberts 6:0e7c0ad0508b 25 * @param sd_present Pin connected to the SDCardDetect port
bobgiesberts 6:0e7c0ad0508b 26 * @param battery Pin connected to the battery
bobgiesberts 6:0e7c0ad0508b 27 */
bobgiesberts 7:0b23995256e7 28 Bob(PinName process_led, PinName error_led, PinName button, PinName enable, PinName sd_present, PinName battery);
bobgiesberts 6:0e7c0ad0508b 29 ~Bob();
bobgiesberts 6:0e7c0ad0508b 30
bobgiesberts 0:17943815800f 31 bool checkSD(void);
bobgiesberts 4:9c3c8eb56a2b 32
bobgiesberts 7:0b23995256e7 33 void wakeup_periphery(void);
bobgiesberts 7:0b23995256e7 34
bobgiesberts 7:0b23995256e7 35 /** shutdown_periphery
bobgiesberts 7:0b23995256e7 36 * Powers down the SD card system, the crystal and the LDC1614
bobgiesberts 7:0b23995256e7 37 */
bobgiesberts 7:0b23995256e7 38 void shutdown_periphery(void);
bobgiesberts 4:9c3c8eb56a2b 39 void sleep(uint32_t ms);
bobgiesberts 6:0e7c0ad0508b 40
bobgiesberts 4:9c3c8eb56a2b 41
bobgiesberts 2:681ecede6dcb 42 float battery(void);
bobgiesberts 5:c2468a69aacb 43
bobgiesberts 0:17943815800f 44 void flash(int n);
bobgiesberts 7:0b23995256e7 45 void processing(void);
bobgiesberts 7:0b23995256e7 46 void no_processing(void);
bobgiesberts 7:0b23995256e7 47 void error(void);
bobgiesberts 7:0b23995256e7 48 void no_error(void);
bobgiesberts 0:17943815800f 49
bobgiesberts 0:17943815800f 50 private:
bobgiesberts 7:0b23995256e7 51 DigitalOut _led_process; // green led
bobgiesberts 7:0b23995256e7 52 DigitalOut _led_error; // red led
bobgiesberts 7:0b23995256e7 53 PinDetect _button; // button
bobgiesberts 7:0b23995256e7 54 DigitalOut _enable; // pin to power all periphery (SD, crystal, LDC1614)
bobgiesberts 7:0b23995256e7 55
bobgiesberts 2:681ecede6dcb 56 DigitalIn *_sd_card_detect;
bobgiesberts 5:c2468a69aacb 57
bobgiesberts 2:681ecede6dcb 58 AnalogIn *_batt;
bobgiesberts 5:c2468a69aacb 59
bobgiesberts 0:17943815800f 60 };
bobgiesberts 0:17943815800f 61
bobgiesberts 0:17943815800f 62 #endif