Defines

Macros

Defines

#define HIGH_BYTE(x)   ((UINT8) (x >> 8U))
 This macro returns the higher byte of an UINT16 value.
#define LOW_BYTE(x)   ((UINT8) x)
 This macro returns the lower byte of an UINT16 value.
#define LED1_ON()   LED1_PORT &= ~(1U << LED1_BIT);
 Macro function to turn LED1 on.
#define LED1_OFF()   LED1_PORT |= (1U << LED1_BIT);
 Macro function to turn LED1 off.
#define LED2_ON()   LED2_PORT &= ~(1U << LED2_BIT);
 Macro function to turn LED2 on.
#define LED2_OFF()   LED2_PORT |= (1U << LED2_BIT);
 Macro function to turn LED2 off.
#define LED3_ON()   LED3_PORT &= ~(1U << LED3_BIT);
 Macro function to turn LED3 on.
#define LED3_OFF()   LED3_PORT |= (1U << LED3_BIT);
 Macro function to turn LED3 off.
#define LED4_ON()   LED4_PORT &= ~(1U << LED4_BIT);
 Macro function to turn LED4 on.
#define LED4_OFF()   LED4_PORT |= (1U << LED4_BIT);
 Macro function to turn LED4 off.
#define LED5_ON()   LED5_PORT &= ~(1U << LED5_BIT);
 Macro function to turn LED5 on.
#define LED5_OFF()   LED5_PORT |= (1U << LED5_BIT);
 Macro function to turn LED5 off.
#define ALL_LEDS_ON()
 Short macro to turn all LEDs on (used for flashing)
#define ALL_LEDS_OFF()
 Short macro to turn all LEDs off (used for flashing)
#define MUX_CURR()
 Macro to switch the multiplexer to current mode.
#define MUX_VOLT()
 Macro to switch the multiplexer to voltage mode.
#define PEDAL_INT_ENABLE()   EIMSK |= (1<<INT1);
 This macro enables the pedal interrupt.
#define PEDAL_INT_DISABLE()   EIMSK &= ~(1<<INT1);
 This macro enables the pedal interrupt.
#define SPEED_INT_ENABLE()   EIMSK |= (1<<INT0);
 This macro enables the tacho interrupt.
#define SPEED_INT_DISABLE()   EIMSK &= ~(1<<INT0);
 This macro disables the tacho interrupt.
#define SPEED_GET()   (speed_GetRpm() * WHEEL_SIZE * 6U / 10000U)
 This macro returns the current driving speed based on the wheel RPM and the setting for wheel circumference in 10th of km/h.
#define TIMER_IS_TICK128()   ((timer_GetTicks() & TICK128) != NO_TICK)
 This macro checks whether the 128ms time flag is set or not.
#define TIMER_IS_TICK256()   ((timer_GetTicks() & TICK256) != NO_TICK)
 This macro checks whether the 256ms time flag is set or not.
#define TIMER_IS_TICK512()   ((timer_GetTicks() & TICK512) != NO_TICK)
 This macro checks whether the 512ms time flag is set or not.
#define TIMER_IS_TICK1024()   ((timer_GetTicks() & TICK1024) != NO_TICK)
 This macro checks whether the 1024ms time flag is set or not.