mirror of
https://github.com/logicog/RTLPlayground.git
synced 2026-08-30 14:52:51 +08:00
Add read_reg_timer function
This commit is contained in:
@@ -105,5 +105,6 @@ void tcpip_output(void);
|
|||||||
void print_string_x(__xdata char *p);
|
void print_string_x(__xdata char *p);
|
||||||
uint8_t read_flash(uint8_t bank, __code uint8_t *addr);
|
uint8_t read_flash(uint8_t bank, __code uint8_t *addr);
|
||||||
void get_random_32(void);
|
void get_random_32(void);
|
||||||
|
void read_reg_timer(uint32_t * tmr);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -602,6 +602,20 @@ void cpy_4(__xdata uint8_t dest[], __xdata uint8_t source[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void read_reg_timer(uint32_t * tmr)
|
||||||
|
{
|
||||||
|
uint8_t * val = (uint8_t *)tmr;
|
||||||
|
SFR_REG_ADDR_U16 = RTL837X_REG_SEC_COUNTER;
|
||||||
|
SFR_EXEC_GO = SFR_EXEC_READ_REG;
|
||||||
|
do {
|
||||||
|
} while (SFR_EXEC_STATUS != 0);
|
||||||
|
*val++ = SFR_DATA_0;
|
||||||
|
*val++ = SFR_DATA_8;
|
||||||
|
*val++ = SFR_DATA_16;
|
||||||
|
*val = SFR_DATA_24;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void sds_config_mac(uint8_t sds, uint8_t mode)
|
void sds_config_mac(uint8_t sds, uint8_t mode)
|
||||||
{
|
{
|
||||||
reg_read_m(RTL837X_REG_SDS_MODES);
|
reg_read_m(RTL837X_REG_SDS_MODES);
|
||||||
|
|||||||
Reference in New Issue
Block a user