K-FSW ec10f94
Modular flight software on Zephyr, for small satellites
Loading...
Searching...
No Matches
boton_test Module

Public Headers

file  boton_test.h
 

Data Structures

struct  kfsw_boton_test_status
 

Enumerations

enum  kfsw_boton_test_led { KFSW_BOTON_TEST_LED_GREEN , KFSW_BOTON_TEST_LED_BLUE , KFSW_BOTON_TEST_LED_RED , KFSW_BOTON_TEST_LED_COUNT }
 

Functions

int kfsw_boton_test_init (void)
 
int kfsw_boton_test_get_status (struct kfsw_boton_test_status *status)
 
int kfsw_boton_test_set_led (enum kfsw_boton_test_led led, bool on)
 

Variables

const struct kfsw_param_definition_set kfsw_boton_test_param_definitions
 

Description

Debounced button, LEDs, status and parameters.

Enumeration Documentation

◆ kfsw_boton_test_led

#include <boton_test.h>

Independently controlled LEDs in the developer hardware-test example.

Function Documentation

◆ kfsw_boton_test_get_status()

int kfsw_boton_test_get_status ( struct kfsw_boton_test_status *  status)

#include <boton_test.h>

Copy a consistent snapshot of the module state.

Parameters
statusDestination status structure.
Returns
0 on success, -EINVAL for a NULL destination, or -EACCES before module initialization.

◆ kfsw_boton_test_init()

int kfsw_boton_test_init ( void  )

#include <boton_test.h>

Initialize the module and its GPIO.

State starts at zero on each boot. A button already held at startup is not counted until it is released and pressed again.

Returns
0 on success, or a negative errno value when GPIO setup fails.

◆ kfsw_boton_test_set_led()

int kfsw_boton_test_set_led ( enum kfsw_boton_test_led  led,
bool  on 
)

#include <boton_test.h>

Set one LED.

Parameters
ledLED colour to control.
onTrue to turn the LED on, false to turn it off.
Returns
0 on success, -EINVAL for an unknown LED, -EACCES before module initialization, or a negative GPIO error.

Variable Documentation

◆ kfsw_boton_test_param_definitions

const struct kfsw_param_definition_set kfsw_boton_test_param_definitions
extern

#include <boton_test.h>

Parameter table of boton_test.