* 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
extern "C" {
#endif
-typedef void (*Hal_Handler)(void);
+typedef void (*Hal_Handler)(uint8_t id);
/**
* --------- Hal_buttonEnable ---------
* 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:
* Returns:
* None
*
- * Side Effects:
- * CONNECTED_LED on.
- *
**/
extern void Hal_connected(void);
/**
*
* 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:
* Returns:
* None
*
- * Side Effects:
- * CONNECTED_LED off.
- *
**/
extern void Hal_disconnected(void);
/**
* User LED off.
*
**/
-extern void Hal_ledOff(void);
+extern void Hal_greenLedOff(void);
+extern void Hal_redLedOff(void);
/**
* --------- Hal_ledOn ---------
*
* User LED on.
*
**/
-extern void Hal_ledOn(void);
+extern void Hal_greenLedOn(void);
+extern void Hal_redLedOn(void);
/**
* --------- Hal_ledRead ---------
*
* None
*
**/
-extern bool Hal_ledRead(void);
+extern bool Hal_greenLedRead(void);
+extern bool Hal_redLedRead(void);
/**
* --------- Hal_ledToggle ---------
*
* User LED toggles state.
*
**/
-extern void Hal_ledToggle(void);
+extern void Hal_greenLedToggle(void);
+extern void Hal_redLedToggle(void);
/**
* --------- Hal_tickStart ---------
*
*
**/
extern void Hal_tickStart(uint16_t msecs, Hal_Handler Handler);
+extern void Hal_tickStop(void);
#ifdef __cplusplus
}