3471 |
miho |
1 |
/** |
|
|
2 |
* \brief Header for tpi |
|
|
3 |
* \file tpi.h |
|
|
4 |
* \author S³awomir Fra |
|
|
5 |
*/ |
|
|
6 |
#ifndef __TPI_H__ |
|
|
7 |
#define __TPI_H__ |
|
|
8 |
#include <stdint.h> |
|
|
9 |
|
|
|
10 |
|
|
|
11 |
/* Globals */ |
|
|
12 |
/** Number of iterations in tpi_delay loop */ |
|
|
13 |
extern uint16_t tpi_dly_cnt; |
|
|
14 |
|
|
|
15 |
|
|
|
16 |
/* Functions */ |
|
|
17 |
/** |
|
|
18 |
* TPI init |
|
|
19 |
*/ |
|
|
20 |
void tpi_init(void); |
|
|
21 |
/** |
|
|
22 |
* Send raw byte by TPI |
|
|
23 |
* \param b Byte to send |
|
|
24 |
*/ |
|
|
25 |
void tpi_send_byte(uint8_t b); |
|
|
26 |
/** |
|
|
27 |
* Receive one raw byte from TPI |
|
|
28 |
* \return Received byte |
|
|
29 |
*/ |
|
|
30 |
uint8_t tpi_recv_byte(void); |
|
|
31 |
/** |
|
|
32 |
* Read block |
|
|
33 |
* \param addr Address of block |
|
|
34 |
* \param dptr Pointer to dest memory block |
|
|
35 |
* \param len Length of read |
|
|
36 |
*/ |
|
|
37 |
void tpi_read_block(uint16_t addr, uint8_t* dptr, uint8_t len); |
|
|
38 |
/** |
|
|
39 |
* Write block |
|
|
40 |
* \param addr Address to program |
|
|
41 |
* \param sptr Pointer to source block |
|
|
42 |
* \param len Length of write |
|
|
43 |
*/ |
|
|
44 |
void tpi_write_block(uint16_t addr, const uint8_t* sptr, uint8_t len); |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
#endif /*__TPI_H__*/ |