#include <tucbot/tucbot.h>
void testUart(void);
int main(void);
void testUart(void) {
uint8_t flag_redraw_menu = 0xFF;
uint8_t menu_pos = 0;
uint8_t display_pos = 0;
while (1) {
if (flag_redraw_menu) {
flag_redraw_menu = 0x00;
switch (menu_pos) {
case 1:
break;
case 2:
break;
case 3:
break;
default:
menu_pos = 0;
break;
}
}
menu_pos++;
if (menu_pos > 3) {menu_pos = 0;}
flag_redraw_menu = 0xFF;
} else {
if (menu_pos == 1) {
serstr0_p(PSTR(
"Test - UART" "\n\r" "send to "));
} else {
serstr1_p(PSTR(
"Test - UART" "\n\r" "send to "));
switch (menu_pos) {
}
}
}
if (menu_pos == 1) {
display_pos++;
if (display_pos > 7) {display_pos = 0;}
}
} else {
display_pos++;
if (display_pos > 7) {display_pos = 0;}
}
}
}
}
}
int main (void) {
testUart();
return (0);
}
void leds_set(eLedMask bitmask, uint8_t bool)
Sets the selected leds on or off.
uint8_t serstat1(void)
Gets the number of bytes in the input buffer from UART1.
uint8_t serstat0(void)
Gets the number of bytes in the input buffer from UART0.
void serstr0_p(const char *send_data)
Sends a string located in the flash through the UART0.
void uart_select(eUart select)
Selects the interface of the UART1.
@ kUartInternal
constant (1): select DSub15 interface
Definition: uart.h:55
@ kLedOn
constant (0xFF): turn leds on
Definition: leds.h:63
@ kLedRight
bit mask (0x04): right led
Definition: leds.h:46
uint8_t serinp0(void)
Receives one byte from the UART0.
void serout1(uint8_t send_data)
Sends one byte through the UART1.
@ kRequestContinuous
constant (3): request continuous updates
Definition: update.h:37
@ kLedMiddle
bit mask (0x08): middle led
Definition: leds.h:44
@ kLedOff
constant (0x00): turn leds off
Definition: leds.h:61
@ kUartXbee
constant (2): select XBee interface
Definition: uart.h:57
void lcdclr(void)
Clears the display.
void lcdxy(uint8_t x, uint8_t y)
Moves the cursor to a postion on the display.
void serstr1_p(const char *send_data)
Sends a string located in the flash through the UART1.
@ kUartRS232
constant (0): select RS232 interface
Definition: uart.h:53
void lcdstr_p(const char *send_data)
Writes a string located in the flash to the display.
void lcdout(uint8_t data)
Writes one byte to the display.
void init_tucbot(uint8_t enable_interrupts)
Initiates the TUC-Bot.
void mdelay(uint16_t mseconds)
Waits for the given time in milliseconds.
uint8_t serinp1(void)
Receives one byte from the UART1.
void serout0(uint8_t send_data)
Sends one byte through the UART0.