kestrel.h 1.13 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
// © 2021 Raptor Engineering, LLC
//
// Released under the terms of the GPL v3
// See the LICENSE file for full details

#if (WITH_ZEPHYR)
#include <shell/shell.h>
#endif

#if (WITH_ZEPHYR)
#define KESTREL_SERVICE_THREAD_PRIORITY		K_PRIO_COOP(1)
#endif

14 15 16 17 18 19 20 21 22 23
struct firmware_buffer_region {
	uint8_t *buffer_address;
	unsigned long long buffer_length;
	uintptr_t current_write_offset;
	uint8_t locked;
	uint8_t overflow;
};

extern struct firmware_buffer_region main_firmware_buffer;

24 25 26 27 28 29 30 31 32 33 34 35 36 37
extern uint8_t kestrel_basic_init_complete;
extern uint8_t host_background_service_task_active;
extern uint8_t host_console_service_task_requested;

#if (WITH_ZEPHYR)
extern k_tid_t kestrel_service_thread_id;
extern k_tid_t kestrel_console_thread_id;
extern const struct shell *host_console_service_task_shell;
#endif

int kestrel_init(void);
int power_on_host(void);
void power_off_chassis(void);
void print_chassis_status(void);
38
int write_flash_buffer_to_flash(void);
39 40 41 42 43 44 45 46 47

int primary_service_event_loop(void);

#if (WITH_ZEPHYR)
int attach_to_host_console(const struct shell *shell);
int host_console_event_loop(const struct shell *shell);
#else
int attach_to_host_console();
#endif