Librairie adaptée au laboratoire 2
Dependencies: ST_INTERFACES X_NUCLEO_COMMON
Fork of X_NUCLEO_6180XA1 by
Revision 34:5bcffb4c5b47, committed 2015-11-17
- Comitter:
- licio.mapelli@st.com
- Date:
- Tue Nov 17 17:38:38 2015 +0100
- Parent:
- 33:1573db91352c
- Child:
- 35:407b0b127eb8
- Commit message:
- Added DisplayDigit function to Display class
Changed in this revision
Components/Display/Display_class.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/Components/Display/Display_class.h Tue Nov 17 17:15:47 2015 +0100 +++ b/Components/Display/Display_class.h Tue Nov 17 17:38:38 2015 +0100 @@ -405,6 +405,17 @@ } + void DisplayDigit (char *val, char dgt) + { + uint8_t data[2]; + uint16_t *pdata = (uint16_t*)data; + + stmpe1600.read16bitReg(GPSR_0_7, pdata); + *pdata = *pdata | (uint16_t)0x0780; // all digits off + stmpe1600.write16bitReg(GPSR_0_7, pdata); + _V2_Set7Segment( ascii_to_display_lut[(uint8_t)*val], dgt); + } + void _V2_Set7Segment( int Leds, int digit ) { //Digits_off();