initial commit
This commit is contained in:
commit
1e778fc163
12 changed files with 431 additions and 0 deletions
6
include/convert.h
Normal file
6
include/convert.h
Normal file
|
@ -0,0 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
int stoi(const char* string);
|
||||
char* itoa(int number, char* string);
|
15
include/gpio.h
Normal file
15
include/gpio.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#include "stdint.h"
|
||||
|
||||
// Functions for peeking/poking into memory
|
||||
void poke(int64_t addr, uint32_t val);
|
||||
uint32_t peek(int64_t addr);
|
||||
|
||||
|
||||
int32_t gpio_call(uint32_t pin, uint32_t reg, uint32_t value, uint32_t field_size);
|
||||
|
||||
uint32_t gpio_set (uint32_t pin, uint32_t value);
|
||||
uint32_t gpio_clear (uint32_t pin, uint32_t value);
|
||||
uint32_t gpio_fselect(uint32_t pin, uint32_t value);
|
||||
uint32_t gpio_pull (uint32_t pin, uint32_t value);
|
||||
|
||||
void gpio_setAltMode5(uint32_t pin);
|
11
include/io.h
Normal file
11
include/io.h
Normal file
|
@ -0,0 +1,11 @@
|
|||
#pragma once
|
||||
|
||||
#include "stdint.h"
|
||||
|
||||
void uart_init();
|
||||
|
||||
void uart_putchar(char c);
|
||||
void uart_puts(const char* string);
|
||||
|
||||
char uart_getchar();
|
||||
char* uart_gets(char* string);
|
13
include/stdint.h
Normal file
13
include/stdint.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
typedef char int8_t;
|
||||
typedef short int16_t;
|
||||
typedef int int32_t;
|
||||
typedef long int64_t;
|
||||
|
||||
typedef unsigned char uint8_t;
|
||||
typedef unsigned short uint16_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned long uint64_t;
|
||||
|
||||
typedef uint64_t size_t;
|
Loading…
Add table
Add a link
Reference in a new issue