Private
Public Access
2
0

uart_ow: add ow specific context and store search state there

Signed-off-by: Jon Trulson <jtrulson@ics.com>
Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Jon Trulson
2016-04-15 12:52:21 -06:00
committed by Brendan Le Foll
parent a702cdf4d5
commit f6d9cf57c9
2 changed files with 58 additions and 41 deletions

View File

@@ -62,9 +62,17 @@ extern "C" {
#include <stdio.h>
#include "common.h"
#include "uart.h"
/* for now, we simply use the normal MRAA UART context */
typedef struct _uart* mraa_uart_ow_context;
typedef struct _mraa_uart_ow {
mraa_uart_context uart;
/* search state */
unsigned char ROM_NO[8]; /* 8 byte (64b) rom code */
int LastDiscrepancy;
int LastFamilyDiscrepancy;
mraa_boolean_t LastDeviceFlag;
} *mraa_uart_ow_context;
/* 8 bytes (64 bits) for a device rom code */
static const int MRAA_UART_OW_ROMCODE_SIZE = 8;