40static int8_t gs_time_zone = 0;          
 
  253    timestamp += (time_t)(gs_time_zone * 3600);
 
  254    timeptr = localtime(×tamp);
 
  255    t.
date = (uint8_t)timeptr->tm_mday;
 
  256    t.
hour = (uint8_t)timeptr->tm_hour;
 
  257    t.
minute = (uint8_t)timeptr->tm_min;
 
  258    t.
month = (uint8_t)timeptr->tm_mon + 1;
 
  259    t.
second = (uint8_t)timeptr->tm_sec;
 
  260    t.
week = (uint8_t)timeptr->tm_wday;
 
  261    t.
year = (uint16_t)(timeptr->tm_year + 1900);
 
 
  323    timeptr.tm_year = t.
year - 1900;
 
  324    timeptr.tm_mon = t.
month - 1;
 
  325    timeptr.tm_wday = t.
week;
 
  326    timeptr.tm_mday = t.
date;
 
  327    timeptr.tm_hour = t.
hour;
 
  328    timeptr.tm_min = t.
minute;
 
  329    timeptr.tm_sec = t.
second;
 
  332    *timestamp = mktime(&timeptr) - gs_time_zone * 3600;
 
 
  346    *zone = gs_time_zone;
 
 
driver pcf8563 timer header file
uint8_t pcf8563_set_week_alarm_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable week alarm
uint8_t pcf8563_set_hour_alarm_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable hour alarm
uint8_t pcf8563_set_timer_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable timer enable
pcf8563_timer_freq_t
pcf8563 timer freq enumeration definition
uint8_t pcf8563_deinit(pcf8563_handle_t *handle)
close the chip
uint8_t pcf8563_set_timer_interrupt(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable timer interrupt
uint8_t pcf8563_set_test_mode(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable test mode
uint8_t pcf8563_set_timer_freq(pcf8563_handle_t *handle, pcf8563_timer_freq_t freq)
set timer freq
uint8_t pcf8563_set_clock_out_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable clock out enable
pcf8563_interrupt_mode_t
pcf8563 interrupt mode enumeration definition
uint8_t pcf8563_init(pcf8563_handle_t *handle)
initialize the chip
uint8_t pcf8563_set_time(pcf8563_handle_t *handle, pcf8563_time_t *t)
set the current time
struct pcf8563_time_s pcf8563_time_t
pcf8563 time structure definition
uint8_t pcf8563_irq_handler(pcf8563_handle_t *handle)
irq handler
uint8_t pcf8563_set_alarm_interrupt(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable alarm interrupt
uint8_t pcf8563_set_day_alarm_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable day alarm
uint8_t pcf8563_set_minute_alarm_enable(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable minute alarm
uint8_t pcf8563_set_rtc_stop(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable rtc stop
struct pcf8563_handle_s pcf8563_handle_t
pcf8563 handle structure definition
uint8_t pcf8563_set_timer_value(pcf8563_handle_t *handle, uint8_t value)
set timer value
uint8_t pcf8563_get_time(pcf8563_handle_t *handle, pcf8563_time_t *t)
get the current time
uint8_t pcf8563_clear_status(pcf8563_handle_t *handle, pcf8563_interrupt_event_t event)
clear status
uint8_t pcf8563_set_power_on_reset(pcf8563_handle_t *handle, pcf8563_bool_t enable)
enable or disable power on reset
@ PCF8563_INTERRUPT_EVENT_TIMER
uint8_t pcf8563_timer_get_ascii_time(char *buf, uint8_t len)
timer example get the ascii time
uint8_t pcf8563_timer_get_time(pcf8563_time_t *t)
timer example get the time
uint8_t pcf8563_timer_set_time(pcf8563_time_t *t)
timer example set the time
uint8_t pcf8563_timer_get_timestamp(time_t *timestamp)
timer example get the time in a unix timestamp
uint8_t pcf8563_timer_enable(pcf8563_timer_freq_t freq, uint8_t value, pcf8563_interrupt_mode_t mode)
timer example enable the timer
uint8_t pcf8563_timer_disable(void)
timer example disable the timer
uint8_t pcf8563_timer_set_timestamp_time_zone(int8_t zone)
timer example set the local time zone
uint8_t pcf8563_timer_deinit(void)
timer example deinit
uint8_t pcf8563_timer_irq_handler(void)
timer example irq
uint8_t pcf8563_timer_set_timestamp(time_t timestamp)
timer example set the time by a unix timestamp
uint8_t pcf8563_timer_get_timestamp_time_zone(int8_t *zone)
timer example get the local time zone
uint8_t pcf8563_timer_init(void(*callback)(uint8_t type))
timer example init
uint8_t pcf8563_interface_iic_init(void)
interface iic bus init
uint8_t pcf8563_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
uint8_t pcf8563_interface_iic_deinit(void)
interface iic bus deinit
void pcf8563_interface_delay_ms(uint32_t ms)
interface delay ms
void pcf8563_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t pcf8563_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
#define DRIVER_PCF8563_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_PCF8563_LINK_INIT(HANDLE, STRUCTURE)
initialize pcf8563_handle_t structure
#define DRIVER_PCF8563_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_PCF8563_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_PCF8563_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function
#define DRIVER_PCF8563_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_PCF8563_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_PCF8563_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function