|
LCM — CH32V003 Light Control Module
Light Control Module, I2C slave
|
Go to the source code of this file.
Macros | |
| #define | USER_DATA_OB_HALFWORD_BASE 8U |
| #define | USER_DATA_CR_OPTPG_Set ((uint32_t)0x00000010) |
| #define | USER_DATA_CR_OPTPG_Reset ((uint32_t)0xFFFFFFEF) |
| #define | USER_DATA_CR_OPTER_Set ((uint32_t)0x00000020) |
| #define | USER_DATA_CR_OPTER_Reset ((uint32_t)0xFFFFFFDF) |
| #define | USER_DATA_CR_STRT_Set ((uint32_t)0x00000040) |
| #define | USER_DATA_CR_LOCK_Set ((uint32_t)0x00000080) |
| #define | USER_DATA_FLASH_KEY1 ((uint32_t)0x45670123) |
| #define | USER_DATA_FLASH_KEY2 ((uint32_t)0xCDEF89AB) |
Variables | |
| static uint8_t | s_user_cache [USER_DATA_CAPACITY] |
| static uint8_t | s_dirty |
| #define USER_DATA_CR_LOCK_Set ((uint32_t)0x00000080) |
Definition at line 55 of file user_data.c.
Referenced by UserData_LockFlash().
| #define USER_DATA_CR_OPTER_Reset ((uint32_t)0xFFFFFFDF) |
Definition at line 53 of file user_data.c.
Referenced by UserData_Commit().
| #define USER_DATA_CR_OPTER_Set ((uint32_t)0x00000020) |
Definition at line 52 of file user_data.c.
Referenced by UserData_Commit().
| #define USER_DATA_CR_OPTPG_Reset ((uint32_t)0xFFFFFFEF) |
Definition at line 51 of file user_data.c.
Referenced by UserData_Commit().
| #define USER_DATA_CR_OPTPG_Set ((uint32_t)0x00000010) |
Definition at line 50 of file user_data.c.
Referenced by UserData_Commit().
| #define USER_DATA_CR_STRT_Set ((uint32_t)0x00000040) |
Definition at line 54 of file user_data.c.
Referenced by UserData_Commit().
| #define USER_DATA_FLASH_KEY1 ((uint32_t)0x45670123) |
Definition at line 56 of file user_data.c.
Referenced by UserData_UnlockFlash().
| #define USER_DATA_FLASH_KEY2 ((uint32_t)0xCDEF89AB) |
Definition at line 57 of file user_data.c.
Referenced by UserData_UnlockFlash().
| #define USER_DATA_OB_HALFWORD_BASE 8U |
Definition at line 47 of file user_data.c.
Referenced by UserData_Commit(), and UserData_LoadFromFlash().
| uint8_t * UserData_Buffer | ( | void | ) |
Definition at line 572 of file user_data.c.
References s_user_cache.
|
static |
Definition at line 184 of file user_data.c.
References s_user_cache, and USER_DATA_CAPACITY.
Referenced by UserData_Init().
| uint8_t UserData_Capacity | ( | void | ) |
Definition at line 458 of file user_data.c.
References USER_DATA_CAPACITY.
|
static |
Definition at line 477 of file user_data.c.
References USER_DATA_CAPACITY, USER_DATA_ERR_PARAM, USER_DATA_ERR_RANGE, and USER_DATA_OK.
Referenced by UserData_Fill(), UserData_Read(), and UserData_Write().
| UserData_Status UserData_Commit | ( | void | ) |
Definition at line 355 of file user_data.c.
References s_dirty, s_user_cache, USER_DATA_CAPACITY, USER_DATA_CR_OPTER_Reset, USER_DATA_CR_OPTER_Set, USER_DATA_CR_OPTPG_Reset, USER_DATA_CR_OPTPG_Set, USER_DATA_CR_STRT_Set, USER_DATA_FLASH_BASE, USER_DATA_OB_HALFWORD_BASE, USER_DATA_OFF_EXT_BASE, USER_DATA_OK, UserData_FlashWait(), UserData_LockFlash(), UserData_ProgramHalfwordRaw(), UserData_ProgramUserByte(), and UserData_UnlockFlash().
Referenced by LCM_Module_Poll().
| const uint8_t * UserData_ConstBuffer | ( | void | ) |
Definition at line 577 of file user_data.c.
References s_user_cache.
| UserData_Status UserData_Erase | ( | void | ) |
Definition at line 562 of file user_data.c.
References USER_DATA_CAPACITY, and UserData_Fill().
| UserData_Status UserData_Fill | ( | uint8_t | offset, |
| uint8_t | len, | ||
| uint8_t | value ) |
Definition at line 544 of file user_data.c.
References s_dirty, s_user_cache, USER_DATA_OK, and UserData_CheckRange().
Referenced by UserData_Erase().
|
static |
Definition at line 87 of file user_data.c.
References USER_DATA_ERR_FLASH, and USER_DATA_OK.
Referenced by UserData_Commit(), UserData_ProgramHalfwordRaw(), and UserData_ProgramUserByte().
| UserData_Status UserData_Init | ( | void | ) |
Definition at line 437 of file user_data.c.
References s_dirty, USER_DATA_ERR_BUSY, USER_DATA_OK, UserData_CacheFillErased(), and UserData_LoadFromFlash().
Referenced by main().
| uint8_t UserData_IsDirty | ( | void | ) |
Definition at line 567 of file user_data.c.
References s_dirty.
|
static |
Definition at line 220 of file user_data.c.
References s_user_cache, USER_DATA_CAPACITY, USER_DATA_FLASH_BASE, USER_DATA_OB_HALFWORD_BASE, USER_DATA_OFF_EXT_BASE, USER_DATA_OK, and UserData_VerifyHalfword().
Referenced by UserData_Init().
|
static |
Definition at line 132 of file user_data.c.
References USER_DATA_CR_LOCK_Set.
Referenced by UserData_Commit().
|
static |
Definition at line 291 of file user_data.c.
References UserData_FlashWait().
Referenced by UserData_Commit().
|
static |
Definition at line 315 of file user_data.c.
References UserData_FlashWait().
Referenced by UserData_Commit().
| UserData_Status UserData_Read | ( | uint8_t | offset, |
| uint8_t * | buf, | ||
| uint8_t | len ) |
Definition at line 488 of file user_data.c.
References s_user_cache, USER_DATA_ERR_PARAM, USER_DATA_OK, and UserData_CheckRange().
Referenced by UserData_ReadByte().
| UserData_Status UserData_ReadByte | ( | uint8_t | offset, |
| uint8_t * | value ) |
Definition at line 531 of file user_data.c.
References USER_DATA_ERR_PARAM, and UserData_Read().
Referenced by LCM_LoadConfig().
| UserData_Status UserData_ReadFlashPageRaw | ( | uint8_t * | page | ) |
Definition at line 582 of file user_data.c.
References USER_DATA_ERR_PARAM, USER_DATA_FLASH_BASE, USER_DATA_FLASH_PAGE_SIZE, and USER_DATA_OK.
|
static |
Definition at line 116 of file user_data.c.
References USER_DATA_FLASH_KEY1, and USER_DATA_FLASH_KEY2.
Referenced by UserData_Commit().
|
static |
Definition at line 158 of file user_data.c.
References USER_DATA_ERR_FLASH, and USER_DATA_OK.
Referenced by UserData_LoadFromFlash().
| UserData_Status UserData_Write | ( | uint8_t | offset, |
| const uint8_t * | buf, | ||
| uint8_t | len ) |
Definition at line 509 of file user_data.c.
References s_dirty, s_user_cache, USER_DATA_ERR_PARAM, USER_DATA_OK, and UserData_CheckRange().
Referenced by LCM_Module_Poll(), LCM_NvmWriteConfig(), and UserData_WriteByte().
| UserData_Status UserData_WriteByte | ( | uint8_t | offset, |
| uint8_t | value ) |
Definition at line 539 of file user_data.c.
References UserData_Write().
|
static |
Definition at line 60 of file user_data.c.
Referenced by UserData_Commit(), UserData_Fill(), UserData_Init(), UserData_IsDirty(), and UserData_Write().
|
static |
Definition at line 59 of file user_data.c.
Referenced by UserData_Buffer(), UserData_CacheFillErased(), UserData_Commit(), UserData_ConstBuffer(), UserData_Fill(), UserData_LoadFromFlash(), UserData_Read(), and UserData_Write().