Files
AT-VFD/PT6302.h
Derisis13 69c4eb43e0 * feature: Resetting the VFD works
* optimisation: made the code leaner
2022-03-02 20:56:23 +01:00

36 lines
1.1 KiB
C

//
// Created by lacko on 02/03/2022.
//
#ifndef _PT6302_H_
#define _PT6302_H_
/* PT6302 timing constants, all in usec */
#define TCW 1 //CLKB pulse width
#define TDOFF 8 //Data processing time
#define DTCSH 16 //time difference between tDOFF and tCSH
#define TPRZ 100 //VDD rise time
#define TWRSTB 1 //RSTB pulse width
#define RSTpin (uint8_t) (1 << PC2)
#define CSBpin (uint8_t) (1 << PB0)
#define CLKBpin (uint8_t) (1 << PB6)
#define DINpin (uint8_t) (1 << PB7)
/* -------------------------------------------------------------
* Initial setup for the VFD controller interface
* Sets up the connected pins and leaves them in inactive state.
* ------------------------------------------------------------- */
void PT6302_startup(void);
/* -------------------------------------------------------------------------------
* Transmits size byte of data through the VFD controller's interface from payload
* Handles CLKB, CSB and timing constraints
* ------------------------------------------------------------------------------- */
void transmit_bytes (const uint8_t* payload, uint8_t size);
#endif //_PT6302_H_