Interface layer for the mbed boards ready for the JAVA library

Dependencies:   C12832 LM75B MMA7660 mbed FXOS8700Q

Fork of frdm_serial by Michael Berry

main.h

Committer:
Condo2k4
Date:
2016-02-16
Revision:
7:238c6fd5c209
Parent:
5:d9f8c2f63323
Child:
8:d70e3e3690fd

File content as of revision 7:238c6fd5c209:

#ifndef __main_h_
#define __main_h_

#ifndef M_PI
    #define M_PI 3.14159265358979323f
#endif

//COMMAND
typedef enum command_character_t {
    //read commands
    READ_DIGITAL = 0, READ_POT, READ_TEMP, READ_BOARD_ACCEL, READ_SHIELD_ACCEL, READ_BOARD_MAGNO,
    //set commands
    SET_SHIELD_LED, SET_BOARD_LED,SET_PIEZO,
    //higher level get commands
    GET_ORIENTATION, GET_SIDE, GET_HEADING,
    //lcd commands
    SET_LCD_POSITION, PRINT_TEXT, SET_PIXEL, CLEAR_LCD,
    //other commands
    RECONNECT, COMMAND_LENGTH
} command_character;

void read_digital();
void read_pot();
void read_temp();
void read_board_accel();
void read_shield_accel();
void read_board_magno();
void set_shield_led();
void set_board_led();
void set_piezo();
void get_orientation();
void get_side();
void get_heading();
void set_lcd_position();
void print_text();
void set_lcd_pixel();
void clear_lcd();
void reconnect();

// Array of pointers to command handlers
void (*commandFunctions[COMMAND_LENGTH]) (void) = {
    read_digital, read_pot, read_temp, read_board_accel,  read_shield_accel, read_board_magno,
    
    set_shield_led, set_board_led, set_piezo,
    
    get_orientation, get_side, get_heading,
    
    set_lcd_position, print_text, set_lcd_pixel, clear_lcd,
    
    reconnect
};

#endif // __main_h_