NTURT Zephyr v0.0.1
NTURT common library for Zephyr RTOS
Loading...
Searching...
No Matches
Dashboard

Dashboard and display system. More...

Data Structures

struct  dashboard_mode_info
 Information about a dashboard mode. More...
 

Macros

#define NUM_LED   DT_CHILD_NUM_STATUS_OKAY(DT_CHOSEN(nturt_leds))
 Number of LEDs in the dashboard.
 
#define LED_STRIP_LEN   DT_PROP(DT_CHOSEN(nturt_accel_display), chain_length)
 Length of the LED strips.
 
#define LED_BLINK_PERIOD   K_MSEC(250)
 Period for a blinking LED to switch state.
 
#define HOLD_MODIFY_INTERVAL   K_MSEC(100)
 Interval between two modifications when holding.
 

Typedefs

typedef void(* dashboard_mode_trans_t) ()
 

Enumerations

enum  dashboard_component {
  DASHBOARD_SPEED , DASHBOARD_BATTERY , DASHBOARD_ACCEL , DASHBOARD_BRAKE ,
  NUM_DASHBOARD_DISPLAY
}
 Components of the dashboard. More...
 
enum  dashboard_mode { DASHBOARD_NORMAL , DASHBOARD_SETTING , DASHBOARD_TEST , NUM_DASHBOARD_MODE }
 Dashboard modes. More...
 

Functions

int dashboard_brightness_get ()
 Get the current brightness of the dashboard.
 
void dashboard_brightness_set (int brightness)
 Set the brightness of the dashboard.
 
void dashboard_led_set (int led, bool set)
 Set the LED state.
 
void dashboard_clear (enum dashboard_component display)
 Clear the display for a component.
 
void dashboard_set_level (enum dashboard_component display, int level)
 Set the level for a component.
 
void dashboard_set_error (enum dashboard_component display)
 Set error state for a component.
 
void dashboard_apply_selected (enum dashboard_component display)
 Apply the selected state for a component.
 
enum dashboard_mode dashboard_mode_get ()
 Get the current dashboard mode.
 
void dashboard_mode_set (enum dashboard_mode mode)
 Set the dashboard mode.
 
const struct dashboard_mode_info * dashboard_mode_info (enum dashboard_mode mode)
 Get the information about a dashboard mode.
 
int dashboard_settings_save ()
 Save the current dashboard settings.
 

Detailed Description

Dashboard and display system.

Macro Definition Documentation

◆ HOLD_MODIFY_INTERVAL

#define HOLD_MODIFY_INTERVAL   K_MSEC(100)

#include <vcu/dashboard.h>

Interval between two modifications when holding.

◆ LED_BLINK_PERIOD

#define LED_BLINK_PERIOD   K_MSEC(250)

#include <vcu/dashboard.h>

Period for a blinking LED to switch state.

◆ LED_STRIP_LEN

#define LED_STRIP_LEN   DT_PROP(DT_CHOSEN(nturt_accel_display), chain_length)

#include <vcu/dashboard.h>

Length of the LED strips.

◆ NUM_LED

#define NUM_LED   DT_CHILD_NUM_STATUS_OKAY(DT_CHOSEN(nturt_leds))

#include <vcu/dashboard.h>

Number of LEDs in the dashboard.

Typedef Documentation

◆ dashboard_mode_trans_t

typedef void(* dashboard_mode_trans_t) ()

#include <vcu/dashboard.h>

Enumeration Type Documentation

◆ dashboard_component

#include <vcu/dashboard.h>

Components of the dashboard.

Enumerator
DASHBOARD_SPEED 
DASHBOARD_BATTERY 
DASHBOARD_ACCEL 
DASHBOARD_BRAKE 
NUM_DASHBOARD_DISPLAY 

◆ dashboard_mode

#include <vcu/dashboard.h>

Dashboard modes.

Enumerator
DASHBOARD_NORMAL 
DASHBOARD_SETTING 
DASHBOARD_TEST 
NUM_DASHBOARD_MODE 

Function Documentation

◆ dashboard_apply_selected()

void dashboard_apply_selected ( enum dashboard_component display)

#include <vcu/dashboard.h>

Apply the selected state for a component.

Parameters
displayThe component to apply the selected state for.

◆ dashboard_brightness_get()

int dashboard_brightness_get ( )

#include <vcu/dashboard.h>

Get the current brightness of the dashboard.

Returns
int Current brightness level in [0, 100].

◆ dashboard_brightness_set()

void dashboard_brightness_set ( int brightness)

#include <vcu/dashboard.h>

Set the brightness of the dashboard.

Parameters
brightnessThe brightness level to set in [0, 100]. If the value is outside this range, it will be clamped.

◆ dashboard_clear()

void dashboard_clear ( enum dashboard_component display)

#include <vcu/dashboard.h>

Clear the display for a component.

Parameters
displayThe component to clear.

◆ dashboard_led_set()

void dashboard_led_set ( int led,
bool set )

#include <vcu/dashboard.h>

Set the LED state.

Parameters
ledThe LED number to set.
setTrue to turn on the LED, false to turn it off.

◆ dashboard_mode_get()

enum dashboard_mode dashboard_mode_get ( )

#include <vcu/dashboard.h>

Get the current dashboard mode.

Returns
enum dashboard_mode The current mode.

◆ dashboard_mode_info()

const struct dashboard_mode_info * dashboard_mode_info ( enum dashboard_mode mode)

#include <vcu/dashboard.h>

Get the information about a dashboard mode.

Parameters
modeThe mode to get information for.
Returns
const struct dashboard_mode_info* Pointer to the mode information.

◆ dashboard_mode_set()

void dashboard_mode_set ( enum dashboard_mode mode)

#include <vcu/dashboard.h>

Set the dashboard mode.

Parameters
modeThe mode to set.

◆ dashboard_set_error()

void dashboard_set_error ( enum dashboard_component display)

#include <vcu/dashboard.h>

Set error state for a component.

Parameters
displayThe component to set the error for.

◆ dashboard_set_level()

void dashboard_set_level ( enum dashboard_component display,
int level )

#include <vcu/dashboard.h>

Set the level for a component.

Parameters
displayThe component to set.
levelThe level to set, clamped to the range of the component.

◆ dashboard_settings_save()

int dashboard_settings_save ( )

#include <vcu/dashboard.h>

Save the current dashboard settings.

Returns
int 0 on success, negative error code on failure.