X-Git-Url: http://git.linex4red.de/pub/USBasp.git/blobdiff_plain/39f1c0c136520a3f4746ad6381d1242979125ff3..deb181ae2c27db872c471a77e85d7190f32962c3:/firmware/tpi.h diff --git a/firmware/tpi.h b/firmware/tpi.h new file mode 100644 index 000000000..4bc766617 --- /dev/null +++ b/firmware/tpi.h @@ -0,0 +1,47 @@ +/** + * \brief Header for tpi + * \file tpi.h + * \author S³awomir Fraœ + */ +#ifndef __TPI_H__ +#define __TPI_H__ +#include + + +/* Globals */ +/** Number of iterations in tpi_delay loop */ +extern uint16_t tpi_dly_cnt; + + +/* Functions */ +/** + * TPI init + */ +void tpi_init(void); +/** + * Send raw byte by TPI + * \param b Byte to send + */ +void tpi_send_byte(uint8_t b); +/** + * Receive one raw byte from TPI + * \return Received byte + */ +uint8_t tpi_recv_byte(void); +/** + * Read block + * \param addr Address of block + * \param dptr Pointer to dest memory block + * \param len Length of read + */ +void tpi_read_block(uint16_t addr, uint8_t* dptr, uint8_t len); +/** + * Write block + * \param addr Address to program + * \param sptr Pointer to source block + * \param len Length of write + */ +void tpi_write_block(uint16_t addr, const uint8_t* sptr, uint8_t len); + + +#endif /*__TPI_H__*/