TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
Loading...
Searching...
No Matches
utils.c File Reference
#include "utils.h"
#include "adc.h"
#include "io.h"
#include "uart.h"
#include <stdlib.h>
#include <util/delay.h>

Go to the source code of this file.

Functions

int utils_test_address_decode (void)
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/).

Function Documentation

◆ utils_test_address_decode()

int utils_test_address_decode ( void )

Definition at line 8 of file utils.c.

8 {
9
10 volatile char *sram_adr = (char *)0x1800;
11 volatile char *adc_adr = (char *)0x1500;
12
13 (void)adc_adr[5];
14 _delay_ms(5000);
15 (void)sram_adr[5];
16 _delay_ms(5000);
17
18 return 0;
19}