Searched refs:bin2bcd (Results 1 – 11 of 11) sorted by relevance
/Zephyr-latest/drivers/rtc/ |
D | rtc_ds1307.c | 60 regs[0] = bin2bcd(tm->tm_sec) & SECONDS_BITS; in ds1307_set_time() 61 regs[1] = bin2bcd(tm->tm_min); in ds1307_set_time() 62 regs[2] = bin2bcd(tm->tm_hour); in ds1307_set_time() 63 regs[3] = bin2bcd(tm->tm_wday); in ds1307_set_time() 64 regs[4] = bin2bcd(tm->tm_mday); in ds1307_set_time() 65 regs[5] = bin2bcd(tm->tm_mon); in ds1307_set_time() 66 regs[6] = bin2bcd((tm->tm_year % 100)); in ds1307_set_time()
|
D | rtc_pcf8563.c | 118 raw_time[0] = bin2bcd(timeptr->tm_sec); in pcf8563_set_time() 121 raw_time[1] = bin2bcd(timeptr->tm_min); in pcf8563_set_time() 124 raw_time[2] = bin2bcd(timeptr->tm_hour); in pcf8563_set_time() 127 raw_time[3] = bin2bcd(timeptr->tm_mday); in pcf8563_set_time() 133 raw_time[5] = bin2bcd(timeptr->tm_mon); in pcf8563_set_time() 136 raw_time[6] = bin2bcd(timeptr->tm_year); in pcf8563_set_time() 248 regs[0] = bin2bcd(timeptr->tm_min) & PCF8563_MINUTES_MASK; in pcf8563_alarm_set_time() 255 regs[1] = bin2bcd(timeptr->tm_hour) & PCF8563_HOURS_MASK; in pcf8563_alarm_set_time() 261 regs[2] = bin2bcd(timeptr->tm_mday) & PCF8563_DAYS_MASK; in pcf8563_alarm_set_time() 267 regs[3] = bin2bcd(timeptr->tm_wday) & PCF8563_WEEKDAYS_MASK; in pcf8563_alarm_set_time()
|
D | rtc_am1805.c | 138 regs[0] = bin2bcd(tm->tm_sec) & SECONDS_BITS; in am1805_set_time() 139 regs[1] = bin2bcd(tm->tm_min) & MINUTES_BITS; in am1805_set_time() 140 regs[2] = bin2bcd(tm->tm_hour) & HOURS_BITS; in am1805_set_time() 141 regs[3] = bin2bcd(tm->tm_mday) & DATE_BITS; in am1805_set_time() 142 regs[4] = bin2bcd(tm->tm_mon) & MONTHS_BITS; in am1805_set_time() 143 regs[5] = bin2bcd(tm->tm_year) & YEAR_BITS; in am1805_set_time() 144 regs[6] = bin2bcd(tm->tm_wday) & WEEKDAY_BITS; in am1805_set_time() 408 regs[0] = bin2bcd(timeptr->tm_sec) & SECONDS_BITS; in am1805_alarm_set_time() 409 regs[1] = bin2bcd(timeptr->tm_min) & MINUTES_BITS; in am1805_alarm_set_time() 410 regs[2] = bin2bcd(timeptr->tm_hour) & HOURS_BITS; in am1805_alarm_set_time() [all …]
|
D | rtc_sam.c | 71 timr = RTC_TIMR_SEC(bin2bcd(timeptr->tm_sec)); in rtc_sam_timr_from_tm() 72 timr |= RTC_TIMR_MIN(bin2bcd(timeptr->tm_min)); in rtc_sam_timr_from_tm() 73 timr |= RTC_TIMR_HOUR(bin2bcd(timeptr->tm_hour)); in rtc_sam_timr_from_tm() 84 calr = RTC_CALR_DATE(bin2bcd(timeptr->tm_mday)); in rtc_sam_calr_from_tm() 85 calr |= RTC_CALR_MONTH(bin2bcd(timeptr->tm_mon + 1)); in rtc_sam_calr_from_tm() 88 calr |= RTC_CALR_CENT(bin2bcd(centuries)); in rtc_sam_calr_from_tm() 89 calr |= RTC_CALR_YEAR(bin2bcd(years)); in rtc_sam_calr_from_tm() 90 calr |= RTC_CALR_DAY(bin2bcd(timeptr->tm_wday + 1)); in rtc_sam_calr_from_tm() 234 timalr |= RTC_TIMALR_SEC(bin2bcd(timeptr->tm_sec)); in rtc_atmel_timalr_from_tm() 239 timalr |= RTC_TIMALR_MIN(bin2bcd(timeptr->tm_min)); in rtc_atmel_timalr_from_tm() [all …]
|
D | rtc_smartbond.c | 159 RTC_TIME_REG_SET_FIELD(S, rtc_time_reg, bin2bcd(timeptr->tm_sec)); /*[0, 59]*/ in rtc_time_to_bcd() 160 RTC_TIME_REG_SET_FIELD(M, rtc_time_reg, bin2bcd(timeptr->tm_min)); /*[0, 59]*/ in rtc_time_to_bcd() 161 RTC_TIME_REG_SET_FIELD(HR, rtc_time_reg, bin2bcd(timeptr->tm_hour)); /*[0, 23]*/ in rtc_time_to_bcd() 170 RTC_CALENDAR_REG_SET_FIELD(D, rtc_calendar_reg, bin2bcd(timeptr->tm_mday)); /*[1, 31]*/ in rtc_calendar_to_bcd() 172 bin2bcd((timeptr->tm_year + TM_YEAR_REF) % 100)); /*[year - 1900]*/ in rtc_calendar_to_bcd() 174 bin2bcd((timeptr->tm_year + TM_YEAR_REF) / 100)); in rtc_calendar_to_bcd() 175 RTC_CALENDAR_REG_SET_FIELD(M, rtc_calendar_reg, bin2bcd(timeptr->tm_mon + 1)); /*[0, 11]*/ in rtc_calendar_to_bcd() 299 bin2bcd(timeptr->tm_mday)); in alarm_calendar_to_bcd() 304 bin2bcd(timeptr->tm_mon + 1)); in alarm_calendar_to_bcd() 320 RTC_TIME_ALARM_REG_SET_FIELD(S, rtc_time_alarm_reg, bin2bcd(timeptr->tm_sec)); in alarm_time_to_bcd() [all …]
|
D | rtc_rv8263.c | 218 regs[1] = bin2bcd(timeptr->tm_sec) & SECONDS_BITS; in rv8263c8_time_set() 219 regs[2] = bin2bcd(timeptr->tm_min) & MINUTES_BITS; in rv8263c8_time_set() 220 regs[3] = bin2bcd(timeptr->tm_hour) & HOURS_BITS; in rv8263c8_time_set() 221 regs[4] = bin2bcd(timeptr->tm_mday) & DATE_BITS; in rv8263c8_time_set() 222 regs[5] = bin2bcd(timeptr->tm_wday) & WEEKDAY_BITS; in rv8263c8_time_set() 223 regs[6] = (bin2bcd(timeptr->tm_mon) & MONTHS_BITS) + 1; in rv8263c8_time_set() 224 regs[7] = bin2bcd(timeptr->tm_year - RV8263_YEAR_OFFSET) & YEAR_BITS; in rv8263c8_time_set() 425 regs[1] = bin2bcd(timeptr->tm_sec) & SECONDS_BITS; in rv8263c8_alarm_set_time() 431 regs[2] = bin2bcd(timeptr->tm_min) & MINUTES_BITS; in rv8263c8_alarm_set_time() 437 regs[3] = bin2bcd(timeptr->tm_hour) & HOURS_BITS; in rv8263c8_alarm_set_time() [all …]
|
D | rtc_pcf8523.c | 369 regs[0] = bin2bcd(timeptr->tm_sec) & PCF8523_SECONDS_MASK; in pcf8523_set_time() 370 regs[1] = bin2bcd(timeptr->tm_min) & PCF8523_MINUTES_MASK; in pcf8523_set_time() 371 regs[2] = bin2bcd(timeptr->tm_hour) & PCF8523_HOURS_24H_MASK; in pcf8523_set_time() 372 regs[3] = bin2bcd(timeptr->tm_mday) & PCF8523_DAYS_MASK; in pcf8523_set_time() 373 regs[4] = bin2bcd(timeptr->tm_wday) & PCF8523_WEEKDAYS_MASK; in pcf8523_set_time() 374 regs[5] = bin2bcd(timeptr->tm_mon + PCF8523_MONTHS_OFFSET) & PCF8523_MONTHS_MASK; in pcf8523_set_time() 375 regs[6] = bin2bcd(timeptr->tm_year - PCF8523_YEARS_OFFSET) & PCF8523_YEARS_MASK; in pcf8523_set_time() 466 regs[0] = bin2bcd(timeptr->tm_min) & PCF8523_MINUTE_ALARM_MASK; in pcf8523_alarm_set_time() 472 regs[1] = bin2bcd(timeptr->tm_hour) & PCF8523_HOUR_ALARM_24H_MASK; in pcf8523_alarm_set_time() 478 regs[2] = bin2bcd(timeptr->tm_mday) & PCF8523_DAY_ALARM_MASK; in pcf8523_alarm_set_time() [all …]
|
D | rtc_ll_stm32.c | 432 rtc_time.Hours = bin2bcd(timeptr->tm_hour); in rtc_stm32_set_time() 433 rtc_time.Minutes = bin2bcd(timeptr->tm_min); in rtc_stm32_set_time() 434 rtc_time.Seconds = bin2bcd(timeptr->tm_sec); in rtc_stm32_set_time() 438 rtc_date.Year = bin2bcd((real_year - RTC_YEAR_REF)); in rtc_stm32_set_time() 439 rtc_date.Month = bin2bcd((timeptr->tm_mon + 1)); in rtc_stm32_set_time() 440 rtc_date.Day = bin2bcd(timeptr->tm_mday); in rtc_stm32_set_time() 583 p_rtc_alrm_time->Seconds = bin2bcd(timeptr->tm_sec); in rtc_stm32_init_ll_alrm_struct() 588 p_rtc_alrm_time->Minutes = bin2bcd(timeptr->tm_min); in rtc_stm32_init_ll_alrm_struct() 593 p_rtc_alrm_time->Hours = bin2bcd(timeptr->tm_hour); in rtc_stm32_init_ll_alrm_struct() 606 p_rtc_alarm->AlarmDateWeekDay = bin2bcd(timeptr->tm_wday); in rtc_stm32_init_ll_alrm_struct() [all …]
|
D | rtc_rv3028.c | 478 date[0] = bin2bcd(timeptr->tm_sec) & RV3028_SECONDS_MASK; in rv3028_set_time() 479 date[1] = bin2bcd(timeptr->tm_min) & RV3028_MINUTES_MASK; in rv3028_set_time() 480 date[2] = bin2bcd(timeptr->tm_hour) & RV3028_HOURS_24H_MASK; in rv3028_set_time() 482 date[4] = bin2bcd(timeptr->tm_mday) & RV3028_DATE_MASK; in rv3028_set_time() 483 date[5] = bin2bcd(timeptr->tm_mon + RV3028_MONTH_OFFSET) & RV3028_MONTH_MASK; in rv3028_set_time() 484 date[6] = bin2bcd(timeptr->tm_year - RV3028_YEAR_OFFSET) & RV3028_YEAR_MASK; in rv3028_set_time() 581 regs[0] = bin2bcd(timeptr->tm_min) & RV3028_ALARM_MINUTES_MASK; in rv3028_alarm_set_time() 587 regs[1] = bin2bcd(timeptr->tm_hour) & RV3028_ALARM_HOURS_24H_MASK; in rv3028_alarm_set_time() 593 regs[2] = bin2bcd(timeptr->tm_mday) & RV3028_ALARM_DATE_MASK; in rv3028_alarm_set_time()
|
/Zephyr-latest/drivers/counter/ |
D | maxim_ds3231.c | 395 val = bin2bcd(tm.tm_sec); in encode_alarm() 403 val = bin2bcd(tm.tm_min); in encode_alarm() 410 val = bin2bcd(tm.tm_hour); in encode_alarm() 419 val = bin2bcd(tm.tm_mday); in encode_alarm() 891 val = bin2bcd(tm.tm_sec); in sync_finish_write() 894 val = bin2bcd(tm.tm_min); in sync_finish_write() 897 val = bin2bcd(tm.tm_hour); in sync_finish_write() 902 val = bin2bcd(tm.tm_mday); in sync_finish_write() 906 val = bin2bcd(tm.tm_mon); in sync_finish_write() 913 val = bin2bcd(tm.tm_year); in sync_finish_write()
|
/Zephyr-latest/include/zephyr/sys/ |
D | util.h | 597 static inline uint8_t bin2bcd(uint8_t bin) in bin2bcd() function
|