#define GPIO_LOW(mask) (!(P1IN & mask))
#define GPIO_DEBOUNCE_MSECS 100
-#define DEBUG1_CONFIG() (P2DIR |= BIT3)
-#define DEBUG1_ON() (P2OUT |= BIT3)
-#define DEBUG1_OFF() (P2OUT &= ~BIT3)
-
-#define DEBUG2_CONFIG() (P2DIR |= BIT4)
-#define DEBUG2_ON() (P2OUT |= BIT4)
-#define DEBUG2_OFF() (P2OUT &= ~BIT4)
-
#define EAP_RX_BUF UCA0RXBUF
#define EAP_TX_BUF UCA0TXBUF
void Hal_connected(void) {
}
-void Hal_debugOn(uint8_t line) {
- switch (line) {
- case 1:
- DEBUG1_ON();
- break;
- case 2:
- DEBUG2_ON();
- }
-}
-
-void Hal_debugOff(uint8_t line) {
- switch (line) {
- case 1:
- DEBUG1_OFF();
- break;
- case 2:
- DEBUG2_OFF();
- }
-}
-
-void Hal_debugPulse(uint8_t line) {
- switch (line) {
- case 1:
- DEBUG1_ON();
- DEBUG1_OFF();
- break;
- case 2:
- DEBUG2_ON();
- DEBUG2_OFF();
- }
-}
-
void Hal_delay(uint16_t msecs) {
while (msecs--) {
__delay_cycles(MCLK_TICKS_PER_MS);
RED_LED_CONFIG();
RED_LED_OFF();
- /* setup debug pins */
-
- DEBUG1_CONFIG(); DEBUG1_OFF();
- DEBUG2_CONFIG(); DEBUG2_OFF();
-
- DEBUG1_ON(); DEBUG1_OFF();
-
/* setup TimerA1 */
TA1CTL = TASSEL_1 + MC_2; // ACLK, Continuous mode
UART_WATCH_DISABLE();
* 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.
*
**/
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 ---------
*