File containing the OLED functions. More...
#include <__cross_studio_io.h>
#include <msp430x16x.h>
#include <stdlib.h>
#include "main.h"
#include "oled.h"
#include "pad.h"
#include "gps.h"
Include dependency graph for oled.c:

Functions | |
void | enableUSARTforOLED (void) |
Enable and config USART for OLED. | |
void | resetOLED () |
Reset OLED. | |
void | toggleOLEDInterrupt (unsigned int state) |
Toggle OLED interrupt. More... | |
void | sendChar (int c) |
Send char. More... | |
void | usart1_rx (void) |
Receive function for OLED data (USART1, interrupt mode) | |
void | gfx_Clean () |
Clean the screen. | |
void | gfx_BGcolour (int color) |
Set the background color. More... | |
void | gfx_PutString (char *string) |
Put a string on the screen. More... | |
void | gfx_RectangleFilled (int x1, int y1, int x2, int y2, int color) |
Draw a rectangle filled with a color. More... | |
void | SSTimeout (int t) |
Screensave mode. More... | |
void | gfx_CalculateOrbit (int angle, int distance, int *x, int *y) |
Calculate the (x,y) pos (orbit) from angle and distance. More... | |
void | gfx_DrawCircle (int x, int y, int radius, int color) |
Draw a circle. More... | |
void | gfx_DrawLine (int x1, int y1, int x2, int y2, int color) |
Draw a line. More... | |
void | gfx_MoveOrigin (int x, int y) |
Move to origin to a position. More... | |
void | gfx_ScreenMode (int mode) |
Screen mode (portrait/landscape) More... | |
void | txt_FGColor (int color) |
Set the text color. More... | |
void | txt_BGColor (int color) |
Set the text background color. More... | |
void | setBaudRate () |
Set the baud rate. | |
void | gfx_Rectangle (int x1, int y1, int x2, int y2, int color) |
Draw a rectangle. More... | |
void | txt_Width (int multi) |
Set the width of the text. More... | |
void | initOLED () |
Configure OLED for proper using. | |
void | displayMainMenu () |
Display menu. | |
void | updateMenu () |
Update the menu with currently selected. | |
void | displayHeader () |
Display message header. | |
void | displayMessage (char *string) |
Display a string in the center of the screen. More... | |
void | displayCompass () |
Display the compass. | |
void | ftoa (char *p, float x) |
Float to string conversion. More... | |
char * | calculateDirection () |
Calculate the direction (N, S, NE, etc.) More... | |
Variables | |
int | displayHasBeenUpdated |
unsigned int | modeDisplay = MD_SHUTDOWN |
unsigned int | oldModeDisplay |
int | answer = 0 |
The answer received by the OLED. | |
int | flagReceive = 0 |
Answer received? | |
Detailed Description
File containing the OLED functions.
Function Documentation
char* calculateDirection | ( | ) |
Calculate the direction (N, S, NE, etc.)
- Returns
- The direction.
Here is the caller graph for this function:

void displayMessage | ( | char * | string | ) |
Display a string in the center of the screen.
- Parameters
-
string The string to display
Here is the call graph for this function:

Here is the caller graph for this function:

void ftoa | ( | char * | p, |
float | x | ||
) |
Float to string conversion.
- Parameters
-
p The buffer (string) [in] x The float
Here is the caller graph for this function:

void gfx_BGcolour | ( | int | color | ) |
Set the background color.
- Parameters
-
[in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_CalculateOrbit | ( | int | angle, |
int | distance, | ||
int * | x, | ||
int * | y | ||
) |
Calculate the (x,y) pos (orbit) from angle and distance.
- Parameters
-
[in] angle The angle [in] distance The distance x The x pos computed y The y pos computed
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_DrawCircle | ( | int | x, |
int | y, | ||
int | radius, | ||
int | color | ||
) |
Draw a circle.
- Parameters
-
[in] x x pos of center of the circle [in] y y pos of center of the circle [in] radius The radius [in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_DrawLine | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | color | ||
) |
Draw a line.
- Parameters
-
[in] x1 The x pos of the beginning of the line [in] y1 The y pos of the beginning of the line [in] x2 The x pos of the ending of the line [in] y2 The y pos of the ending of the line [in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_MoveOrigin | ( | int | x, |
int | y | ||
) |
Move to origin to a position.
- Parameters
-
[in] x The new x pos [in] y The new y pos
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_PutString | ( | char * | string | ) |
Put a string on the screen.
- Parameters
-
string The string
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_Rectangle | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | color | ||
) |
Draw a rectangle.
- Parameters
-
[in] x1 The x pos of the top left corner [in] y1 The y pos of the top left corner [in] x2 The x pos of the bottom right corner [in] y2 The y pos of the bottom right corner [in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_RectangleFilled | ( | int | x1, |
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | color | ||
) |
Draw a rectangle filled with a color.
- Parameters
-
[in] x1 The x pos of the top left corner [in] y1 The y pos of the top left corner [in] x2 The x pos of the bottom right corner [in] y2 The y pos of the bottom right corner [in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void gfx_ScreenMode | ( | int | mode | ) |
Screen mode (portrait/landscape)
- Parameters
-
[in] mode The mode
Here is the call graph for this function:

Here is the caller graph for this function:

void sendChar | ( | int | c | ) |
Send char.
- Parameters
-
c The int to send
Here is the caller graph for this function:

void SSTimeout | ( | int | t | ) |
Screensave mode.
- Parameters
-
[in] t The mode
Here is the call graph for this function:

Here is the caller graph for this function:

void toggleOLEDInterrupt | ( | unsigned int | state | ) |
Toggle OLED interrupt.
1 = interrupt enable for OLED, 0 = disable
- Parameters
-
state The new state
Here is the caller graph for this function:

void txt_BGColor | ( | int | color | ) |
Set the text background color.
- Parameters
-
[in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void txt_FGColor | ( | int | color | ) |
Set the text color.
- Parameters
-
[in] color The color
Here is the call graph for this function:

Here is the caller graph for this function:

void txt_Width | ( | int | multi | ) |
Set the width of the text.
- Parameters
-
[in] multi The multi
Here is the call graph for this function:

Variable Documentation
int displayHasBeenUpdated |
Is the display has been updated, aka needed
unsigned int modeDisplay = MD_SHUTDOWN |
What mode is selected right now
unsigned int oldModeDisplay |
What mode was selected just before