Last Updated on : 2024-11-20 08:51:43download
The board layer contains the Bluetooth abstraction layer and the hardware abstraction layer, namely the SDK from the chip manufacturer as well as the adaptation files for integrating with the Tuya Developer Platform.
This layer includes the bal_beacon_txrx(u32 tx_cnt, u32 rx_cnt)
that is used to receive and transmit the Beacon data.
Function | bal_beacon_txrx |
---|---|
Feature description | Used to receive and transmit the Beacon data. |
Parameter | tx_cnt : the total number of times that the channels 37, 38, and 39 transmit the Beacon data in turn. The value must be multiples of 3. rx_cnt : the total number of times that the channels 37, 38, and 39 receive the Beacon data in turn. The value must be multiples of 3. |
Return value | None |
Note | The Beacon data to be transmitted and received is stored on tx_buf[31] and rx_buf[39] respectively. Make sure to directly use the sample code without any modifications. |
To store anti-replay sequence numbers and encryption keys and provide the timer function, you need to implement a 256-byte nonvolatile random-access memory (NVRAM) driver and a microseconds system tick driver.
Function | hal_storage_256_init |
---|---|
Feature description | Used to initialize a 256-byte NVRAM driver. |
Parameter | None |
Return value | 0 |
Note | Implement this function as required. |
Function | hal_storage_256_read_bytes |
---|---|
Feature description | Used to read data in specified length from an address space. |
Parameter | u16 offset : the address offset. u8* pdata : the data to be read. u8 len : the length of the data to be read. |
Return value | 0 |
Note | Implement this function as required. A dual backup is recommended. |
Function | hal_storage_256_write_bytes |
---|---|
Feature description | Used to write data in specified length to an address space. |
Parameter | u16 offset : the address offset. u8* pdata : the data to be written. u8 len : the length of the data to be written. |
Return value | 0 |
Note | Implement this function as required. A dual backup is recommended. |
Function | hal_clock_get_system_tick |
---|---|
Feature description | Used to get the current tick value. |
Parameter | None |
Return value | The tick value. |
Note | Implement this function as required. |
Function | hal_clock_time_exceed |
---|---|
Feature description | Used to determine whether the result of the current tick minus the old_tick exceeds the specified span_us . If it does, true is returned. |
Parameter | u32 ref: old_tick : the tick value when a timer starts. u32 span_us : the specified timer span. |
Return value | true : 1 false : 0 |
Note | Implement this function as required. |
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback