W800_Smart_Watch/src/W800 SDK v1.00.08/app/gfx/compass_screen.h

56 lines
1.3 KiB
C

#ifndef COMPASS_SCREEN_H
#define COMPASS_SCREEN_H
#include "lvgl.h"
typedef struct CompassAzimuthLabel
{
lv_obj_t *label;
char text[9];
} CompassAzimuth_t;
typedef struct CompassCardinal
{
lv_obj_t *label;
lv_point_t position;
lv_point_t offset;
} CompassCardinal_t;
/*typedef struct CompassGraduation
{
lv_obj_t *meter;
lv_meter_scale_t *scale;
} CompassGraduation_t;*/
/* Compass screen context object */
typedef struct CompassScreen
{
CompassCardinal_t northCardinal;
CompassCardinal_t eastCardinal;
CompassCardinal_t southCardinal;
CompassCardinal_t westCardinal;
//CompassGraduation_t compassGraduation;
lv_obj_t *northMarker;
lv_obj_t *display;
CompassAzimuth_t compassAzimuth;
} CompassScreen_t;
/* Initializes the compass screen context object */
void compass_screen_init(CompassScreen_t * const compassScreen);
/* Set the compassAzimuth in degrees to show */
void compass_screen_set_azimuth(CompassScreen_t * const compassScreen, uint16_t azimuth);
bool compass_screen_is_in_use(CompassScreen_t * const compassScreen);
/* Builds the compass screen graphically */
void compass_screen_create(CompassScreen_t * const compassScreen);
/* Frees all resources used by the CompassScreen object */
void compass_screen_destroy(CompassScreen_t * const compassScreen);
#endif // COMPASS_SCREEN_H