49 lines
1.0 KiB
C
49 lines
1.0 KiB
C
#ifndef HEADER_H
|
|
#define HEADER_H
|
|
|
|
#include <avr/io.h>
|
|
#include <util/twi.h>
|
|
#include <util/delay.h>
|
|
|
|
#include "utils.h"
|
|
#include "bitmanip.h"
|
|
#include "interrupt.h"
|
|
#include "timer.h"
|
|
#include "usart.h"
|
|
#include "adc.h"
|
|
#include "i2c.h"
|
|
|
|
//
|
|
// GLOBAL
|
|
//
|
|
|
|
//
|
|
// PROTOTYPES
|
|
//
|
|
// main.c
|
|
void print_hex_value(char c);
|
|
// i2c.c
|
|
void i2c_init(void);
|
|
void i2c_start(void);
|
|
void i2c_start_repeat(void);
|
|
void i2c_send_addr_w(uint8_t slave_address);
|
|
void i2c_send_addr_r(uint8_t slave_address);
|
|
void i2c_write(unsigned char data);
|
|
uint8_t i2c_read(void);
|
|
void i2c_stop(void);
|
|
// uart.c
|
|
void uart_init();
|
|
void uart_tx(char c);
|
|
uint16_t uart_printstr(const char* str);
|
|
uint16_t uart_printstr_endl(const char* str);
|
|
uint16_t uart_printstr_itoa_base(uint64_t value, uint8_t base);
|
|
uint16_t uart_printstr_itoa_base_endl(uint64_t value, uint8_t base);
|
|
// math.c
|
|
void int_to_hex_string(uint64_t value, char *out, uint8_t num_digits);
|
|
void int_to_string_base(uint64_t value, char *buffer, uint8_t base);
|
|
|
|
//
|
|
// MACROS
|
|
//
|
|
|
|
#endif // HEADER_H
|