aos/usr/shelly/shelly.h
2022-05-30 23:50:04 +02:00

46 lines
1.2 KiB
C

/*
* Copyright (c) 2019, ETH Zurich.
* All rights reserved.
*
* This file is distributed under the terms in the attached LICENSE file.
* If you do not find this file, copies can be found by writing to:
* ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
*/
#ifndef SHELLY_H_
#define SHELLY_H_
// #define SHELLY_DEBUG_ON 1
#if defined(SHELLY_DEBUG_ON)
#define SHELLY_DEBUG(x...) debug_printf("[SHELLY_DEBUG] " x);
#else
#define SHELLY_DEBUG(x, ...) ((void)0)
#endif
#include <drivers/lpuart.h>
#include <drivers/gic_dist.h>
#include <aos/ump_chan.h>
#define SHELLY_BUF_SIZE 2048
//state that is shared for all clients
struct shelly_st_global {
void * lpuart_base; // < virtual address of the lpuart device registers
void * gic_base; // < virtual address of the gic device registers
struct lpuart_s * uart_s; // < state of the uart driver
struct gic_dist_s * gic_s; // < state of the gic driver
u_int32_t num_clients;
char buf[SHELLY_BUF_SIZE];
};
//state that different for each client
struct shelly_st_local {
uint32_t client_id;
struct ump_recv_chan * recv_chan;
struct ump_send_chan * send_chan;
};
#endif // ndef SHELLY_H_