a serial library to communicate with pebble time's smart strap interface

Dependents:   xadow_smartstrap_for_pebble

Committer:
KillingJacky
Date:
Wed Nov 04 09:58:41 2015 +0000
Revision:
0:e4dad9e53f06
initial commit;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
KillingJacky 0:e4dad9e53f06 1 #pragma once
KillingJacky 0:e4dad9e53f06 2
KillingJacky 0:e4dad9e53f06 3 #include <stdint.h>
KillingJacky 0:e4dad9e53f06 4 #include <stdbool.h>
KillingJacky 0:e4dad9e53f06 5
KillingJacky 0:e4dad9e53f06 6 static const uint8_t ENCODING_FLAG = 0x7E;
KillingJacky 0:e4dad9e53f06 7 static const uint8_t ENCODING_ESCAPE = 0x7D;
KillingJacky 0:e4dad9e53f06 8 static const uint8_t ENCODING_ESCAPE_MASK = 0x20;
KillingJacky 0:e4dad9e53f06 9
KillingJacky 0:e4dad9e53f06 10 typedef struct {
KillingJacky 0:e4dad9e53f06 11 bool escape;
KillingJacky 0:e4dad9e53f06 12 } EncodingStreamingContext;
KillingJacky 0:e4dad9e53f06 13
KillingJacky 0:e4dad9e53f06 14 void encoding_streaming_decode_reset(EncodingStreamingContext *ctx);
KillingJacky 0:e4dad9e53f06 15 bool encoding_streaming_decode(EncodingStreamingContext *ctx, uint8_t *data, bool *complete,
KillingJacky 0:e4dad9e53f06 16 bool *is_invalid);
KillingJacky 0:e4dad9e53f06 17 bool encoding_encode(uint8_t *data);