|
TTK4155 Lab Node 1
Term project in the NTNU course TTK4155 Embedded and Industrial Computer Systems Design
|
#include <avr/pgmspace.h>#include <stdint.h>#include <util/delay.h>#include "adc.h"#include "can.h"#include "io.h"#include "log.h"#include "spi.h"#include "uart.h"#include "utils.h"#include <stdio.h>Go to the source code of this file.
Macros | |
| #define | JOYSTICK_THRESHOLD 10 |
| #define | IO_AVR_TOUCH_PAD 0x01 |
| #define | IO_AVR_TOUCH_SLIDER 0x02 |
| #define | IO_AVR_JOYSTICK 0x03 |
| #define | IO_AVR_BUTTONS 0x04 |
| #define | IO_AVR_LED_TOGGLE 0x05 |
| #define | IO_AVR_LED_PWM 0x06 |
| #define | IO_AVR_INFO 0x07 |
Functions | |
| LOG_MODULE_DEFINE ("IO") | |
| int | io_joystick_init (struct io_joystick_device *dev) |
| Initialise and calibrate a joystick. | |
| int | io_joystick_read_position (struct io_joystick_device *dev, struct io_joystick_position *buffer) |
| Read the position of a joystick as a percentage from 0 in each axis. | |
| int | io_joystick_read_direction (struct io_joystick_device *dev, enum io_joystick_direction *direction) |
| Fetches the direction of a joystick. | |
| int | io_avr_init (struct io_avr_device *dev) |
| int | io_avr_buttons_read (struct io_avr_device *dev, struct io_avr_buttons *btn) |
| int | io_avr_led_set (struct io_avr_device *dev, unsigned char led, unsigned char brightness) |
| static int | _io_oled_cmd (struct io_oled_device *dev, uint8_t command) |
| static int | _io_oled_write (struct io_oled_device *dev, uint8_t data) |
| int | io_oled_init (struct io_oled_device *dev) |
| Initialise OLED. | |
| int | io_oled_reset (struct io_oled_device *dev) |
| Sends command to OLED. | |
| int | io_oled_home (struct io_oled_device *dev) |
| Loads homescreen to OLED. | |
| int | io_oled_goto_line (struct io_oled_device *dev, int line) |
| Go to specific line in OLED. | |
| int | io_oled_goto_column (struct io_oled_device *dev, int column) |
| Go to specific column in OLED. | |
| int | io_oled_clear_line (struct io_oled_device *dev, int line) |
| Clear specific line in OLED. | |
| int | io_oled_clear_all (struct io_oled_device *dev) |
| Clears all lines on the OLED (fills entire display with black). | |
| int | io_oled_pos (struct io_oled_device *dev, int line, int column) |
| Set specific position in OLED. | |
| int | io_oled_set_brightness (struct io_oled_device *dev, uint8_t brightness) |
| Set OLED brightness. | |
| int | io_oled_reset_brightness (struct io_oled_device *dev) |
| Reset OLED brightness. | |
| int | io_oled_print_arrow (struct io_oled_device *dev, uint8_t row, uint8_t col) |
| Prints an arrow at a specified postion. | |
| uint8_t | io_oled_write_glyph (struct io_oled_device *dev, const struct oled_font *font, char character_id) |
| Prints a single glyph in a specifiec font. | |
| int | io_oled_print_with_font (struct io_oled_device *dev, const struct oled_font *font, char *text) |
| Prints an arrow at a specified postion. | |
| int | io_oled_test (struct io_oled_device *dev) |
| Prints a known image to the OLED to confirm that it can print and navigate the screen. | |
| int | io_oled_blink (struct io_oled_device *dev, uint8_t blinks) |
| Alternates screen between black and white. | |
| int | io_oled_write_data (struct io_oled_device *dev, uint8_t data) |
| int | io_oled_write_command (struct io_oled_device *dev, uint8_t command) |
| #define IO_AVR_BUTTONS 0x04 |
Definition at line 21 of file io.c.
Referenced by io_avr_buttons_read().
| #define IO_AVR_LED_PWM 0x06 |
Definition at line 23 of file io.c.
Referenced by io_avr_led_set().
| #define JOYSTICK_THRESHOLD 10 |
Definition at line 16 of file io.c.
Referenced by io_joystick_read_direction().
|
static |
Definition at line 141 of file io.c.
Referenced by io_oled_goto_column(), io_oled_goto_line(), io_oled_init(), io_oled_reset(), io_oled_reset_brightness(), io_oled_set_brightness(), and io_oled_write_command().
|
static |
Definition at line 149 of file io.c.
Referenced by io_oled_blink(), io_oled_clear_line(), io_oled_init(), io_oled_print_arrow(), io_oled_test(), io_oled_write_data(), and io_oled_write_glyph().
| LOG_MODULE_DEFINE | ( | "IO" | ) |