diff --git a/PT6302.c b/PT6302.c index dde8710..a728120 100644 --- a/PT6302.c +++ b/PT6302.c @@ -28,10 +28,8 @@ inline void PT6302_startup (void) DDRC |= RSTpin; PORTB |= (CSBpin | CLKBpin); PORTB &= ~DINpin; - PORTC &= ~RSTpin; - _delay_us (TPRZ); PORTC |= RSTpin; - _delay_us (TWRSTB); + PT6302_reset(); } inline void transmit_bit(const uint8_t data) @@ -161,3 +159,10 @@ void all_off (void) const uint8_t command = 0x71; transmit_byte (command); } +void PT6302_reset (void) +{ + PORTC &= ~RSTpin; + _delay_us (TPRZ); + PORTC |= RSTpin; + _delay_us (TWRSTB); +} diff --git a/PT6302.h b/PT6302.h index 2021291..71a1fb0 100644 --- a/PT6302.h +++ b/PT6302.h @@ -48,6 +48,12 @@ enum RAM_types{ * ------------------------------------------------------------- */ void PT6302_startup (void); +/* ---------------------------------------------- + * Resets the VFD controller trough its reset pin + * Handles reset delays + * ---------------------------------------------- */ +inline void PT6302_reset(void); + /* -------------------------------- * Transmits the LSB of data * Handles communication except CSB