TMPM4G9  V1.0.0.0
fc.c File Reference
#include <string.h>
#include "fc.h"
#include "txz_sample_def.h"

Macros

#define FC_KCR_KEYCODE   (0xA74A9D23UL)
 
#define FC_BRANK_VALUE   (uint32_t)(0xFFFFFFFFUL)
 
#define FC_MAX_PAGES   (uint8_t)(0x20)
 
#define FC_MAX_BLOCKS   (uint8_t)(0x16)
 
#define FC_MAX_AREAS   (uint8_t)(0x1)
 
#define FC_CMD_ADDRESS_MASK   (uint32_t)(0xFFFF0000UL)
 
#define FC_CMD_BC1_ADDR   (0x00000550UL)
 
#define FC_CMD_BC2_ADDR   (0x00000AA0UL)
 
#define FC_BANK_USER_INFO   (0x00000007UL)
 
#define FC_BANK_CODE_FLASH   (0x00000000UL)
 
#define FC_BUFFER_DISABLE   (0x00000007UL)
 
#define FC_BUFFER_ENABLE   (0x00000000UL)
 
#define FC_AREASEL_EXPECT_AREA0   (uint32_t)(0x00000000UL)
 
#define FC_AREASEL_EXPECT_AREA4   (uint32_t)(0x00000000UL)
 
#define FC_AREASEL_AREA0   (uint32_t)(0x00000007UL)
 
#define FC_AREASEL_AREA4   (uint32_t)(0x00070000UL)
 
#define FC_AREASEL_MASK_AREA0   (uint32_t)(0xFF8F0FF8UL)
 
#define FC_AREASEL_MASK_AREA4   (uint32_t)(0xFF880FFFUL)
 
#define FC_AREASEL_WRITE_MODE   (uint32_t)(0x04000000UL)
 
#define FC_AREASEL4_WRITE_MODE   (uint32_t)(0x40000000UL)
 

Functions

__STATIC_INLINE TXZ_Result fc_enable_areasel (void)
 Enables the AREA0. More...
 
__STATIC_INLINE TXZ_Result fc_disable_areasel (void)
 Disables the AREA0. More...
 
TXZ_Result fc_verify_check (uint32_t *src_address, uint32_t *dst_address, uint32_t size)
 Verifies data of the Flash ROM. More...
 
TXZ_WorkState fc_get_status (fc_sr0_t status)
 Get the status of the flash auto operation. More...
 
TXZ_Result fc_write_code_flash (uint32_t *src_address, uint32_t *dst_address, uint32_t size)
 Auto write command of the code flash ROM. More...
 
TXZ_Result fc_erase_page_code_flash (fc_code_flash_page_number_t first_page, uint8_t num_of_pages)
 Auro page erase command of the code flash ROM. More...
 
TXZ_Result fc_blank_check_page_code_flash (fc_code_flash_page_number_t first_page, fc_code_flash_page_number_t last_page)
 Checks a blank of the code Flash ROM of specified pages. More...
 
TXZ_Result fc_write_user_information_area (uint32_t *src_address, uint32_t size)
 Auto write command of the user information area. More...
 
TXZ_Result fc_erase_user_information_area (void)
 Auro page erase command of the user information area. More...
 
void fc_read_user_information_area (uint32_t *dst_address, uint32_t size)
 Raed of the user information area. More...