Functions

CPU management (cpu)
[nRF24LU1+ HAL]

Functions

void cpu_pwr_down (void)
void cpu_set_clock_frequency (uint8_t cf)

Function Documentation

void cpu_pwr_down ( void   )

Function to set the CPU in power down mode

Returns:
This function does not return until the CPU wakens

Definition at line 22 of file cpu.c.

{
  PWRDWN = 1;
}
void cpu_set_clock_frequency ( uint8_t  cf )

Function to set the clock frequency of the chip cf is the value of the CLKCTL register but only bits 4-6 are used in this function.

Parameters:
cfThe clock frequency

< The value of bit 6

< The value of bit 5

< The value of bit 4

< The value of bit 6

< The value of bit 5

< The value of bit 4

Definition at line 27 of file cpu.c.

{
  uint8_t temp = CLKCTL;

  // Clock frequnecy is defined by bits 6-4 in CLKCTL
  temp &= ~(BIT_6 | BIT_5 | BIT_4);
  temp |= cf & (BIT_6 | BIT_5 | BIT_4);
  
  F0 = EA;
  EA = 0;
  CLKCTL = temp;
  EA = F0;
}