GR712RC unit tests
1.0
Bare-metal C++ hardware tests for the PLATO DPU (IAA-CSIC, 2019)
Loading...
Searching...
No Matches
src
app
unit_test
gpio_config.cpp
Go to the documentation of this file.
1
22
23
#include <cstdint>
24
#include <
mcal/mcal.h
>
25
26
//#include <bcc/bcc.h>
27
//#include <bcc/bcc_param.h>
28
29
namespace
30
{
31
//Active delay, loops for x time.
32
void
delay()
33
{
34
for
(std::uint32_t iter= 0; iter < 4000; ++iter)
35
for
(std::uint32_t iter2 = 0; iter2 < 100; iter2++)
36
{
37
mcal::cpu::nop
();
38
}
39
}
40
}
41
42
43
int
main
()
44
{
45
46
//mcal::init(nullptr);
47
mcal::init
(
nullptr
);
48
49
//Instantiate the gpio pin32.
50
mcal::port::port_pin
<std::uint32_t,
51
std::uint32_t,
52
mcal::reg::grgpio1_base_address
,
53
UINT32_C(26) > gpio26_pin;
54
55
gpio26_pin.
set_direction_output
();
56
57
58
while
(1)
59
{
60
gpio26_pin.
toggle_pin
();
61
}
62
63
return
0;
64
}
mcal::port::port_pin
Definition
mcal_port.h:25
mcal::port::port_pin::set_direction_output
static void set_direction_output()
Definition
mcal_port.h:27
mcal::port::port_pin::toggle_pin
static void toggle_pin()
Definition
mcal_port.h:101
main
int main()
Definition
gpio_config.cpp:43
mcal.h
Microcontroller abstraction layer.
mcal::cpu::nop
void nop()
Definition
mcal_cpu.h:24
mcal::reg::grgpio1_base_address
constexpr std::uint32_t grgpio1_base_address
Definition
mcal_reg.h:27
mcal::init
void init(config_type *)
Definition
mcal.cpp:12
Generated by
1.15.0