/** * \brief For Frame type waveform to update all black/white pattern * * \param EPD_type_index The defined EPD size * \param bwdata Black or White color to whole screen * \param work_time The working time */ static inline void same_data_frame (uint8_t EPD_type_index, uint8_t bwdata, uint32_t work_time) { uint16_t i; for (i = 0; i < COG_parameters[EPD_type_index].horizontal_size; i++) { data_line_even[i]=bwdata; data_line_odd[i]=bwdata; } start_EPD_timer(); do { for (i = 0; i < COG_parameters[EPD_type_index].vertical_size; i++) { /* Scan byte shift per data line */ data_line_scan[(i>>2)]=SCAN_TABLE[(i%4)]; /* Sending data */ epd_spi_send (0x0A, (uint8_t *)&COG_Line.uint8, COG_parameters[EPD_type_index].data_line_size); /* Turn on Output Enable */ epd_spi_send_byte (0x02, 0x07); data_line_scan[(i>>2)]=0; } } while (get_current_time_tick()<(work_time)); /* Stop system timer */ stop_EPD_timer(); }
/** * \brief PWM toggling. * * \param ms The interval of PWM toggling (mini seconds) */ void PWM_run(uint16_t ms) { start_EPD_timer(); do { EPD_pwm_high(); __delay_cycles(30); EPD_pwm_low(); __delay_cycles(30); } while (get_current_time_tick() < ms); //wait Delay Time stop_EPD_timer(); }