X-Git-Url: http://average.org/gitweb/?a=blobdiff_plain;f=msp430%2FHal%2FHal.h;h=0c969c4c19f96b1682535dd5322b1491aef5fe1c;hb=4e9dda3367ff17c80358426a6b4126704741c0b1;hp=0d57348ab855a824c58594da29d7cd02dcb5eb84;hpb=02d2dc9e46149beb63a3dac83a9346232e2626da;p=pulsecounter.git diff --git a/msp430/Hal/Hal.h b/msp430/Hal/Hal.h index 0d57348..0c969c4 100644 --- a/msp430/Hal/Hal.h +++ b/msp430/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. - * 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 * LED -- a user LED that is available for application control. @@ -63,63 +62,6 @@ extern void Hal_gpioEnable(Hal_Handler handler); * **/ extern void Hal_connected(void); -/** - * --------- Hal_debugOff --------- - * - * Turns the selected DEBUG line off. - * - * The two DEBUG lines are output GPIOs that are available to the user for - * debug purposes. - * - * Inputs: - * line - the index value of the debug line to turn off - * - * Returns: - * None - * - * Side Effects: - * DEBUG line off. - * - **/ -extern void Hal_debugOff(uint8_t line); -/** - * --------- Hal_debugOn --------- - * - * Turns the selected DEBUG line on. - * - * The two DEBUG lines are output GPIOs that are available to the user for - * debug purposes. - * - * Inputs: - * line - the index value of the debug line to turn on - * - * Returns: - * None - * - * Side Effects: - * DEBUG line on. - * - **/ -extern void Hal_debugOn(uint8_t line); -/** - * --------- Hal_debugPulse --------- - * - * Emits a pulse on the selected DEBUG line. - * - * The two DEBUG lines are output GPIOs that are available to the user for - * debug purposes. - * - * Inputs: - * line - the index value of the debug line to emit a pulse - * - * Returns: - * None - * - * Side Effects: - * DEBUG line turns on then off. - * - **/ -extern void Hal_debugPulse(uint8_t line); /** * --------- Hal_delay --------- * @@ -285,15 +227,32 @@ extern void Hal_redLedToggle(void); * tickHandler - the address of the user's tick handler that will be called * * Returns: - * None + * Future clock when handler will be called * * Side Effects: * tickhandler called by the idle loop * **/ -extern void Hal_tickStart(uint16_t msecs, Hal_Handler Handler); +extern uint16_t Hal_tickStart(uint16_t msecs, void (*handler)(uint16_t clock)); extern void Hal_tickStop(void); +/** + * --------- Hal_gpioCount --------- + * + * Returns the number of interrups encounted on gpio `id` + * + * Inputs: + * id if the gpio (0-2 for gpio 3-5) + * + * Returns: + * Counted interrupts + * + * Side Effects: + * Resets the accumulator (counting restarts from zero). + * + **/ +extern uint32_t Hal_gpioCount(uint8_t id); + #ifdef __cplusplus } #endif