16. Low Battery Detector and Microcontroller Clock Divider Command¶
Sets the low-battery detector threshold and microcontroller clock-output frequency.
Register Fields¶
Bits |
Name |
Meaning |
API |
|---|---|---|---|
7:5 |
|
Clock-output frequency |
|
4 |
Fixed |
Must be |
None |
3:0 |
|
Low-battery threshold |
The setters listed in the register field table above directly configure
fields in the Low Battery Detector and Microcontroller Clock Divider
Command. The setters and reset function update staged configuration without
communicating with the radio. Use rfm12_apply_to_radio() to write
the staged settings.
The detector and clock output are enabled separately through
rfm12_set_low_battery_detector_enable() and
rfm12_set_clock_output_enable() in the Power Management Command.
The hardware eb bit enables the detector, while dc disables the
clock output; the clock-output enable API handles this inverted polarity.
Command Functions¶
rfm12_set_clock_output_frequency()¶
-
RFM12_result_t rfm12_set_clock_output_frequency(RFM12_t *dev, RFM12_clock_output_frequency_t frequency)¶
Stage the microcontroller clock-output frequency.
Selection
d2:d0Clock-output frequency
RFM12_CLOCK_OUTPUT_1MHZ0001 MHz
RFM12_CLOCK_OUTPUT_1_25MHZ0011.25 MHz
RFM12_CLOCK_OUTPUT_1_66MHZ0101.66 MHz
RFM12_CLOCK_OUTPUT_2MHZ0112 MHz
RFM12_CLOCK_OUTPUT_2_5MHZ1002.5 MHz
RFM12_CLOCK_OUTPUT_3_33MHZ1013.33 MHz
RFM12_CLOCK_OUTPUT_5MHZ1105 MHz
RFM12_CLOCK_OUTPUT_10MHZ11110 MHz
This selects the clock division ratio. The CLK output-buffer drive current is configured separately by
rfm12_set_pll_output_buffer_current().- Parameters:
dev – RFM12 radio instance.
frequency – Predefined clock-output frequency selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_set_low_battery_threshold()¶
-
RFM12_result_t rfm12_set_low_battery_threshold(RFM12_t *dev, RFM12_low_battery_threshold_t threshold)¶
Stage the low-battery detector threshold voltage.
Select a predefined threshold from
RFM12_LOW_BATTERY_THRESHOLD_2_25VthroughRFM12_LOW_BATTERY_THRESHOLD_3_75Vin 0.10 V increments. Pass the enum constant rather than a numeric voltage.The threshold is
V_LB = 2.25 V + V * 0.10 V, whereVis the four-bitv3:v0field. This setter does not enable the detector; userfm12_set_low_battery_detector_enable()for that setting.- Parameters:
dev – RFM12 radio instance.
threshold – Predefined low-battery threshold selection.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.
rfm12_reset_low_battery_clock()¶
-
RFM12_result_t rfm12_reset_low_battery_clock(RFM12_t *dev)¶
Reset the staged low-battery threshold and clock-divider settings to their defaults.
This function does not communicate with the radio. The changed settings are written to the radio by
rfm12_apply_to_radio().- Parameters:
dev – RFM12 radio instance.
- Returns:
RFM12_OKon success, or an appropriateRFM12_result_terror.