Interface layer for the mbed boards ready for the JAVA library
Dependencies: C12832 LM75B MMA7660 mbed FXOS8700Q
Fork of frdm_serial by
main.h@8:d70e3e3690fd, 2017-01-06 (annotated)
- Committer:
- Condo2k4
- Date:
- Fri Jan 06 11:08:56 2017 +0000
- Revision:
- 8:d70e3e3690fd
- Parent:
- 7:238c6fd5c209
Extended LCD functionality.; Temporarily disable LEDs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Condo2k4 | 5:d9f8c2f63323 | 1 | #ifndef __main_h_ |
Condo2k4 | 5:d9f8c2f63323 | 2 | #define __main_h_ |
Condo2k4 | 5:d9f8c2f63323 | 3 | |
Condo2k4 | 7:238c6fd5c209 | 4 | #ifndef M_PI |
Condo2k4 | 7:238c6fd5c209 | 5 | #define M_PI 3.14159265358979323f |
Condo2k4 | 7:238c6fd5c209 | 6 | #endif |
Condo2k4 | 7:238c6fd5c209 | 7 | |
Condo2k4 | 5:d9f8c2f63323 | 8 | //COMMAND |
Condo2k4 | 5:d9f8c2f63323 | 9 | typedef enum command_character_t { |
Condo2k4 | 5:d9f8c2f63323 | 10 | //read commands |
Condo2k4 | 5:d9f8c2f63323 | 11 | READ_DIGITAL = 0, READ_POT, READ_TEMP, READ_BOARD_ACCEL, READ_SHIELD_ACCEL, READ_BOARD_MAGNO, |
Condo2k4 | 5:d9f8c2f63323 | 12 | //set commands |
Condo2k4 | 8:d70e3e3690fd | 13 | SET_SHIELD_LED, SET_BOARD_LED, SET_PIEZO, |
Condo2k4 | 5:d9f8c2f63323 | 14 | //higher level get commands |
Condo2k4 | 5:d9f8c2f63323 | 15 | GET_ORIENTATION, GET_SIDE, GET_HEADING, |
Condo2k4 | 5:d9f8c2f63323 | 16 | //lcd commands |
Condo2k4 | 8:d70e3e3690fd | 17 | SET_LCD_POSITION, PRINT_TEXT, SET_PIXEL, DRAW_CIRCLE, FILL_CIRCLE, DRAW_LINE, DRAW_RECT, FILL_RECT, CLEAR_LCD, |
Condo2k4 | 5:d9f8c2f63323 | 18 | //other commands |
Condo2k4 | 5:d9f8c2f63323 | 19 | RECONNECT, COMMAND_LENGTH |
Condo2k4 | 5:d9f8c2f63323 | 20 | } command_character; |
Condo2k4 | 5:d9f8c2f63323 | 21 | |
Condo2k4 | 5:d9f8c2f63323 | 22 | void read_digital(); |
Condo2k4 | 5:d9f8c2f63323 | 23 | void read_pot(); |
Condo2k4 | 5:d9f8c2f63323 | 24 | void read_temp(); |
Condo2k4 | 5:d9f8c2f63323 | 25 | void read_board_accel(); |
Condo2k4 | 5:d9f8c2f63323 | 26 | void read_shield_accel(); |
Condo2k4 | 5:d9f8c2f63323 | 27 | void read_board_magno(); |
Condo2k4 | 5:d9f8c2f63323 | 28 | void set_shield_led(); |
Condo2k4 | 5:d9f8c2f63323 | 29 | void set_board_led(); |
Condo2k4 | 5:d9f8c2f63323 | 30 | void set_piezo(); |
Condo2k4 | 5:d9f8c2f63323 | 31 | void get_orientation(); |
Condo2k4 | 5:d9f8c2f63323 | 32 | void get_side(); |
Condo2k4 | 5:d9f8c2f63323 | 33 | void get_heading(); |
Condo2k4 | 5:d9f8c2f63323 | 34 | void set_lcd_position(); |
Condo2k4 | 5:d9f8c2f63323 | 35 | void print_text(); |
Condo2k4 | 5:d9f8c2f63323 | 36 | void set_lcd_pixel(); |
Condo2k4 | 8:d70e3e3690fd | 37 | void draw_circle(); |
Condo2k4 | 8:d70e3e3690fd | 38 | void fill_circle(); |
Condo2k4 | 8:d70e3e3690fd | 39 | void draw_line(); |
Condo2k4 | 8:d70e3e3690fd | 40 | void draw_rect(); |
Condo2k4 | 8:d70e3e3690fd | 41 | void fill_rect(); |
Condo2k4 | 5:d9f8c2f63323 | 42 | void clear_lcd(); |
Condo2k4 | 5:d9f8c2f63323 | 43 | void reconnect(); |
Condo2k4 | 5:d9f8c2f63323 | 44 | |
Condo2k4 | 5:d9f8c2f63323 | 45 | // Array of pointers to command handlers |
Condo2k4 | 5:d9f8c2f63323 | 46 | void (*commandFunctions[COMMAND_LENGTH]) (void) = { |
Condo2k4 | 5:d9f8c2f63323 | 47 | read_digital, read_pot, read_temp, read_board_accel, read_shield_accel, read_board_magno, |
Condo2k4 | 5:d9f8c2f63323 | 48 | |
Condo2k4 | 5:d9f8c2f63323 | 49 | set_shield_led, set_board_led, set_piezo, |
Condo2k4 | 5:d9f8c2f63323 | 50 | |
Condo2k4 | 5:d9f8c2f63323 | 51 | get_orientation, get_side, get_heading, |
Condo2k4 | 5:d9f8c2f63323 | 52 | |
Condo2k4 | 8:d70e3e3690fd | 53 | set_lcd_position, print_text, set_lcd_pixel, draw_circle, fill_circle, draw_line, draw_rect, fill_rect, clear_lcd, |
Condo2k4 | 5:d9f8c2f63323 | 54 | |
Condo2k4 | 5:d9f8c2f63323 | 55 | reconnect |
Condo2k4 | 5:d9f8c2f63323 | 56 | }; |
Condo2k4 | 5:d9f8c2f63323 | 57 | |
Condo2k4 | 5:d9f8c2f63323 | 58 | #endif // __main_h_ |