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: WakeUp PinDetect
Dependents: Inductive_Sensor Inductive_Sensor_Jasper Inductive_Sensor_3
Bob.h
- Committer:
- bobgiesberts
- Date:
- 2016-09-07
- Revision:
- 7:0b23995256e7
- Parent:
- 6:0e7c0ad0508b
- Child:
- 9:3fe744aca1c0
File content as of revision 7:0b23995256e7:
#ifndef _Bob_H_
#define _Bob_H_
/**
* @file Bob.h
* @brief collection of some functions to communicate
* with the processor board. LEDs, SD, etc.
*
* @author Bob Giesberts
*
* @date 2015-12-18
*/
#include "mbed.h"
#include "PinDetect.h"
class Bob {
public:
/** Construct a new instance of the class Bob
* @param process_led Pin connected to the green led, used for processing
* @param error_led Pin connected to the red led, used for errors
* @param button Pin connected to the I/O button
* @param enable Pin connected to the SD card system and the crystal
* @param sd_present Pin connected to the SDCardDetect port
* @param battery Pin connected to the battery
*/
Bob(PinName process_led, PinName error_led, PinName button, PinName enable, PinName sd_present, PinName battery);
~Bob();
bool checkSD(void);
void wakeup_periphery(void);
/** shutdown_periphery
* Powers down the SD card system, the crystal and the LDC1614
*/
void shutdown_periphery(void);
void sleep(uint32_t ms);
float battery(void);
void flash(int n);
void processing(void);
void no_processing(void);
void error(void);
void no_error(void);
private:
DigitalOut _led_process; // green led
DigitalOut _led_error; // red led
PinDetect _button; // button
DigitalOut _enable; // pin to power all periphery (SD, crystal, LDC1614)
DigitalIn *_sd_card_detect;
AnalogIn *_batt;
};
#endif