思澈科技软件开发工具包  2.20

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...
 

Detailed Description

HAL_DBG_exported_constants

Macro Definition Documentation

◆ RTC_BACKUP_FLAGS_ACK

#define RTC_BACKUP_FLAGS_ACK   0x80000

Ack for RTC reset from other CPU core

◆ RTC_BACKUP_FLAGS_RESET

#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

Enumeration Type Documentation

◆ RTC_BACKUP

enum RTC_BACKUP
Enumerator
RTC_BACKUP_BOOTOPT 

Boot option

RTC_BACKUP_LPCYCLE 

RTC start LP Cycles in 48M counts

RTC_BACKUP_INITIALIZED 

RTC Initialized

RTC_BACKUP_LPCYCLE_CUR 

RTC current LP Cycles in 48M counts

RTC_BACKUP_LPCYCLE_AVE 

RTC average LP Cycles in 48M counts

RTC_BAKCUP_OTA_FORCE_MODE 

OTA Failed Mode

RTC_BAKCUP_WDT_STATUS 

WDT status

RTC_BACKUP_BT_TXPWR 

Bluetooth TX Power

RTC_BACKUP_NAND_OTA_DES 

NAND OTA hcput switch

Function Documentation

◆ atoh()

uint32_t atoh ( char *  astr)

Convert a hex string to integer.

Parameters
[in]astrhex string
Return values
integerrepresented by astr.

◆ HAL_DBG_i2c_pins()

void HAL_DBG_i2c_pins ( uint16_t  scl,
uint16_t  sda 
)

Initialize I2C pins for debug printing.

Parameters
[in]sclPin for SCL. (GPIOA0-87, GPIOB0-63)
[in]sdaPin for SDA. (GPIOA0-87, GPIOB0-63)
Return values
None.

◆ HAL_DBG_i2c_print()

void HAL_DBG_i2c_print ( uint8_t *  data,
int  len 
)

Print strings on I2C pins.

Parameters
[in]dataData to print.
[in]lenlength of data in bytes.
Return values
None.

◆ HAL_DBG_i2c_print_byte()

void HAL_DBG_i2c_print_byte ( uint8_t  byte)

Print byte on I2C pins.

Parameters
[in]byteByte to print.
Return values
None.

◆ HAL_DBG_print_data()

void HAL_DBG_print_data ( char *  data,
unsigned int  offset,
int  len 
)

Dump a data in hex, also display ASCII on the right.

Parameters
[in]datadata to dump.
[in]offsetstart offset from data.
[in]lenlength of data to dump.
Return values
None.

◆ HAL_DBG_printf()

void HAL_DBG_printf ( const char *  fmt,
  ... 
)

HAL Debug printf.

Parameters
[in]fmtformat for printf
Return values
None.

◆ HAL_Get_backup()

uint32_t HAL_Get_backup ( uint8_t  idx)

Get the RTC backup register, used to share value between H/L CPU.

Parameters
idxindex of backup register
Return values
valuesaved in the backup register

◆ HAL_LOCK_Read16()

__STATIC_INLINE uint16_t HAL_LOCK_Read16 ( volatile uint16_t *  addr)

16bit lock read, use in pair with HAL_LOCK_Write16

Parameters
[in]addraddress of data to be read
Returns
read value

◆ HAL_LOCK_Read32()

__STATIC_INLINE uint32_t HAL_LOCK_Read32 ( volatile uint32_t *  addr)

32bit lock read, use in pair with HAL_LOCK_Write32

Parameters
[in]addraddress of data to be read
Returns
read value

◆ HAL_LOCK_Read8()

__STATIC_INLINE uint8_t HAL_LOCK_Read8 ( volatile uint8_t *  addr)

8bit lock read, use in pair with HAL_LOCK_Write8

Parameters
[in]addraddress of data to be read
Returns
read value

◆ HAL_LOCK_Write16()

__STATIC_INLINE bool HAL_LOCK_Write16 ( volatile uint16_t *  addr,
uint16_t  value 
)

16bit lock write, follow HAL_LOCK_Read16

Parameters
[in]addraddress of data to be written
[in]valuevalue to be written
Returns
write succeeed or not, true: success, false: fail. If fail, try lock_read and lock_write again

◆ HAL_LOCK_Write32()

__STATIC_INLINE bool HAL_LOCK_Write32 ( volatile uint32_t *  addr,
uint32_t  value 
)

32bit lock write, follow HAL_LOCK_Read32

Parameters
[in]addraddress of data to be written
[in]valuevalue to be written
Returns
write succeeed or not, true: success, false: fail. If fail, try lock_read and lock_write again

◆ HAL_LOCK_Write8()

__STATIC_INLINE bool HAL_LOCK_Write8 ( volatile uint8_t *  addr,
uint8_t  value 
)

8bit lock write, follow HAL_LOCK_Read8

Parameters
[in]addraddress of data to be written
[in]valuevalue to be written
Returns
write succeeed or not, true: success, false: fail. If fail, try lock_read and lock_write again

◆ HAL_Set_backup()

void HAL_Set_backup ( uint8_t  idx,
uint32_t  value 
)

Set the RTC backup register, used to share value between H/L CPU.

Parameters
idxindex of backup register
valuevalue to set into backup register
Return values
None

◆ hex2data()

int hex2data ( char *  hexstr,
uint8_t *  data,
uint8_t  max_len 
)

Convert a hex string to byte array.

Parameters
[in]hexstrhex string
[in,out]databyte array
[in]max_lenmax length of byte array
Return values
lengthof hex data array.

◆ hex2data_revert()

int hex2data_revert ( char *  hexstr,
uint8_t *  data,
uint8_t  max_len 
)

Convert a hex string to byte array in revert sequence.

Parameters
[in]hexstrhex string
[in,out]databyte array
[in]max_lenmax length of byte array
Return values
integerrepresented by astr.