Initial import of NFC GNSS SDK project
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#ifndef _VCOM_SERIAL_
|
||||
#define _VCOM_SERIAL_
|
||||
|
||||
#include <stdint.h>
|
||||
#include "cpu.h"
|
||||
#include "shmrb.h"
|
||||
#include "aboot-tiny.h"
|
||||
|
||||
typedef enum {
|
||||
VCOM_DEV_MCU_TO_CR5 = 0, /* MCU AP <--> CR5 */
|
||||
VCOM_DEV_MCU_TO_SHUB = 1, /* MCU AP <--> SHUB */
|
||||
VCOM_DEV_MAX,
|
||||
} vcom_dev_num_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
unsigned int_val; /* number of triggers sent to the opposite party */
|
||||
unsigned handle_int_val; /* number of triggers processed by the opposite party */
|
||||
unsigned ack_int_val; /* number of triggers sent by the opposite party*/
|
||||
unsigned handle_ack_int_val; /* number of triggers processed by your party */
|
||||
}trigger_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
typedef struct {
|
||||
#ifdef VCOM_MASTER
|
||||
shmrb_t rx_buf;
|
||||
trigger_t rx_trigger;
|
||||
shmrb_t tx_buf;
|
||||
trigger_t tx_trigger;
|
||||
#else
|
||||
shmrb_t tx_buf;
|
||||
trigger_t tx_trigger;
|
||||
shmrb_t rx_buf;
|
||||
trigger_t rx_trigger;
|
||||
#endif
|
||||
} vcom_shmem_t;
|
||||
/*---------------------------------------------------------------------------*/
|
||||
void vcom_shmem_init(vcom_dev_num_t dev, uintptr_t start, uintptr_t end);
|
||||
int vcom_init(vcom_dev_num_t dev, aboot_tiny_uart_rx_callback_t rx_cb, void *arg);
|
||||
void vcom_exit(vcom_dev_num_t dev);
|
||||
int vcom_send(vcom_dev_num_t dev, const uint8_t *data, size_t size);
|
||||
/*---------------------------------------------------------------------------*/
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user