TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
Loading...
Searching...
No Matches
utils.h File Reference

Utility and helper functions for joystick, LED debugging, and mapping. More...

#include <avr/io.h>
#include <util/delay.h>
#include "io.h"

Go to the source code of this file.

Macros

#define UTILS_DEBUG_LED_PIN   PB0
#define TRASHCAN   ((void *)0)
#define STATUS_ASSERT(status)
 Macro to assert a status and flash a debug LED.

Functions

uint8_t utils_joystick_print_pos (struct io_joystick_position *pos)
 Prints joystick position (x/y) via UART.
uint8_t utils_joystick_print_raw (struct io_joystick_device *dev)
 Prints raw ADC joystick readings via UART.
int16_t map (uint8_t x, uint8_t in_min, uint8_t in_max, int16_t out_min, int16_t out_max)
 Maps a value from one range to another (taken from https://docs.arduino.cc/language-reference/en/functions/math/map/).

Detailed Description

Utility and helper functions for joystick, LED debugging, and mapping.

Definition in file utils.h.