![]() |
CI130X SDK API手册
2.2.0
本手册用于描述CI130X SDK各个组件和驱动API
|
#include "flash_update.h"
#include "ci130x_timer.h"
#include "ci130x_spiflash.h"
#include "ci130x_uart.h"
#include "ci130x_scu.h"
#include "ci_log.h"
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "sdk_default_config.h"
结构体 | |
struct | recv_buffer_struct |
宏定义 | |
#define | RECIEVE_BUFFER_COUNT 3 |
#define | MSG_HEAD_S 0xa5 |
#define | MSG_HEAD_E 0x0f |
#define | MSG_HEAD 0x0FA5 |
#define | MSG_TAIL 0xFF |
#define | SRAM_START_ADDR 0x1FFB0000 |
#define | MAX_SRAM_CODE_SIZE (1024*(480-32)) |
#define | TCM_START_ADDR ICACHE_TCM_S |
#define | TCM_SIZE (ICACHE_TCM_E - ICACHE_TCM_S + 1) |
#define | UPDATE_ERASE_64K (64 * 1024) |
#define | UPDATE_ERASE_4K (4 * 1024) |
#define | UPDATE_DEAL_PER_PACKET (4096) |
#define | MAX_DATA_RECEIVE_PER_PACKET (UPDATE_DEAL_PER_PACKET+4)/*because buffer address is fixed,so now don't big than 8k*/ |
#define | CHAR_BUF_TO_INT_LITTILE(buf) ((buf)[0]|((buf)[1]<<8)|((buf)[2]<<16)|((buf)[3]<<24)) |
类型定义 | |
typedef struct recv_buffer_struct | recv_buffer_t |
枚举 | |
enum | uart_receive_state_t { STATE_HEAD0 = 0x00, STATE_HEAD1 = 0x01, STAT_LENGTH0 = 0x02, STAT_LENGTH1 = 0x03, STATE_TYPE = 0x04, STATE_CMD = 0x05, STATE_NUMBER = 0x06, STATE_DATA = 0x07, STATE_CRC0 = 0x08, STATE_CRC1 = 0x09, STATE_TAIL = 0x0a } |
变量 | |
uint32_t | success_flag = 0 |
uint32_t | write_block_addr = 0 |
uint32_t | write_block_size = 0 |
uint32_t | offset = 0 |
static uint16_t | write_block_crc = 0 |
static uint16_t | write_block_crc0 = 0 |
Data_p | Send_Box = NULL |
Data_t | send_message |
recv_buffer_t | rcv_buffer [3] |
recv_buffer_t * | p_recv_buffer = NULL |
recv_buffer_t * | full_buffer_chain = NULL |
recv_buffer_t * | idle_buffer_chain = NULL |
FileConfig_Struct | FileConfigInfo |
uint8_t | UpdateState |
static uint8_t * | send_data_buf |
static uint8_t * | read_buf_for_crc |
static uint8_t | rev_state = STATE_HEAD0 |
static uint16_t | length0 = 0 |
static uint16_t | length1 = 0 |
static uint16_t | crc0 = 0 |
static uint16_t | crc1 = 0 |
static uint16_t | data_rev_count |
static const uint16_t | crc16tab_ccitt [256] |
struct recv_buffer_struct |
成员变量 | ||
---|---|---|
uint8_t * | data_buffer | |
Data_t | message | |
struct recv_buffer_struct * | next |
#define CHAR_BUF_TO_INT_LITTILE | ( | buf | ) | ((buf)[0]|((buf)[1]<<8)|((buf)[2]<<16)|((buf)[3]<<24)) |
#define MAX_DATA_RECEIVE_PER_PACKET (UPDATE_DEAL_PER_PACKET+4)/*because buffer address is fixed,so now don't big than 8k*/ |
#define MAX_SRAM_CODE_SIZE (1024*(480-32)) |
#define MSG_HEAD 0x0FA5 |
#define MSG_HEAD_E 0x0f |
#define MSG_HEAD_S 0xa5 |
#define MSG_TAIL 0xFF |
#define RECIEVE_BUFFER_COUNT 3 |
#define SRAM_START_ADDR 0x1FFB0000 |
#define TCM_SIZE (ICACHE_TCM_E - ICACHE_TCM_S + 1) |
#define TCM_START_ADDR ICACHE_TCM_S |
#define UPDATE_DEAL_PER_PACKET (4096) |
#define UPDATE_ERASE_4K (4 * 1024) |
#define UPDATE_ERASE_64K (64 * 1024) |
typedef struct recv_buffer_struct recv_buffer_t |
void append_buffer | ( | recv_buffer_t ** | queue, |
recv_buffer_t * | p_buffer | ||
) |
uint16_t crc_func | ( | uint16_t | crc, |
uint8_t * | buf, | ||
uint32_t | len | ||
) |
|
static |
int32_t flash_update_buf_init | ( | void | ) |
recv_buffer_t* get_buffer | ( | recv_buffer_t ** | queue | ) |
int32_t get_update_state | ( | void | ) |
int32_t have_a_new_message | ( | void | ) |
void make_packet | ( | uint8_t | type, |
uint8_t | cmd, | ||
uint8_t | number, | ||
uint8_t * | data, | ||
uint16_t | data_length | ||
) |
void receive_func | ( | uint8_t | receive_char | ) |
void Resolution_func | ( | ) |
void send_ack_get_info_packet | ( | void | ) |
void send_ack_system_reset | ( | void | ) |
void send_ack_try_fast_bd_packet | ( | void | ) |
void send_ack_try_fast_bd_test_packet | ( | uint32_t | size | ) |
void send_ack_update_block_info_packet | ( | void | ) |
void send_ack_update_check_ready_packet | ( | void | ) |
void send_ack_update_complet_packet | ( | void | ) |
void send_ack_update_era_packet | ( | void | ) |
void send_ack_update_read_packet | ( | uint32_t | StartAddr, |
uint32_t | Size | ||
) |
void send_ack_update_verify_packet | ( | uint8_t | verify | ) |
void send_func | ( | void | ) |
void send_notify_progress_packet | ( | int | index, |
int | current, | ||
int | total | ||
) |
void send_req_update_block_write_done_packet | ( | void | ) |
void send_req_update_req_packet | ( | void | ) |
void send_req_update_write_packet | ( | uint32_t | offset, |
uint32_t | size | ||
) |
void send_req_update_write_packet_ex | ( | uint32_t | index, |
uint32_t | offset, | ||
uint32_t | size | ||
) |
void set_update_complete_status | ( | void | ) |
|
static |
|
static |
|
static |
|
static |
FileConfig_Struct FileConfigInfo |
recv_buffer_t* full_buffer_chain = NULL |
recv_buffer_t* idle_buffer_chain = NULL |
|
static |
|
static |
uint32_t offset = 0 |
recv_buffer_t* p_recv_buffer = NULL |
recv_buffer_t rcv_buffer[3] |
|
static |
|
static |
|
static |
Data_t send_message |
uint32_t success_flag = 0 |
uint8_t UpdateState |
uint32_t write_block_addr = 0 |
|
static |
|
static |
uint32_t write_block_size = 0 |