/*
 * David Muller; Germán Alfaro
 * davehmuller@gmail.com; alfaro.germanevera@gmail.com
 * Thom Maughan, tm@mbari.org
 */
#ifndef MPHOX_MICROCAT_H_
#define MPHOX_MICROCAT_H_



void ctd_microCat_comm_test(void);
void ctd_microCat_parseData(void);
void ctd_microCat_poll(void);

#ifdef NOCODE
/*
 * MicroCAT.c function prototypes:
 */
void microCat_init(void);
void microCat_open(void);
void microCat_poll(void);
void microCat_close(void);
void microCat_parseData(void);

void microCat_config(uint32_t ui32Port, uint32_t ui32Baud,
                            uint32_t ui32SrcClock);
int microCat_gets(char *pcBuf, uint32_t ui32Len);
unsigned char microCat_getc(void);
int microCat_putc(const char c);
int microCat_write(const char *pcBuf, uint32_t ui32Len);
int microCat_peek(unsigned char ucChar);
void microCat_flushTx(bool bDiscard);
void microCat_flushRx(void);
int microCat_rxBytesAvail(void);
int microCatTxBytesFree(void);
void microCat_echoSet(bool bEnable);



void microCat_IntHandler(void);

struct microCatDriver
{
    unsigned int state;
    unsigned int old_tick10ms;      // for timeout
    unsigned int new_tick10ms;
    unsigned int bufIndx;
    unsigned char buf[MICROCAT_BUFFER_SIZE];      // defd in system.h
};

#endif

#endif /* MPHOX_MICROCAT_H_ */



