in the nRF24LU1
Functions | |
void | cklf_regxc_write (uint8_t addr, uint16_t val) |
uint16_t | cklf_regxc_read (uint8_t addr) |
void | cklf_rtc_disable (void) |
void | cklf_rtc_init (uint8_t cnt_h, uint16_t cnt_l) |
uint16_t | cklf_rtc_read_lsw (void) |
uint8_t | cklf_rtc_read_msb (void) |
void | cklf_rtc_wait (void) |
void | cklf_wdog_init (uint16_t cnt) |
void | cklf_wdog_feed (void) |
void | cklf_gpio_wakeup (uint16_t wcon1, uint16_t wcon0) |
void cklf_regxc_write | ( | uint8_t | addr, |
uint16_t | val | ||
) |
uint16_t cklf_regxc_read | ( | uint8_t | addr ) |
void cklf_rtc_disable | ( | void | ) |
Function to disable the RTC. This function should be called before reading values from the RTC counter.
Definition at line 41 of file cklf.c.
{ cklf_regxc_write(WRTCDIS, 0); }
void cklf_rtc_init | ( | uint8_t | cnt_h, |
uint16_t | cnt_l | ||
) |
Function to initialize the RTC.
cnt_h | The upper 8 bits of the 24 bit value to load into the RTC latch |
cnt_l | The lower 16 bits of the 24 bit value to load into the RTC latch |
Definition at line 46 of file cklf.c.
{ cklf_regxc_write(WRTCDIS, 0); // Disable RTC timer before updating latch WUF = 0; // Clear any pending interrupts cklf_regxc_write(WGTIMER, (uint16_t)cnt_h); // Program MS part first cklf_regxc_write(WRTCLAT, cnt_l); // Write LS part and enable RTC }
uint16_t cklf_rtc_read_lsw | ( | void | ) |
Function to read the lower 16 bits of the RTC counter. To ensure consistency between the return value of this function and cklf_rtc_read_msb the RTC should be disabled before calling these functions.
Definition at line 54 of file cklf.c.
{ return cklf_regxc_read(RRTC); }
uint8_t cklf_rtc_read_msb | ( | void | ) |
Function to read the upper 8 bits of the RTC counter. To ensure consistency between the return value of this function and cklf_rtc_read_lsw the RTC should be disabled before calling these functions.
Definition at line 59 of file cklf.c.
{ return (uint8_t)(cklf_regxc_read(RGTIMER) >> 8); }
void cklf_rtc_wait | ( | void | ) |
void cklf_wdog_init | ( | uint16_t | cnt ) |
Function to initialize and enable the watchdog.
cnt | The value to load into the watchdog counter. |
Definition at line 71 of file cklf.c.
{ wd_cnt = cnt; cklf_regxc_write(WWD, wd_cnt); }
void cklf_wdog_feed | ( | void | ) |
Function to reload the watchdog. This function reloads the watchdog counter with the parameter given in the hal_wdog_init function.
Definition at line 77 of file cklf.c.
{ cklf_regxc_write(WWD, wd_cnt); }
void cklf_gpio_wakeup | ( | uint16_t | wcon1, |
uint16_t | wcon0 | ||
) |
Function to program the GPIO wakeup functionality
wcon0 | Value of WCON0 register (P00 - P03) |
wcon1 | Value of WCON1 register (P04 - P07) |
Definition at line 82 of file cklf.c.
{ cklf_regxc_write(WWCON1, wcon1); cklf_regxc_write(WWCON0, wcon0); }