Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
33 changed files
with
537 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* Bootloader */ | ||
mbed-os/features/FEATURE_BOOTLOADER/* | ||
|
||
/* BLE */ | ||
mbed-os/connectivity/drivers/ble/* | ||
mbed-os/connectivity/FEATURE_BLE/* | ||
|
||
/* Cellular */ | ||
mbed-os/connectivity/cellular/* | ||
mbed-os/connectivity/drivers/cellular/* | ||
mbed-os/connectivity/netsocket/source/Cellular*.* | ||
|
||
/* Device Key */ | ||
mbed-os/drivers/device_key/* | ||
|
||
/* Experimental */ | ||
mbed-os/platform/FEATURE_EXPERIMENTAL_API/* | ||
|
||
/* FPGA */ | ||
mbed-os/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/* | ||
|
||
/* Greentea client */ | ||
mbed-os/features/frameworks/greentea-client/* | ||
|
||
/* LORAWAN */ | ||
mbed-os/connectivity/drivers/lora/* | ||
mbed-os/connectivity/lorawan/* | ||
|
||
/* LWIP */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/lwipstack/* | ||
|
||
/* Mbed-client-cli */ | ||
mbed-os/features/frameworks/mbed-client-cli/* | ||
|
||
/* MBED TLS */ | ||
mbed-os/connectivity/drivers/mbedtls/* | ||
mbed-os/connectivity/mbedtls/* | ||
|
||
/* Nanostack */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/libraries/mbed-coap/* | ||
mbed-os/connectivity/libraries/nanostack-libservice/* | ||
mbed-os/connectivity/libraries/ppp/* | ||
mbed-os/connectivity/nanostack/* | ||
|
||
/* Netsocket */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/netsocket/* | ||
mbed-os/connectivity/libraries/mbed-coap/* | ||
mbed-os/connectivity/libraries/ppp/* | ||
|
||
/* NFC */ | ||
mbed-os/connectivity/drivers/nfc/* | ||
mbed-os/connectivity/nfc/* | ||
|
||
/* RF */ | ||
/*mbed-os/connectivity/drivers/802.15.4_RF/* */ | ||
|
||
/* Storage */ | ||
mbed-os/storage/filesystem/* | ||
mbed-os/storage/kvstore/* | ||
mbed-os/storage/platform/* | ||
|
||
/* Tests */ | ||
mbed-os/platform/tests/* | ||
mbed-os/TEST_APPS/* | ||
mbed-os/TESTS/* | ||
mbed-os/UNITTESTS/* | ||
|
||
/* Unity */ | ||
mbed-os/features/frameworks/unity/* | ||
|
||
/* Utest */ | ||
mbed-os/features/frameworks/utest/* | ||
|
||
/* USB */ | ||
mbed-os/drivers/usb/source/* | ||
mbed-os/hal/usb/source/* | ||
mbed-os/hal/usb/TARGET_Templates/* | ||
|
||
/* WiFi */ | ||
mbed-os/connectivity/drivers/wifi/* |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/* cpp file to go with the header. | ||
In here we define all the program logic, | ||
matching the function signatures in the header file. | ||
NOTE: We just include functionality here. | ||
Class variables etc come from the header file. | ||
*/ | ||
|
||
#include "flasher.h" | ||
#include "mbed.h" | ||
|
||
|
||
// Define our constructor | ||
Flasher::Flasher(PinName thePin, int startState) : theLed(thePin){ | ||
state = startState; | ||
} | ||
|
||
// Define Flash Functionality. | ||
void Flasher::flash(){ | ||
if (state == 0){ | ||
theLed = 1; | ||
thread_sleep_for(1000); | ||
theLed = 0; | ||
thread_sleep_for(1000); | ||
} | ||
else { | ||
theLed = 1; | ||
thread_sleep_for(5000); | ||
theLed = 0; | ||
thread_sleep_for(5000); | ||
} | ||
} | ||
|
||
void Flasher::set_state(int the_state){ | ||
state = the_state; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/* | ||
This is the headerfile for our class. | ||
It contains details of the class and all its methods. | ||
This includes definitions, and the function signatures. | ||
It is used by the compiler to link code from class files, into our main program. | ||
*/ | ||
|
||
// Avoid the compiler including code every time it is imported | ||
#ifndef FLASHER_H | ||
#define FLASHER_H | ||
|
||
// We Will need mbed for definitions of DigitalOut etc. | ||
#include <mbed.h> | ||
|
||
// Here we define the class structure, and variables | ||
class Flasher{ | ||
// Variables | ||
private: | ||
DigitalOut theLed; | ||
int state; | ||
|
||
|
||
/* | ||
We then define the method sigantures here. | ||
NOTE: We just define the signatures, the code code in the corrisponding .c file | ||
*/ | ||
public: | ||
// Constructor. NOTE: We dont include the definition list here | ||
Flasher(PinName thePin, int startState); | ||
|
||
// Public Methods | ||
void flash(); //Our standard Flash | ||
void set_state(int the_state); //Setter method for the state | ||
}; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include <mbed.h> | ||
#include <flasher.h> | ||
|
||
|
||
// Global Flasher Object | ||
Flasher theFlasher(LED2, 0); | ||
|
||
// Variable to hold button State, this needs to be globally avaialable | ||
int buttonState; | ||
|
||
// Hander Function for our Buton Press | ||
void handler(){ | ||
buttonState = !buttonState; | ||
theFlasher.set_state(buttonState); | ||
} | ||
|
||
int main() { | ||
|
||
// put your setup code here, to run once: | ||
|
||
//Setup the User Buton as an Input | ||
InterruptIn theButton(BUTTON1); | ||
|
||
//Bind the interupt to a function | ||
theButton.rise(&handler); | ||
|
||
|
||
|
||
|
||
while(1) { | ||
// put your main code here, to run repeatedly: | ||
|
||
//Print the State of our button | ||
printf("Button State is %d\n", buttonState); | ||
|
||
theFlasher.flash(); | ||
|
||
|
||
} | ||
} |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
/* Bootloader */ | ||
mbed-os/features/FEATURE_BOOTLOADER/* | ||
|
||
/* BLE */ | ||
mbed-os/connectivity/drivers/ble/* | ||
mbed-os/connectivity/FEATURE_BLE/* | ||
|
||
/* Cellular */ | ||
mbed-os/connectivity/cellular/* | ||
mbed-os/connectivity/drivers/cellular/* | ||
mbed-os/connectivity/netsocket/source/Cellular*.* | ||
|
||
/* Device Key */ | ||
mbed-os/drivers/device_key/* | ||
|
||
/* Experimental */ | ||
mbed-os/platform/FEATURE_EXPERIMENTAL_API/* | ||
|
||
/* FPGA */ | ||
mbed-os/features/frameworks/COMPONENT_FPGA_CI_TEST_SHIELD/* | ||
|
||
/* Greentea client */ | ||
mbed-os/features/frameworks/greentea-client/* | ||
|
||
/* LORAWAN */ | ||
mbed-os/connectivity/drivers/lora/* | ||
mbed-os/connectivity/lorawan/* | ||
|
||
/* LWIP */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/lwipstack/* | ||
|
||
/* Mbed-client-cli */ | ||
mbed-os/features/frameworks/mbed-client-cli/* | ||
|
||
/* MBED TLS */ | ||
mbed-os/connectivity/drivers/mbedtls/* | ||
mbed-os/connectivity/mbedtls/* | ||
|
||
/* Nanostack */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/libraries/mbed-coap/* | ||
mbed-os/connectivity/libraries/nanostack-libservice/* | ||
mbed-os/connectivity/libraries/ppp/* | ||
mbed-os/connectivity/nanostack/* | ||
|
||
/* Netsocket */ | ||
mbed-os/connectivity/drivers/emac/* | ||
mbed-os/connectivity/netsocket/* | ||
mbed-os/connectivity/libraries/mbed-coap/* | ||
mbed-os/connectivity/libraries/ppp/* | ||
|
||
/* NFC */ | ||
mbed-os/connectivity/drivers/nfc/* | ||
mbed-os/connectivity/nfc/* | ||
|
||
/* RF */ | ||
/*mbed-os/connectivity/drivers/802.15.4_RF/* */ | ||
|
||
/* Storage */ | ||
mbed-os/storage/filesystem/* | ||
mbed-os/storage/kvstore/* | ||
mbed-os/storage/platform/* | ||
|
||
/* Tests */ | ||
mbed-os/platform/tests/* | ||
mbed-os/TEST_APPS/* | ||
mbed-os/TESTS/* | ||
mbed-os/UNITTESTS/* | ||
|
||
/* Unity */ | ||
mbed-os/features/frameworks/unity/* | ||
|
||
/* Utest */ | ||
mbed-os/features/frameworks/utest/* | ||
|
||
/* USB */ | ||
mbed-os/drivers/usb/source/* | ||
mbed-os/hal/usb/source/* | ||
mbed-os/hal/usb/TARGET_Templates/* | ||
|
||
/* WiFi */ | ||
mbed-os/connectivity/drivers/wifi/* |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.