GR712RC unit tests 1.0
Bare-metal C++ hardware tests for the PLATO DPU (IAA-CSIC, 2019)
Loading...
Searching...
No Matches
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
29namespace
30{
31//Active delay, loops for x time.
32void delay()
33{
34 for (std::uint32_t iter= 0; iter < 4000; ++iter)
35 for (std::uint32_t iter2 = 0; iter2 < 100; iter2++)
36 {
38 }
39}
40}
41
42
43int 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,
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}
static void set_direction_output()
Definition mcal_port.h:27
static void toggle_pin()
Definition mcal_port.h:101
int main()
Microcontroller abstraction layer.
void nop()
Definition mcal_cpu.h:24
constexpr std::uint32_t grgpio1_base_address
Definition mcal_reg.h:27
void init(config_type *)
Definition mcal.cpp:12