YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
multicore_rp2040.h
1// ---------------------------------------------
2// This file is part of
3// _ _ __ _ _ __ __
4// ( \/ ) /__\ ( )_( ) /__\ ( )
5// \ / /(__)\ ) _ ( /(__)\ )(__
6// (__)(__)(__)(_) (_)(__)(__)(____)
7//
8// Yet Another HW Abstraction Library
9// Copyright (C) Andreas Terstegge
10// BSD Licensed (see file LICENSE)
11//
12// ---------------------------------------------
13//
14#ifndef _MULTICORE_RP2040_H_
15#define _MULTICORE_RP2040_H_
16
17#include <cstdint>
18#include <functional>
19
21public:
22
23 // FIFO methods
24 static void fifo_push_blocking(uint32_t val);
25 static uint32_t fifo_pop_blocking();
26 static uint32_t fifo_drain();
27
28 // Start code on Core 1
29 static void start_on_core1(
30 std::function<void(void)> func,
31 uint8_t * stack = nullptr,
32 uint32_t * vec_table = nullptr);
33 static void reset_core1();
34
35private:
36 // Helper method for calling the v
37 static void _run();
38 // Function to execute if provided in CTOR
39 static std::function<void(void)> _f;
40};
41
42#endif // _MULTICORE_RP2040_H_