12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- // ktiva.h :
- //
- #if !defined(AGD_KTIVA_H__4F0F73D0_4834_4018_9B16_27F1B78686DB__INCLUDED_)
- #define AGD_KTIVA_H__4F0F73D0_4834_4018_9B16_27F1B78686DB__INCLUDED_
- #include "defines.h"
- #include "kspi.h"
- #ifdef __cplusplus
- extern "C" {
- #endif // __cplusplus
- /////////////////////////////////////////////////////////////////////////////
- // ktiva.h - Declarations:
- #define CMD_ACK 0xCC
- #define CMD_NAK 0x33
- #define COMMAND_PING 0x20
- #define COMMAND_DOWNLOAD 0x21
- #define COMMAND_RUN 0x22
- #define COMMAND_GET_STATUS 0x23
- #define COMMAND_SEND_DATA 0x24
- #define COMMAND_RESET 0x25
- #define COMMAND_IO_TRANSFER 0x50
- #define COMMAND_GET_HWSW_REV 0x51
- #define COMMAND_GET_TIVA_TYPE 0x52
- #define COMMAND_START_BOOTLOADER 0x53
- #define COMMAND_GET_MCP7940 0x54
- #define COMMAND_SET_MCP7940 0x55
- #define COMMAND_GET_I2C 0x56
- #define COMMAND_PUT_I2C 0x57
- #define COMMAND_GET_ADDR 0x58
- #define COMMAND_SET_ADDR 0x59
- #define COMMAND_GET_ADC 0x5A
- #define COMMAND_SET_BACKLIGHT 0x5B
- #define COMMAND_GET_UPTIME 0x5C
- //#define COMMAND_GET_MATERIAL_SERIAL_ID 0x5D
- #define COMMAND_RET_SUCCESS 0x40
- #define COMMAND_RET_UNKNOWN_CMD 0x41
- #define COMMAND_RET_INVALID_CMD 0x42
- #define COMMAND_RET_INVALID_ADR 0x43
- #define COMMAND_RET_FLASH_FAIL 0x44
- #define COMMAND_RET_CRC_FAIL 0x45
- #define KTIVA_MAX_BUFFER_SIZE 256
- #define KTIVA_MAX_WAIT_LOOPS 100
- #define KTIVA_UPTIME_ADDRESS 0x200003C0
- /////////////////////////////////////////////////////////////////////////////
- int ktiva_wait_ack (struct file *pf);
- int ktiva_send_frame(struct file *pf, unsigned char cmd, const void *pData, size_t nCbData);
- int ktiva_recv_frame(struct file *pf, unsigned char cmd, void *pData, size_t nCbData);
- /////////////////////////////////////////////////////////////////////////////
- int TivaCmdPing (struct file *pf);
- int TivaCmdGetFirmwareVersion (struct file *pf, int *Hw, int *Sw);
- int TivaCmdGetADC (struct file *pf, LPTIVA_ADC padc);
- int TivaCmdGetUptime (struct file *pf, unsigned long long *put);
- int TivaCmdGetAddress (struct file *pf, unsigned int addr, unsigned int *val);
- int TivaCmdGetStatus (struct file *pf, unsigned char *stat);
- int TivaCmdGetBootloaderStatus (struct file *pf, unsigned char *stat);
- int TivaCmdStartBootloader (struct file *pf);
- int TivaCmdStartDownload (struct file *pf, unsigned int addr, size_t size);
- int TivaCmdSendDataBlock (struct file *pf, const void *pBlock, size_t nCbBlock);
- int TivaCmdReset (struct file *pf);
- int TivaRevive (struct file *pf);
- /////////////////////////////////////////////////////////////////////////////
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- #endif // !defined(AGD_KTIVA_H__4F0F73D0_4834_4018_9B16_27F1B78686DB__INCLUDED_)
|