#include "asuro_defs.h"
Go to the source code of this file.
Type definitions | |
typedef void(* | AS_UserIsr )(void) |
User ISRs have to have this signature. | |
Main functions | |
void | AS_Init (void) |
Do some initialization stuff. | |
unsigned long | AS_GetClockTicks (void) |
Return the number of system clock ticks elapsed since system start. | |
unsigned long | AS_GetSysTime (void) |
Return the time in milliseconds elapsed since system start. | |
void | AS_Sleep (unsigned int time) |
Halt execution for a given time in milliseconds. | |
void | AS_StatusLED (unsigned char color) |
Set status LED to the specified color. | |
void | AS_FrontLED (unsigned char status) |
Set front LED on or off. | |
void | AS_BackLED (unsigned char left, unsigned char right) |
Set back LEDs on or off. | |
void | AS_MotorSpeed (unsigned char left_speed, unsigned char right_speed) |
Set speed of left and right motor. | |
void | AS_MotorDir (unsigned char left_dir, unsigned char right_dir) |
Set rotation direction of left and right motor. | |
void | AS_SerWrite (unsigned char *data, unsigned char length) |
Send data via IR serial interface. | |
void | AS_SensSwitchesInterruptOn (void) |
Turn on interrupt for activity on switches. | |
void | AS_SensSwitchesInterruptOff (void) |
Disable interrupt for activity on switches. | |
unsigned char | AS_SensSwitchesRead (void) |
Read status of switches. | |
Global variables | |
volatile char | AS_sensSwitched |
Set to true, when one or more of the switches are pressed. | |
volatile char | AS_sensSwitchesOn |
Set to true if the interrupt for switches is enabled. | |
volatile AS_UserIsr | AS_UserIsrInterrupt1 |
User defined ISR for INT1 (switches). |
The implentations of these are target-specific.
Definition in file asuro.h.
|
Set back LEDs on or off. Note that you can also call AS_LED_RBACK_ON, AS_LED_RBACK_OFF, AS_LED_LBACK_ON and AS_LED_LBACK_OFF directly, but you have to switch to AS_BACK_LED_MODE before. left Status for left back LED (AS_ON or AS_OFF) right Status for right back LED (AS_ON or AS_OFF) Definition at line 222 of file asuro_avr.c. References AS_BACK_LED_MODE, AS_LED_LBACK_OFF, AS_LED_LBACK_ON, AS_LED_ODO_OFF, AS_LED_RBACK_OFF, and AS_LED_RBACK_ON. |
|
Set front LED on or off. Note that you can also call AS_LED_FRONT_ON and AS_LED_FRONT_OFF directly.
Definition at line 209 of file asuro_avr.c. References AS_LED_FRONT_OFF, and AS_LED_FRONT_ON. |
|
Return the number of system clock ticks elapsed since system start. Remember that it might overflow.
Definition at line 158 of file asuro_avr.c. References AS_clockTicks, and AS_count36kHz. |
|
Return the time in milliseconds elapsed since system start. Remember that it might overflow.
Definition at line 169 of file asuro_avr.c. References AS_clockTicks, and AS_count36kHz. |
|
Set rotation direction of left and right motor. Possible values are AS_DIR_FWD (forward), AS_DIR_RWD (backward), AS_DIR_BREAK (stop) and AS_DIR_FREE (no change to direction).
Definition at line 255 of file asuro_avr.c. References AS_DIR_LEFT, and AS_DIR_RIGHT. Referenced by AS_Init(). |
|
Set speed of left and right motor. Use AS_MotorDir() before to specifiy the direction.
Definition at line 241 of file asuro_avr.c. Referenced by AS_Init(). |
|
Turn on interrupt for activity on switches. The user ISR assigned to AS_UserIsrInterrupt1 will be called if any of the switches was pushed. Definition at line 292 of file asuro_avr.c. References AS_PD_SWITCHES, AS_SENS_SWITCHES_OFF, AS_sensSwitched, DDRD, GICR, INT1, ISC10, ISC11, and MCUCR. |
|
Read status of switches. The bits of the returned value represent the switches currently pressed. The mapping is the following: bit0 = K6, bit1 = K5, bit2 = K4, bit3 = K3, bit4 = K2, bit5 = K1
Definition at line 323 of file asuro_avr.c. References ADMUX, AS_ADC_FINISHED, AS_ADC_START, AS_ADC_STOP, AS_ADC_VALUE, AS_Avr_Sleep(), AS_MUX_SWITCHES, AS_SENS_SWITCHES_MODE, AS_SENS_SWITCHES_OFF, AS_SENS_SWITCHES_ON, and REFS0. |
|
Send data via IR serial interface. IR-RC5 decoding will be disabled during write.
Definition at line 268 of file asuro_avr.c. References AS_irrc5DecodeEnabled, UCSRA, UCSRB, and UDR. |
|
Halt execution for a given time in milliseconds. Note: a value of zero will not return immediately as you might expect. Instead, the execution is halted for over a minute!
Definition at line 181 of file asuro_avr.c. References AS_count36kHz. |
|
Set status LED to the specified color. Note that you can also call AS_LED_GREEN_ON, AS_LED_GREEN_OFF, AS_LED_RED_ON, AS_LED_RED_OFF, AS_LED_YELLOW_ON and AS_LED_YELLOW_OFF directly. color Color (possible values: AS_GREEN, AS_RED, AS_YELLOW) Definition at line 197 of file asuro_avr.c. References AS_GREEN, AS_LED_GREEN_OFF, AS_LED_GREEN_ON, AS_LED_RED_OFF, AS_LED_RED_ON, and AS_RED. |
|
Set to true, when one or more of the switches are pressed. Note that you have to turn on the concerned interrupt using AS_SensSwitchesInterruptOn(). Definition at line 55 of file asuro_avr.c. Referenced by AS_SensSwitchesInterruptOn(), and SIGNAL(). |
|
Set to true if the interrupt for switches is enabled. If it is not enabled, you may activate it by using AS_SensSwitchesInterruptOn(). Definition at line 49 of file asuro_avr.c. |
|
User defined ISR for INT1 (switches). Assign a function to this global variable to get your own ISR called. Definition at line 25 of file asuro_avr.c. Referenced by SIGNAL(). |