X-Git-Url: http://www.average.org/gitweb/?p=pulsecounter.git;a=blobdiff_plain;f=Hal%2FHal.h;h=9af8ec811cc1745daca6aedcb13f449177cc4935;hp=245608cc98c2c19df3b9ea851e31c17de6f4c633;hb=4868ec0934cb78bf2349296ec33401cf9ce4a953;hpb=9cc8270392d249d6db03caefd81281886901c4bd diff --git a/Hal/Hal.h b/Hal/Hal.h index 245608c..9af8ec8 100644 --- a/Hal/Hal.h +++ b/Hal/Hal.h @@ -4,7 +4,6 @@ * This example HAL is intentionally simple. The implementation is limited to: * * BUTTON -- a single button that when pressed will cause an interrupt. - * CONNECTED_LED -- an LED that is controlled inside the HAL to indicate connection to a central. * DEBUG -- two debug GPIOs that are available as outputs from the EAP and under user control. * DELAY -- a delay routine that can delay by n milliseconds. * INIT -- set the hardware up to its initial state @@ -27,9 +26,7 @@ extern "C" { #endif -extern int32_t buttonCnt; - -typedef void (*Hal_Handler)(void); +typedef void (*Hal_Handler)(uint8_t id); /** * --------- Hal_buttonEnable --------- @@ -50,13 +47,12 @@ typedef void (*Hal_Handler)(void); * BUTTON interrupt enabled * **/ -extern void Hal_buttonEnable(Hal_Handler handler); +extern void Hal_buttonEnable(void (*handler)(void)); /** * --------- Hal_connected --------- * * Called whenever the MCM peripheral connects to a central. * - * Turns on the CONNECTED_LED to show connectivity to the central * Could do other things associated with connection to the central. * * Inputs: @@ -65,9 +61,6 @@ extern void Hal_buttonEnable(Hal_Handler handler); * Returns: * None * - * Side Effects: - * CONNECTED_LED on. - * **/ extern void Hal_connected(void); /** @@ -151,7 +144,6 @@ extern void Hal_delay(uint16_t msecs); * * Called whenever the MCM peripheral disconnects from a central. * - * Turns off the CONNECTED_LED to show lack of connectivity to the central * Could do other things associated with connection to the central. * * Inputs: @@ -160,9 +152,6 @@ extern void Hal_delay(uint16_t msecs); * Returns: * None * - * Side Effects: - * CONNECTED_LED off. - * **/ extern void Hal_disconnected(void); /** @@ -228,7 +217,8 @@ extern void Hal_init(void); * User LED off. * **/ -extern void Hal_ledOff(void); +extern void Hal_greenLedOff(void); +extern void Hal_redLedOff(void); /** * --------- Hal_ledOn --------- * @@ -244,7 +234,8 @@ extern void Hal_ledOff(void); * User LED on. * **/ -extern void Hal_ledOn(void); +extern void Hal_greenLedOn(void); +extern void Hal_redLedOn(void); /** * --------- Hal_ledRead --------- * @@ -260,7 +251,8 @@ extern void Hal_ledOn(void); * None * **/ -extern bool Hal_ledRead(void); +extern bool Hal_greenLedRead(void); +extern bool Hal_redLedRead(void); /** * --------- Hal_ledToggle --------- * @@ -276,7 +268,8 @@ extern bool Hal_ledRead(void); * User LED toggles state. * **/ -extern void Hal_ledToggle(void); +extern void Hal_greenLedToggle(void); +extern void Hal_redLedToggle(void); /** * --------- Hal_tickStart --------- * @@ -299,6 +292,7 @@ extern void Hal_ledToggle(void); * **/ extern void Hal_tickStart(uint16_t msecs, Hal_Handler Handler); +extern void Hal_tickStop(void); #ifdef __cplusplus }