| 数据搜索系统,热门电子元器件搜索 |
|
AN2841 数据表(PDF) 21 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
AN2841 数据表(HTML) 21 Page - STMicroelectronics |
|
21 / 31 page ![]() AN2841 Dimming application using an STM32 microcontroller 21/31 Example of reduced lookup table generation void performGenerateReducedLookUpTable(unsigned char *LEDmapIN, int LEDcount, int PWMdepth, unsigned char **tableIN, unsigned char **tableKeyIN, int *table_size){ int streamSize = LEDcount/8; *table_size = differentValuesCount(LEDmapIN, LEDcount); *tableKeyIN = SortAndReduce(LEDmapIN, LEDcount, *table_size); *tableIN = malloc(streamSize * (*table_size) * sizeof(unsigned char)); for(tmpdepth = 0; tmpdepth < (*table_size); tmpdepth++){ for(DATAchar = 0; DATAchar < streamSize; DATAchar++){ for(outputBIT = 0; outputBIT < 8; outputBIT++){ (*tableIN)[tmpdepth*streamSize + DATAchar] <<= 1; if(LEDmapIN[(DATAchar*8) + outputBIT] > (*tableKeyIN)[tmpdepth]) (*tableIN)[tmpdepth*streamSize + DATAchar] |= 0x01; else (*tableIN)[tmpdepth*streamSize + DATAchar] &= 0xFE; } } } } . Table 3. LEDmap - requested LED brightness configuration Outputs LED 1 LED 2 LED 3 … … LED i Duty cycle (brightness) 2 / 2n 6 / 2n 4 / 2n 100% |
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |