Struct dcf77::SimpleDCF77Decoder
[−]
[src]
pub struct SimpleDCF77Decoder { /* fields omitted */ }
A structure for a simple timeslot based DCF77 decoder
Methods
impl SimpleDCF77Decoder
[src]
The SimpleDCF77Decoder implements a simple state machine to decode a DCF77 signal from a fed-in
readout of a GPIO pin connected to a DCF77 receiver. To use this, create the structure, set up
the GPIO pin the receiver is connected to as an input and call the read_bit
method every
10ms with a parameter value of true
for a high signal level or false
for a low signal level
pub fn new() -> Self
[src]
Create a new decoder state machine
pub fn raw_data(&self) -> u64
[src]
Return the raw data as u64
value for decoding of the current date/time
pub fn bit_complete(&self) -> bool
[src]
Returns true as soon as an individual bit was received
pub fn bit_faulty(&self) -> bool
[src]
Returns true if the last bit couldn't be identified as high/low
pub fn end_of_cycle(&self) -> bool
[src]
Returns true if the end of a 59s cycle was detected
pub fn latest_bit(&self) -> bool
[src]
Returns the value of the latest received bit. Mainly useful for live display of the received bits
pub fn seconds(&self) -> usize
[src]
Return the current position of the bit counter after the latest recognized end of a cycle which is identical to the current second of the minute
pub fn read_bit(&mut self, bit: bool)
[src]
Ingest the latest sample of the GPIO input the DCF77 receiver is connected to judge the / current position and value of the DCF77 signal bitstream