Macros | |
#define | RTC_BACKUP_FLAGS_RESET 1 |
General Purpose backup registers in RTC, used to share value among H/L CPU. More... | |
#define | RTC_BACKUP_FLAGS_ACK 0x80000 |
Enumerations | |
enum | RTC_BACKUP { RTC_BACKUP_BOOTOPT = 0, RTC_BACKUP_LPCYCLE = 1, RTC_BACKUP_INITIALIZED = 2, RTC_BACKUP_LPCYCLE_CUR = 3, RTC_BACKUP_LPCYCLE_AVE = 4, RTC_BAKCUP_OTA_FORCE_MODE = 5, RTC_BAKCUP_WDT_STATUS = 6, RTC_BACKUP_BT_TXPWR = 7, RTC_BACKUP_NAND_OTA_DES = 8 } |
Functions | |
void | HAL_DBG_printf (const char *fmt,...) |
HAL Debug printf. More... | |
void | HAL_DBG_print_data (char *data, unsigned int offset, int len) |
Dump a data in hex, also display ASCII on the right. More... | |
void | HAL_DBG_i2c_pins (uint16_t scl, uint16_t sda) |
Initialize I2C pins for debug printing. More... | |
void | HAL_DBG_i2c_print_byte (uint8_t byte) |
Print byte on I2C pins. More... | |
void | HAL_DBG_i2c_print (uint8_t *data, int len) |
Print strings on I2C pins. More... | |
__STATIC_INLINE uint32_t | HAL_LOCK_Read32 (volatile uint32_t *addr) |
32bit lock read, use in pair with HAL_LOCK_Write32 More... | |
__STATIC_INLINE bool | HAL_LOCK_Write32 (volatile uint32_t *addr, uint32_t value) |
32bit lock write, follow HAL_LOCK_Read32 More... | |
__STATIC_INLINE uint16_t | HAL_LOCK_Read16 (volatile uint16_t *addr) |
16bit lock read, use in pair with HAL_LOCK_Write16 More... | |
__STATIC_INLINE bool | HAL_LOCK_Write16 (volatile uint16_t *addr, uint16_t value) |
16bit lock write, follow HAL_LOCK_Read16 More... | |
__STATIC_INLINE uint8_t | HAL_LOCK_Read8 (volatile uint8_t *addr) |
8bit lock read, use in pair with HAL_LOCK_Write8 More... | |
__STATIC_INLINE bool | HAL_LOCK_Write8 (volatile uint8_t *addr, uint8_t value) |
8bit lock write, follow HAL_LOCK_Read8 More... | |
void | HAL_Set_backup (uint8_t idx, uint32_t value) |
Set the RTC backup register, used to share value between H/L CPU. More... | |
uint32_t | HAL_Get_backup (uint8_t idx) |
Get the RTC backup register, used to share value between H/L CPU. More... | |
uint32_t | atoh (char *astr) |
Convert a hex string to integer. More... | |
int | hex2data (char *hexstr, uint8_t *data, uint8_t max_len) |
Convert a hex string to byte array. More... | |
int | hex2data_revert (char *hexstr, uint8_t *data, uint8_t max_len) |
Convert a hex string to byte array in revert sequence. More... | |
HAL_DBG_exported_constants
#define RTC_BACKUP_FLAGS_ACK 0x80000 |
Ack for RTC reset from other CPU core
#define RTC_BACKUP_FLAGS_RESET 1 |
General Purpose backup registers in RTC, used to share value among H/L CPU.
Inform other CPU core that RTC is reset
enum RTC_BACKUP |
uint32_t atoh | ( | char * | astr | ) |
Convert a hex string to integer.
[in] | astr | hex string |
integer | represented by astr. |
void HAL_DBG_i2c_pins | ( | uint16_t | scl, |
uint16_t | sda | ||
) |
Initialize I2C pins for debug printing.
[in] | scl | Pin for SCL. (GPIOA0-87, GPIOB0-63) |
[in] | sda | Pin for SDA. (GPIOA0-87, GPIOB0-63) |
None. |
void HAL_DBG_i2c_print | ( | uint8_t * | data, |
int | len | ||
) |
Print strings on I2C pins.
[in] | data | Data to print. |
[in] | len | length of data in bytes. |
None. |
void HAL_DBG_i2c_print_byte | ( | uint8_t | byte | ) |
Print byte on I2C pins.
[in] | byte | Byte to print. |
None. |
void HAL_DBG_print_data | ( | char * | data, |
unsigned int | offset, | ||
int | len | ||
) |
Dump a data in hex, also display ASCII on the right.
[in] | data | data to dump. |
[in] | offset | start offset from data. |
[in] | len | length of data to dump. |
None. |
void HAL_DBG_printf | ( | const char * | fmt, |
... | |||
) |
HAL Debug printf.
[in] | fmt | format for printf |
None. |
uint32_t HAL_Get_backup | ( | uint8_t | idx | ) |
Get the RTC backup register, used to share value between H/L CPU.
idx | index of backup register |
value | saved in the backup register |
__STATIC_INLINE uint16_t HAL_LOCK_Read16 | ( | volatile uint16_t * | addr | ) |
16bit lock read, use in pair with HAL_LOCK_Write16
[in] | addr | address of data to be read |
__STATIC_INLINE uint32_t HAL_LOCK_Read32 | ( | volatile uint32_t * | addr | ) |
32bit lock read, use in pair with HAL_LOCK_Write32
[in] | addr | address of data to be read |
__STATIC_INLINE uint8_t HAL_LOCK_Read8 | ( | volatile uint8_t * | addr | ) |
8bit lock read, use in pair with HAL_LOCK_Write8
[in] | addr | address of data to be read |
__STATIC_INLINE bool HAL_LOCK_Write16 | ( | volatile uint16_t * | addr, |
uint16_t | value | ||
) |
16bit lock write, follow HAL_LOCK_Read16
[in] | addr | address of data to be written |
[in] | value | value to be written |
__STATIC_INLINE bool HAL_LOCK_Write32 | ( | volatile uint32_t * | addr, |
uint32_t | value | ||
) |
32bit lock write, follow HAL_LOCK_Read32
[in] | addr | address of data to be written |
[in] | value | value to be written |
__STATIC_INLINE bool HAL_LOCK_Write8 | ( | volatile uint8_t * | addr, |
uint8_t | value | ||
) |
8bit lock write, follow HAL_LOCK_Read8
[in] | addr | address of data to be written |
[in] | value | value to be written |
void HAL_Set_backup | ( | uint8_t | idx, |
uint32_t | value | ||
) |
Set the RTC backup register, used to share value between H/L CPU.
idx | index of backup register |
value | value to set into backup register |
None |
int hex2data | ( | char * | hexstr, |
uint8_t * | data, | ||
uint8_t | max_len | ||
) |
Convert a hex string to byte array.
[in] | hexstr | hex string |
[in,out] | data | byte array |
[in] | max_len | max length of byte array |
length | of hex data array. |
int hex2data_revert | ( | char * | hexstr, |
uint8_t * | data, | ||
uint8_t | max_len | ||
) |
Convert a hex string to byte array in revert sequence.
[in] | hexstr | hex string |
[in,out] | data | byte array |
[in] | max_len | max length of byte array |
integer | represented by astr. |