forked from gabonator/LA104
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArduino.cpp
More file actions
47 lines (38 loc) · 883 Bytes
/
Copy pathArduino.cpp
File metadata and controls
47 lines (38 loc) · 883 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "Arduino.h"
#include <library.h>
void CSerial::println(const char* msg) {}
void CSerial::println(int) {}
void CSerial::println(int, int) {}
void delay(int ms)
{
BIOS::SYS::DelayMs(ms);
}
uint32_t millis()
{
return BIOS::SYS::GetTick();
}
void CSerial::begin(int baudrate)
{
BIOS::GPIO::UART::Setup(9600, BIOS::GPIO::UART::length8);
BIOS::GPIO::PinMode(BIOS::GPIO::P1, BIOS::GPIO::Uart);
BIOS::GPIO::PinMode(BIOS::GPIO::P2, BIOS::GPIO::Uart);
}
bool CSerial::available()
{
return BIOS::GPIO::UART::Available();
}
uint8_t CSerial::read()
{
while (!BIOS::GPIO::UART::Available());
return BIOS::GPIO::UART::Read();
}
void CSerial::write(uint8_t* buffer, int len)
{
while (len--)
BIOS::GPIO::UART::Write(*buffer++);
}
void CSerial::print(const char* msg)
{
BIOS::DBG::Print(msg);
}
CSerial Serial;