From e4d6884bca6ca422115765dab60039bd6296ccab Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 20 Mar 2014 23:31:10 +1000 Subject: Cause the gaudio/gadc driver (currently broken) to include the GADC framework if it is included in the make. --- drivers/gaudio/gadc/driver.mk | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/gaudio/gadc/driver.mk b/drivers/gaudio/gadc/driver.mk index 4d79da25..8e943577 100644 --- a/drivers/gaudio/gadc/driver.mk +++ b/drivers/gaudio/gadc/driver.mk @@ -3,3 +3,7 @@ GFXSRC += $(GFXLIB)/drivers/gaudio/gadc/gaudio_record_lld.c # Required include directories GFXINC += $(GFXLIB)/drivers/gaudio/gadc + +# Make sure the GADC sub-system is turned on +GFXDEFS += -DGFX_USE_GADC=TRUE + -- cgit v1.2.3 From 8b9d31ef902b80c27065ab542c4783d6194f420f Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 20 Mar 2014 23:33:32 +1000 Subject: Move queued buffer code from gaudio into gqueue --- drivers/gaudio/Win32/gaudio_play_lld.c | 4 ++-- drivers/gaudio/Win32/gaudio_record_lld.c | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/gaudio/Win32/gaudio_play_lld.c b/drivers/gaudio/Win32/gaudio_play_lld.c index 6b4f2dab..35a1fc99 100644 --- a/drivers/gaudio/Win32/gaudio_play_lld.c +++ b/drivers/gaudio/Win32/gaudio_play_lld.c @@ -47,7 +47,7 @@ static DWORD threadID; *************************************************************************/ static bool_t senddata(WAVEHDR *pwh) { - GAudioData *paud; + GDataBuffer *paud; // Get the next data block to send gfxSystemLock(); @@ -94,7 +94,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { // Give the buffer back to the Audio Free List gfxSystemLock(); - gaudioPlayReleaseDataBlockI((GAudioData *)pwh->dwUser); + gaudioPlayReleaseDataBlockI((GDataBuffer *)pwh->dwUser); gfxSystemUnlock(); pwh->lpData = 0; nQueuedBuffers--; diff --git a/drivers/gaudio/Win32/gaudio_record_lld.c b/drivers/gaudio/Win32/gaudio_record_lld.c index 259707e3..9f63ff2f 100644 --- a/drivers/gaudio/Win32/gaudio_record_lld.c +++ b/drivers/gaudio/Win32/gaudio_record_lld.c @@ -47,7 +47,7 @@ static DWORD threadID; *************************************************************************/ static bool_t getbuffer(WAVEHDR *pwh) { - GAudioData *paud; + GDataBuffer *paud; // Get the next data block to send gfxSystemLock(); @@ -81,7 +81,7 @@ static bool_t getbuffer(WAVEHDR *pwh) { static DWORD WINAPI waveProc(LPVOID arg) { MSG msg; WAVEHDR *pwh; - GAudioData *paud; + GDataBuffer *paud; (void) arg; while (GetMessage(&msg, 0, 0, 0)) { @@ -93,7 +93,7 @@ static DWORD WINAPI waveProc(LPVOID arg) { waveInUnprepareHeader(ah, pwh, sizeof(WAVEHDR)); // Save the buffer in the audio record list - paud = (GAudioData *)pwh->dwUser; + paud = (GDataBuffer *)pwh->dwUser; paud->len = pwh->dwBytesRecorded; gfxSystemLock(); gaudioRecordSaveDataBlockI(paud); -- cgit v1.2.3 From 712ff73f77763eeee798d6913f57e5577adcef3f Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 20 Mar 2014 23:34:37 +1000 Subject: Some fixes for the Nokia6610GE8 display driver --- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 36 ++++++++++++++++++++-- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 0e2c7e4e..9a32cf18 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -136,7 +136,8 @@ #define write_cmd3(g, cmd, d1, d2, d3) { write_index(g, cmd); write_data3(g, d1, d2, d3); } #define write_cmd4(g, cmd, d1, d2, d3, d4) { write_index(g, cmd); write_data4(g, d1, d2, d3, d4); } -static inline void set_viewport(GDisplay* g) { +#if GDISP_HARDWARE_DRAWPIXEL + static inline void set_viewpoint(GDisplay* g) { #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL switch(g->g.Orientation) { default: @@ -157,6 +158,35 @@ static inline void set_viewport(GDisplay* g) { write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); break; } + #else + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + #endif + write_index(g, RAMWR); + } +#endif + +static inline void set_viewport(GDisplay* g) { + #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set + break; + case GDISP_ROTATE_90: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y+g->p.cy-1); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); + break; + case GDISP_ROTATE_180: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Width-g->p.x-g->p.cx, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); + break; + case GDISP_ROTATE_270: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->g.Height-g->p.y-g->p.cy, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x+g->p.cx-1); + break; + } #else write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x+g->p.cx-1); // Column address set write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y+g->p.cy-1); // Page address set @@ -292,8 +322,8 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { c = gdispColor2Native(g->p.color); acquire_bus(g); - set_viewport(g); - write_data3(g, 0, (c>>8) & 0x0F, c & 0xFF); + set_viewpoint(g); + write_data3(g, 0, ((c>>8) & 0x0F), (c & 0xFF)); release_bus(g); } #endif -- cgit v1.2.3 From 271f0c743f31d3ae21ede35909e1f14845c6d338 Mon Sep 17 00:00:00 2001 From: inmarket Date: Thu, 20 Mar 2014 23:41:27 +1000 Subject: Updates to GADC to use new simpler gfx queued bufferring. NOTE: code is still buggy (or the one and only driver is buggy). --- drivers/gadc/AT91SAM7/gadc_lld.c | 72 +++++++++++++++------- drivers/gadc/AT91SAM7/gadc_lld_config.h | 7 +-- drivers/gaudio/gadc/gaudio_record_board_template.h | 8 ++- drivers/gaudio/gadc/gaudio_record_config.h | 18 ++---- drivers/gaudio/gadc/gaudio_record_lld.c | 34 +++++----- 5 files changed, 82 insertions(+), 57 deletions(-) (limited to 'drivers') diff --git a/drivers/gadc/AT91SAM7/gadc_lld.c b/drivers/gadc/AT91SAM7/gadc_lld.c index f18f2717..52b06539 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld.c +++ b/drivers/gadc/AT91SAM7/gadc_lld.c @@ -8,10 +8,6 @@ /** * @file drivers/gadc/AT91SAM7/gadc_lld.c * @brief GADC - Periodic ADC driver source file for the AT91SAM7 cpu. - * - * @defgroup Driver Driver - * @ingroup GADC - * @{ */ #include "gfx.h" @@ -20,44 +16,76 @@ #include "src/gadc/driver.h" +static GDataBuffer *pData; +static size_t bytesperconversion; + +static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); +static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err); + + static ADCConversionGroup acg = { FALSE, // circular 1, // num_channels - GADC_ISR_CompleteI, // end_cb - GADC_ISR_ErrorI, // error_cb + ISR_CompleteI, // end_cb + ISR_ErrorI, // error_cb 0, // channelselects 0, // trigger 0, // frequency }; +static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n) { + (void) adcp; + (void) buffer; + + if (pData) { + // A set of timer base conversions is complete + pData->len += n * bytesperconversion; + + // Are we finished yet? + // In ChibiOS we (may) get a half-buffer complete. In this situation the conversions + // are really not complete and so we just wait for the next lot of data. + if (pData->len + bytesperconversion > pData->size) + gadcDataReadyI(); + + } else { + // A single non-timer conversion is complete + gadcDataReadyI(); + } +} + +static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err) { + (void) adcp; + (void) err; + + gadcDataFailI(); +} + void gadc_lld_init(void) { adcStart(&ADCD1, 0); } -size_t gadc_lld_samples_per_conversion(uint32_t physdev) { - size_t cnt; - int i; +void gadc_lld_start_timer(GadcLldTimerData *pgtd) { + int phys; + /* Calculate the bytes per conversion from physdev */ /* The AT91SAM7 has AD0..7 - physdev is a bitmap of those channels */ - for(cnt = 0, i = 0; i < 8; i++, physdev >>= 1) - if (physdev & 0x01) - cnt++; - return cnt; -} + phys = pgtd->physdev; + for(bytesperconversion = 0; phys; phys >>= 1) + if (phys & 0x01) + bytesperconversion++; + bytesperconversion *= (gfxSampleFormatBits(GADC_SAMPLE_FORMAT)+7)/8; -void gadc_lld_start_timer(uint32_t physdev, uint32_t frequency) { - (void) physdev; /** * The AT91SAM7 ADC driver supports triggering the ADC using a timer without having to implement * an interrupt handler for the timer. The driver also initialises the timer correctly for us. * Because we aren't trapping the interrupt ourselves we can't increment GADC_Timer_Missed if an * interrupt is missed. */ - acg.frequency = frequency; + acg.frequency = pgtd->frequency; } -void gadc_lld_stop_timer(uint32_t physdev) { - (void) physdev; +void gadc_lld_stop_timer(GadcLldTimerData *pgtd) { + (void) pgtd; if ((acg.trigger & ~ADC_TRIGGER_SOFTWARE) == ADC_TRIGGER_TIMER) adcStop(&ADCD1); } @@ -69,7 +97,8 @@ void gadc_lld_adc_timerI(GadcLldTimerData *pgtd) { acg.channelselects = pgtd->physdev; acg.trigger = pgtd->now ? (ADC_TRIGGER_TIMER|ADC_TRIGGER_SOFTWARE) : ADC_TRIGGER_TIMER; - adcStartConversionI(&ADCD1, &acg, pgtd->buffer, pgtd->count); + pData = pgtd->pdata; + adcStartConversionI(&ADCD1, &acg, (adcsample_t *)(pgtd->pdata+1), pData->size/bytesperconversion); /* Next time assume the same (still running) timer */ acg.frequency = 0; @@ -81,8 +110,9 @@ void gadc_lld_adc_nontimerI(GadcLldNonTimerData *pgntd) { */ acg.channelselects = pgntd->physdev; acg.trigger = ADC_TRIGGER_SOFTWARE; + + pData = 0; adcStartConversionI(&ADCD1, &acg, pgntd->buffer, 1); } #endif /* GFX_USE_GADC */ -/** @} */ diff --git a/drivers/gadc/AT91SAM7/gadc_lld_config.h b/drivers/gadc/AT91SAM7/gadc_lld_config.h index ba6cbda2..de5af3d3 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld_config.h +++ b/drivers/gadc/AT91SAM7/gadc_lld_config.h @@ -35,18 +35,13 @@ * @note For the AT91SAM7 ADC driver, it post-dates the finding of the bug so we safely * say that the bug doesn't exist for this driver. */ -#define ADC_ISR_FULL_CODE_BUG FALSE +#define CHIBIOS_ADC_ISR_FULL_CODE_BUG FALSE /** * @brief The maximum sample frequency supported by this CPU */ #define GADC_MAX_SAMPLE_FREQUENCY 132000 -/** - * @brief The number of bits in a sample - */ -#define GADC_BITS_PER_SAMPLE AT91_ADC1_RESOLUTION - /** * @brief The sample format */ diff --git a/drivers/gaudio/gadc/gaudio_record_board_template.h b/drivers/gaudio/gadc/gaudio_record_board_template.h index 26e87d88..59168be1 100644 --- a/drivers/gaudio/gadc/gaudio_record_board_template.h +++ b/drivers/gaudio/gadc/gaudio_record_board_template.h @@ -26,6 +26,12 @@ */ #define GAUDIO_RECORD_NUM_CHANNELS 1 +/** + * @brief Whether each channel is mono or stereo + * @note This is an example + */ +#define GAUDIO_RECORD_CHANNEL0_IS_STEREO FALSE + /** * @brief The list of audio channels and their uses * @note This is an example @@ -40,7 +46,7 @@ * @{ */ #ifdef GAUDIO_RECORD_LLD_IMPLEMENTATION - static uint32_t gaudin_lld_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { + static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { GADC_PHYSDEV_MICROPHONE, }; #endif diff --git a/drivers/gaudio/gadc/gaudio_record_config.h b/drivers/gaudio/gadc/gaudio_record_config.h index 22d8750f..88092a63 100644 --- a/drivers/gaudio/gadc/gaudio_record_config.h +++ b/drivers/gaudio/gadc/gaudio_record_config.h @@ -22,29 +22,21 @@ /* Driver hardware support. */ /*===========================================================================*/ -/** - * @brief The audio record sample type - * @details For this driver it matches the cpu sample type - */ -typedef adcsample_t audio_record_sample_t; - /** * @brief The maximum sample frequency supported by this audio device * @details For this driver it matches the GADC maximum high speed sample rate */ -#define GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY GADC_MAX_HIGH_SPEED_SAMPLERATE +#define GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY GADC_MAX_HIGH_SPEED_SAMPLERATE /** - * @brief The number of bits in a sample - * @details For this driver it matches the cpu sample bits + * @brief The number of audio formats supported by this driver */ -#define GAUDIO_RECORD_BITS_PER_SAMPLE GADC_BITS_PER_SAMPLE +#define GAUDIO_RECORD_NUM_FORMATS 1 /** - * @brief The format of an audio sample - * @details For this driver it matches the cpu sample format + * @brief The available audio sample formats in order of preference */ -#define GAUDIO_RECORD_SAMPLE_FORMAT GADC_SAMPLE_FORMAT +#define GAUDIO_RECORD_FORMAT1 GADC_SAMPLE_FORMAT /** * For the GAUDIO driver that uses GADC - all the remaining config definitions are specific diff --git a/drivers/gaudio/gadc/gaudio_record_lld.c b/drivers/gaudio/gadc/gaudio_record_lld.c index ee994dc1..6f4cb2de 100644 --- a/drivers/gaudio/gadc/gaudio_record_lld.c +++ b/drivers/gaudio/gadc/gaudio_record_lld.c @@ -8,10 +8,6 @@ /** * @file drivers/gaudio/gadc/gaudio_record_lld.c * @brief GAUDIO - Record Driver file for using the cpu ADC (via GADC). - * - * @addtogroup GAUDIO - * - * @{ */ /** @@ -19,8 +15,6 @@ * from the board definitions. */ #define GAUDIO_RECORD_IMPLEMENTATION - - #include "gfx.h" #if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD @@ -33,30 +27,38 @@ /* Include the driver defines */ #include "src/gaudio/driver_record.h" +static void gadcCallbackI(void) { + GDataBuffer *pd; + + pd = gadcHighSpeedGetDataI(); + if (pd) + gaudioRecordSaveDataBlockI(pd); +} + /*===========================================================================*/ /* External declarations. */ /*===========================================================================*/ -void gaudin_lld_init(const gaudin_params *paud) { +bool_t gaudio_record_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + /* Check the parameters */ + if (channel >= GAUDIO_RECORD_NUM_CHANNELS || frequency > GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY || format != GAUDIO_RECORD_FORMAT1) + return FALSE; + /* Setup the high speed GADC */ - gadcHighSpeedInit(gaudin_lld_physdevs[paud->channel], paud->frequency, paud->buffer, paud->bufcount, paud->samplesPerEvent); + gadcHighSpeedInit(gaudio_gadc_physdevs[channel], frequency); /* Register ourselves for ISR callbacks */ - gadcHighSpeedSetISRCallback(GAUDIN_ISR_CompleteI); + gadcHighSpeedSetISRCallback(gadcCallbackI); - /** - * The gadc driver handles any errors for us by restarting the transaction so there is - * no need for us to setup anything for GAUDIN_ISR_ErrorI() - */ + return TRUE; } -void gaudin_lld_start(void) { +void gaudio_record_lld_start(void) { gadcHighSpeedStart(); } -void gaudin_lld_stop(void) { +void gaudio_record_lld_stop(void) { gadcHighSpeedStop(); } #endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ -/** @} */ -- cgit v1.2.3 From 34818d21e8d6289e05165a02a4a23e3410a1e502 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 22 Mar 2014 11:06:52 +1000 Subject: Whitespaces --- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'drivers') diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index 9a32cf18..c02b1ec8 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -138,27 +138,27 @@ #if GDISP_HARDWARE_DRAWPIXEL static inline void set_viewpoint(GDisplay* g) { - #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL - switch(g->g.Orientation) { - default: - case GDISP_ROTATE_0: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set - break; - case GDISP_ROTATE_90: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); - break; - case GDISP_ROTATE_180: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); - break; - case GDISP_ROTATE_270: - write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); - write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); - break; - } - #else + #if GDISP_NOKIA_ORIENTATION && GDISP_NEED_CONTROL + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set + break; + case GDISP_ROTATE_90: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.y, GDISP_RAM_X_OFFSET+g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_Y_OFFSET-1+g->g.Width-g->p.x); + break; + case GDISP_ROTATE_180: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x, GDISP_RAM_X_OFFSET-1+g->g.Width-g->p.x); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_Y_OFFSET-1+g->g.Height-g->p.y); + break; + case GDISP_ROTATE_270: + write_cmd2(g, CASET, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y, GDISP_RAM_X_OFFSET-1+g->g.Height-g->p.y); + write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.x, GDISP_RAM_Y_OFFSET+g->p.x); + break; + } + #else write_cmd2(g, CASET, GDISP_RAM_X_OFFSET+g->p.x, GDISP_RAM_X_OFFSET+g->p.x); // Column address set write_cmd2(g, PASET, GDISP_RAM_Y_OFFSET+g->p.y, GDISP_RAM_Y_OFFSET+g->p.y); // Page address set #endif -- cgit v1.2.3 From 863e5a6b2dc7ea46f64f474084a9f2e42f1c3f7b Mon Sep 17 00:00:00 2001 From: inmarket Date: Sat, 22 Mar 2014 11:12:27 +1000 Subject: Fix 90 and 270 rotations in ILI9320 driver (Thanks jkjk) --- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index ab0cc0ce..8dd5f586 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -330,7 +330,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { case GDISP_ROTATE_90: acquire_bus(g); - write_reg(g, 0x01, 0x0100); + write_reg(g, 0x01, 0x0000); write_reg(g, 0x03, 0x1030); write_reg(g, 0x60, 0x2700); release_bus(g); @@ -352,7 +352,7 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { case GDISP_ROTATE_270: acquire_bus(g); - write_reg(g, 0x01, 0x0000); + write_reg(g, 0x01, 0x0100); write_reg(g, 0x03, 0x1038); write_reg(g, 0x60, 0xA700); release_bus(g); -- cgit v1.2.3 From c354639f7b8ab1c33866b3d57a243de95a75decc Mon Sep 17 00:00:00 2001 From: inmarket Date: Mon, 24 Mar 2014 10:08:15 +1000 Subject: Update GADC --- drivers/gadc/AT91SAM7/gadc_lld.c | 88 +++++++++++++--------------------------- 1 file changed, 29 insertions(+), 59 deletions(-) (limited to 'drivers') diff --git a/drivers/gadc/AT91SAM7/gadc_lld.c b/drivers/gadc/AT91SAM7/gadc_lld.c index 52b06539..b01fdd6c 100644 --- a/drivers/gadc/AT91SAM7/gadc_lld.c +++ b/drivers/gadc/AT91SAM7/gadc_lld.c @@ -16,13 +16,12 @@ #include "src/gadc/driver.h" -static GDataBuffer *pData; -static size_t bytesperconversion; +static uint32_t nextfreq; +// Forward references to ISR routines static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n); static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err); - static ADCConversionGroup acg = { FALSE, // circular 1, // num_channels @@ -37,82 +36,53 @@ static void ISR_CompleteI(ADCDriver *adcp, adcsample_t *buffer, size_t n) { (void) adcp; (void) buffer; - if (pData) { - // A set of timer base conversions is complete - pData->len += n * bytesperconversion; - - // Are we finished yet? - // In ChibiOS we (may) get a half-buffer complete. In this situation the conversions - // are really not complete and so we just wait for the next lot of data. - if (pData->len + bytesperconversion > pData->size) - gadcDataReadyI(); - - } else { - // A single non-timer conversion is complete - gadcDataReadyI(); - } + gadcGotDataI(n); } static void ISR_ErrorI(ADCDriver *adcp, adcerror_t err) { (void) adcp; (void) err; - gadcDataFailI(); + gadcGotDataI(0); } void gadc_lld_init(void) { adcStart(&ADCD1, 0); } -void gadc_lld_start_timer(GadcLldTimerData *pgtd) { - int phys; - - /* Calculate the bytes per conversion from physdev */ - /* The AT91SAM7 has AD0..7 - physdev is a bitmap of those channels */ - phys = pgtd->physdev; - for(bytesperconversion = 0; phys; phys >>= 1) - if (phys & 0x01) - bytesperconversion++; - bytesperconversion *= (gfxSampleFormatBits(GADC_SAMPLE_FORMAT)+7)/8; - - /** - * The AT91SAM7 ADC driver supports triggering the ADC using a timer without having to implement - * an interrupt handler for the timer. The driver also initialises the timer correctly for us. - * Because we aren't trapping the interrupt ourselves we can't increment GADC_Timer_Missed if an - * interrupt is missed. - */ - acg.frequency = pgtd->frequency; -} +size_t gadc_lld_samplesperconversion(uint32_t physdev) { + size_t samples; -void gadc_lld_stop_timer(GadcLldTimerData *pgtd) { - (void) pgtd; - if ((acg.trigger & ~ADC_TRIGGER_SOFTWARE) == ADC_TRIGGER_TIMER) - adcStop(&ADCD1); + for(samples = 0; physdev; physdev >>= 1) + if (physdev & 0x01) + samples++; + return samples; } -void gadc_lld_adc_timerI(GadcLldTimerData *pgtd) { - /** - * We don't need to calculate num_channels because the AT91SAM7 ADC does this for us. - */ - acg.channelselects = pgtd->physdev; - acg.trigger = pgtd->now ? (ADC_TRIGGER_TIMER|ADC_TRIGGER_SOFTWARE) : ADC_TRIGGER_TIMER; +void gadc_lld_start_timerI(uint32_t frequency) { + // Nothing to do here - the AT91SAM7 adc driver uses an internal timer + // which is set up when the job is started. We save this here just to + // indicate the timer should be re-initialised on the next timer job + nextfreq = frequency; +} - pData = pgtd->pdata; - adcStartConversionI(&ADCD1, &acg, (adcsample_t *)(pgtd->pdata+1), pData->size/bytesperconversion); +void gadc_lld_stop_timerI(void) { + // Nothing to do here. The AT91SAM7 adc driver automatically turns off timer interrupts + // on completion of the job +} - /* Next time assume the same (still running) timer */ - acg.frequency = 0; +void gadc_lld_timerjobI(GadcTimerJob *pj) { + acg.channelselects = pj->physdev; + acg.trigger = ADC_TRIGGER_TIMER; + acg.frequency = nextfreq; + nextfreq = 0; // Next job use the same timer + adcStartConversionI(&ADCD1, &acg, pj->buffer, pj->todo); } -void gadc_lld_adc_nontimerI(GadcLldNonTimerData *pgntd) { - /** - * We don't need to calculate num_channels because the AT91SAM7 ADC does this for us. - */ - acg.channelselects = pgntd->physdev; +void gadc_lld_nontimerjobI(GadcNonTimerJob *pj) { + acg.channelselects = pj->physdev; acg.trigger = ADC_TRIGGER_SOFTWARE; - - pData = 0; - adcStartConversionI(&ADCD1, &acg, pgntd->buffer, 1); + adcStartConversionI(&ADCD1, &acg, pj->buffer, 1); } #endif /* GFX_USE_GADC */ -- cgit v1.2.3 From 08e1b0ebc7a5b9a960994e16710465dfb67f66ee Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Fri, 28 Mar 2014 19:45:08 +0100 Subject: Removed the doxygen inside of every driver as doxygen is only meant for highlevel API documentation. Documenting the drivers interface should be done inside a template driver or the gdisp LLD abstraction. --- drivers/gaudio/Win32/gaudio_play_config.h | 34 ------ drivers/gaudio/Win32/gaudio_play_lld.c | 5 - drivers/gaudio/Win32/gaudio_record_config.h | 34 ------ drivers/gaudio/Win32/gaudio_record_lld.c | 5 - drivers/gaudio/gadc/gaudio_record_board_template.h | 29 ------ drivers/gaudio/gadc/gaudio_record_config.h | 25 ----- drivers/gaudio/gadc/gaudio_record_lld.c | 9 -- drivers/gdisp/ED060SC4/board_ED060SC4_template.h | 92 +---------------- drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c | 43 ++++---- drivers/gdisp/HX8347D/HX8347D.h | 9 -- drivers/gdisp/HX8347D/board_HX8347D_template.h | 96 ----------------- drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c | 5 - drivers/gdisp/HX8347D/gdisp_lld_config.h | 9 -- drivers/gdisp/ILI9320/board_ILI9320_template.h | 97 ----------------- drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c | 5 - drivers/gdisp/ILI9320/gdisp_lld_config.h | 10 -- drivers/gdisp/ILI9325/board_ILI9325_template.h | 95 ----------------- drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c | 5 - drivers/gdisp/ILI9325/gdisp_lld_config.h | 10 -- drivers/gdisp/ILI9341/board_ILI9341_template.h | 94 ----------------- drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c | 6 -- drivers/gdisp/ILI9341/gdisp_lld_config.h | 10 -- drivers/gdisp/ILI9481/board_ILI9481_template.h | 95 ----------------- drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c | 7 -- drivers/gdisp/ILI9481/gdisp_lld_config.h | 10 -- .../Nokia6610GE12/board_Nokia6610GE12_template.h | 72 ------------- .../gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c | 5 - drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h | 9 -- .../Nokia6610GE8/board_Nokia6610GE8_template.h | 72 ------------- .../gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c | 11 +- drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h | 9 -- drivers/gdisp/RA8875/board_RA8875_template.h | 89 ---------------- drivers/gdisp/RA8875/gdisp_lld_RA8875.c | 5 - drivers/gdisp/RA8875/gdisp_lld_config.h | 10 -- drivers/gdisp/S6D1121/board_S6D1121_template.h | 94 ----------------- drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c | 10 -- drivers/gdisp/S6D1121/gdisp_lld_config.h | 10 -- drivers/gdisp/SSD1289/board_SSD1289_template.h | 115 --------------------- drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c | 5 - drivers/gdisp/SSD1289/gdisp_lld_config.h | 9 -- drivers/gdisp/SSD1306/SSD1306.h | 2 - drivers/gdisp/SSD1306/board_SSD1306_template.h | 71 ------------- drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c | 6 -- drivers/gdisp/SSD1306/gdisp_lld_config.h | 2 - drivers/gdisp/SSD1963/board_SSD1963_template.h | 94 ----------------- drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c | 6 -- drivers/gdisp/SSD1963/gdisp_lld_config.h | 10 -- drivers/gdisp/SSD1963/ssd1963.h | 2 - drivers/gdisp/SSD2119/board_SSD2119_template.h | 115 --------------------- drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c | 5 - drivers/gdisp/SSD2119/gdisp_lld_config.h | 9 -- drivers/gdisp/SSD2119/ssd2119.h | 10 -- drivers/gdisp/ST7565/board_ST7565_template.h | 68 ------------ drivers/gdisp/ST7565/gdisp_lld_ST7565.c | 7 +- drivers/gdisp/ST7565/gdisp_lld_config.h | 2 - drivers/gdisp/ST7565/st7565.h | 2 - drivers/gdisp/TestStub/gdisp_lld_TestStub.c | 5 - drivers/gdisp/TestStub/gdisp_lld_config.h | 9 -- drivers/ginput/dial/GADC/ginput_lld_dial.c | 10 -- .../dial/GADC/ginput_lld_dial_board_template.h | 11 -- drivers/ginput/dial/GADC/ginput_lld_dial_config.h | 10 -- drivers/ginput/toggle/Pal/ginput_lld_toggle.c | 24 ----- .../toggle/Pal/ginput_lld_toggle_board_template.h | 10 -- .../ginput/toggle/Pal/ginput_lld_toggle_config.h | 10 -- drivers/ginput/touch/ADS7843/ginput_lld_mouse.c | 36 ------- .../ADS7843/ginput_lld_mouse_board_template.h | 40 ------- .../ginput/touch/ADS7843/ginput_lld_mouse_config.h | 11 -- drivers/ginput/touch/FT5x06/ft5x06.h | 10 -- drivers/ginput/touch/FT5x06/ginput_lld_mouse.c | 30 ------ .../touch/FT5x06/ginput_lld_mouse_board_template.h | 41 -------- .../ginput/touch/FT5x06/ginput_lld_mouse_config.h | 11 -- drivers/ginput/touch/MCU/ginput_lld_mouse.c | 39 ------- .../touch/MCU/ginput_lld_mouse_board_template.h | 68 ------------ .../touch/MCU/ginput_lld_mouse_config_template.h | 11 -- drivers/ginput/touch/STMPE811/ginput_lld_mouse.c | 32 +----- .../STMPE811/ginput_lld_mouse_board_template.h | 41 -------- .../touch/STMPE811/ginput_lld_mouse_config.h | 11 -- drivers/ginput/touch/STMPE811/stmpe811.h | 9 -- drivers/multiple/Win32/gdisp_lld_Win32.c | 5 - drivers/multiple/Win32/gdisp_lld_config.h | 10 -- drivers/multiple/Win32/ginput_lld_mouse_config.h | 12 --- drivers/multiple/Win32/ginput_lld_toggle_config.h | 12 --- drivers/multiple/X/gdisp_lld_X.c | 14 --- drivers/multiple/X/gdisp_lld_config.h | 10 -- drivers/multiple/X/ginput_lld_mouse_config.h | 12 --- drivers/multiple/uGFXnet/gdisp_lld_config.h | 10 -- drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c | 4 - drivers/multiple/uGFXnet/ginput_lld_mouse_config.h | 12 --- drivers/multiple/uGFXnet/uGFXnetProtocol.h | 5 - 89 files changed, 23 insertions(+), 2337 deletions(-) (limited to 'drivers') diff --git a/drivers/gaudio/Win32/gaudio_play_config.h b/drivers/gaudio/Win32/gaudio_play_config.h index 4013e91f..c4830010 100644 --- a/drivers/gaudio/Win32/gaudio_play_config.h +++ b/drivers/gaudio/Win32/gaudio_play_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/Win32/gaudio_play_config.h - * @brief GAUDIO Play Driver config file. - * - * @addtogroup GAUDIO - * @{ - */ - #ifndef GAUDIO_PLAY_CONFIG_H #define GAUDIO_PLAY_CONFIG_H @@ -22,42 +14,16 @@ /* Driver hardware support. */ /*===========================================================================*/ -/** - * @brief The maximum sample frequency supported by this audio device - */ #define GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY 44100 - -/** - * @brief The number of audio formats supported by this driver - */ #define GAUDIO_PLAY_NUM_FORMATS 2 - -/** - * @brief The available audio sample formats in order of preference - */ #define GAUDIO_PLAY_FORMAT1 ARRAY_DATA_16BITSIGNED #define GAUDIO_PLAY_FORMAT2 ARRAY_DATA_8BITUNSIGNED - -/** - * @brief The number of audio channels supported by this driver - */ #define GAUDIO_PLAY_NUM_CHANNELS 2 - -/** - * @brief Whether each channel is mono or stereo - */ #define GAUDIO_PLAY_CHANNEL0_IS_STEREO FALSE #define GAUDIO_PLAY_CHANNEL1_IS_STEREO TRUE - -/** - * @brief The list of audio channel names and their uses - * @{ - */ #define GAUDIO_PLAY_MONO 0 #define GAUDIO_PLAY_STEREO 1 -/** @} */ #endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ #endif /* GAUDIO_PLAY_CONFIG_H */ -/** @} */ diff --git a/drivers/gaudio/Win32/gaudio_play_lld.c b/drivers/gaudio/Win32/gaudio_play_lld.c index 35a1fc99..c0adf03e 100644 --- a/drivers/gaudio/Win32/gaudio_play_lld.c +++ b/drivers/gaudio/Win32/gaudio_play_lld.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/Win32/gaudio_play_lld.c - * @brief GAUDIO - Play Driver file for Win32. - */ - #include "gfx.h" #if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY diff --git a/drivers/gaudio/Win32/gaudio_record_config.h b/drivers/gaudio/Win32/gaudio_record_config.h index 4d952e1d..5897212b 100644 --- a/drivers/gaudio/Win32/gaudio_record_config.h +++ b/drivers/gaudio/Win32/gaudio_record_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/Win32/gaudio_record_config.h - * @brief GAUDIO Record Driver config file. - * - * @addtogroup GAUDIO - * @{ - */ - #ifndef GAUDIO_RECORD_CONFIG_H #define GAUDIO_RECORD_CONFIG_H @@ -22,42 +14,16 @@ /* Driver hardware support. */ /*===========================================================================*/ -/** - * @brief The maximum sample frequency supported by this audio device - */ #define GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY 44100 - -/** - * @brief The number of audio formats supported by this driver - */ #define GAUDIO_RECORD_NUM_FORMATS 2 - -/** - * @brief The available audio sample formats in order of preference - */ #define GAUDIO_RECORD_FORMAT1 ARRAY_DATA_16BITSIGNED #define GAUDIO_RECORD_FORMAT2 ARRAY_DATA_8BITUNSIGNED - -/** - * @brief The number of audio channels supported by this driver - */ #define GAUDIO_RECORD_NUM_CHANNELS 2 - -/** - * @brief Whether each channel is mono or stereo - */ #define GAUDIO_RECORD_CHANNEL0_IS_STEREO FALSE #define GAUDIO_RECORD_CHANNEL1_IS_STEREO TRUE - -/** - * @brief The list of audio channels and their uses - * @{ - */ #define GAUDIO_RECORD_MONO 0 #define GAUDIO_RECORD_STEREO 1 -/** @} */ #endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ #endif /* GAUDIO_RECORD_CONFIG_H */ -/** @} */ diff --git a/drivers/gaudio/Win32/gaudio_record_lld.c b/drivers/gaudio/Win32/gaudio_record_lld.c index 9f63ff2f..c9ac8187 100644 --- a/drivers/gaudio/Win32/gaudio_record_lld.c +++ b/drivers/gaudio/Win32/gaudio_record_lld.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/Win32/gaudio_record_lld.c - * @brief GAUDIO - Record Driver file for Win32. - */ - #include "gfx.h" #if GFX_USE_GAUDIO && GAUDIO_NEED_RECORD diff --git a/drivers/gaudio/gadc/gaudio_record_board_template.h b/drivers/gaudio/gadc/gaudio_record_board_template.h index 59168be1..42c15205 100644 --- a/drivers/gaudio/gadc/gaudio_record_board_template.h +++ b/drivers/gaudio/gadc/gaudio_record_board_template.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/gadc/gaudio_record_board_template.h - * @brief GAUDIO Record Driver board config board file - * - * @addtogroup GAUDIO - * @{ - */ - #ifndef _GAUDIO_RECORD_BOARD_H #define _GAUDIO_RECORD_BOARD_H @@ -20,37 +12,16 @@ /* Audio inputs on this board */ /*===========================================================================*/ -/** - * @brief The number of audio channels supported by this driver - * @note This is an example - */ #define GAUDIO_RECORD_NUM_CHANNELS 1 -/** - * @brief Whether each channel is mono or stereo - * @note This is an example - */ #define GAUDIO_RECORD_CHANNEL0_IS_STEREO FALSE -/** - * @brief The list of audio channels and their uses - * @note This is an example - * @{ - */ #define GAUDIO_RECORD_MICROPHONE 0 -/** @} */ -/** - * @brief The audio channel to GADC physical device assignment - * @note This is an example - * @{ - */ #ifdef GAUDIO_RECORD_LLD_IMPLEMENTATION static uint32_t gaudio_gadc_physdevs[GAUDIO_RECORD_NUM_CHANNELS] = { GADC_PHYSDEV_MICROPHONE, }; #endif -/** @} */ #endif /* _GAUDIO_RECORD_BOARD_H */ -/** @} */ diff --git a/drivers/gaudio/gadc/gaudio_record_config.h b/drivers/gaudio/gadc/gaudio_record_config.h index 88092a63..345625ff 100644 --- a/drivers/gaudio/gadc/gaudio_record_config.h +++ b/drivers/gaudio/gadc/gaudio_record_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/gadc/gaudio_record_config.h - * @brief GAUDIN Record Driver config file. - * - * @addtogroup GAUDIO - * @{ - */ - #ifndef GAUDIO_RECORD_CONFIG_H #define GAUDIO_RECORD_CONFIG_H @@ -22,30 +14,13 @@ /* Driver hardware support. */ /*===========================================================================*/ -/** - * @brief The maximum sample frequency supported by this audio device - * @details For this driver it matches the GADC maximum high speed sample rate - */ #define GAUDIO_RECORD_MAX_SAMPLE_FREQUENCY GADC_MAX_HIGH_SPEED_SAMPLERATE - -/** - * @brief The number of audio formats supported by this driver - */ #define GAUDIO_RECORD_NUM_FORMATS 1 - -/** - * @brief The available audio sample formats in order of preference - */ #define GAUDIO_RECORD_FORMAT1 GADC_SAMPLE_FORMAT -/** - * For the GAUDIO driver that uses GADC - all the remaining config definitions are specific - * to the board. - */ /* Include the user supplied board definitions */ #include "gaudio_record_board.h" #endif /* GFX_USE_GAUDIO && GAUDIO_NEED_RECORD */ #endif /* GAUDIO_RECORD_CONFIG_H */ -/** @} */ diff --git a/drivers/gaudio/gadc/gaudio_record_lld.c b/drivers/gaudio/gadc/gaudio_record_lld.c index 6f4cb2de..1d70a259 100644 --- a/drivers/gaudio/gadc/gaudio_record_lld.c +++ b/drivers/gaudio/gadc/gaudio_record_lld.c @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gaudio/gadc/gaudio_record_lld.c - * @brief GAUDIO - Record Driver file for using the cpu ADC (via GADC). - */ - -/** - * We are now implementing the driver - pull in our channel table - * from the board definitions. - */ #define GAUDIO_RECORD_IMPLEMENTATION #include "gfx.h" diff --git a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h index 6d71a986..69683cd0 100644 --- a/drivers/gdisp/ED060SC4/board_ED060SC4_template.h +++ b/drivers/gdisp/ED060SC4/board_ED060SC4_template.h @@ -5,18 +5,10 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ST7565/board_ST7565_template.h - * @brief GDISP Graphic Driver subsystem board interface for the ST7565 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** +/* * @brief Optional parameters that can be put in this file. * @note The values listed below are the defaults. * @@ -54,149 +46,67 @@ * #define EINK_WRITECOUNT 4 */ -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief Delay for display waveforms. Should be an accurate microsecond delay. - * - * @param[in] us The number of microseconds - */ static void eink_delay(int us) { (void) us; } -/** - * @brief Turn the E-ink panel Vdd supply (+3.3V) on or off. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpower_vdd(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Turn the E-ink panel negative supplies (-15V, -20V) on or off. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpower_vneg(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Turn the E-ink panel positive supplies (-15V, -20V) on or off. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpower_vpos(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the LE (source driver Latch Enable) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_le(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the OE (source driver Output Enable) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_oe(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the CL (source driver Clock) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_cl(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the SPH (source driver Start Pulse Horizontal) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_sph(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the D0-D7 (source driver Data) pins. - * - * @param[in] g The GDisplay structure - * @param[in] value The byte to write - */ static inline void setpins_data(GDisplay *g, uint8_t value) { (void) g; (void) value; } -/** - * @brief Set the state of the CKV (gate driver Clock Vertical) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_ckv(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the GMODE (gate driver Gate Mode) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_gmode(GDisplay *g, bool_t on) { (void) g; (void) on; } -/** - * @brief Set the state of the SPV (gate driver Start Pulse Vertical) pin. - * - * @param[in] g The GDisplay structure - * @param[in] on On or off - */ static inline void setpin_spv(GDisplay *g, bool_t on) { (void) g; (void) on; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c index 1c61ee93..789053c8 100644 --- a/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c +++ b/drivers/gdisp/ED060SC4/gdisp_lld_ED060SC4.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ED060SC4/gdisp_lld.c - * @brief GDISP Graphics Driver for the E-ink panel ED060SC4. - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -83,7 +78,7 @@ #define PRIV(g) ((drvPriv *)g->priv) -/** Delay between signal changes, to give time for IO pins to change state. */ +/* Delay between signal changes, to give time for IO pins to change state. */ static inline void clockdelay(void) { #if EINK_CLOCKDELAY & 1 @@ -111,7 +106,7 @@ static inline void clockdelay(void) #endif } -/** Fast vertical clock pulse for gate driver, used during initializations */ +/* Fast vertical clock pulse for gate driver, used during initializations */ static void vclock_quick(GDisplay *g) { setpin_ckv(g, TRUE); @@ -120,7 +115,7 @@ static void vclock_quick(GDisplay *g) eink_delay(4); } -/** Horizontal clock pulse for clocking data into source driver */ +/* Horizontal clock pulse for clocking data into source driver */ static void hclock(GDisplay *g) { clockdelay(); @@ -129,7 +124,7 @@ static void hclock(GDisplay *g) setpin_cl(g, FALSE); } -/** Start a new vertical gate driver scan from top. +/* Start a new vertical gate driver scan from top. * Note: Does not clear any previous bits in the shift register, * so you should always scan through the whole display before * starting a new scan. @@ -144,7 +139,7 @@ static void vscan_start(GDisplay *g) vclock_quick(g); } -/** Waveform for strobing a row of data onto the display. +/* Waveform for strobing a row of data onto the display. * Attempts to minimize the leaking of color to other rows by having * a long idle period after a medium-length strobe period. */ @@ -158,7 +153,7 @@ static void vscan_write(GDisplay *g) eink_delay(200); } -/** Waveform used when clearing the display. Strobes a row of data to the +/* Waveform used when clearing the display. Strobes a row of data to the * screen, but does not mind some of it leaking to other rows. */ static void vscan_bulkwrite(GDisplay *g) @@ -169,7 +164,7 @@ static void vscan_bulkwrite(GDisplay *g) eink_delay(200); } -/** Waveform for skipping a vertical row without writing anything. +/* Waveform for skipping a vertical row without writing anything. * Attempts to minimize the amount of change in any row. */ static void vscan_skip(GDisplay *g) @@ -180,7 +175,7 @@ static void vscan_skip(GDisplay *g) eink_delay(100); } -/** Stop the vertical scan. The significance of this escapes me, but it seems +/* Stop the vertical scan. The significance of this escapes me, but it seems * necessary or the next vertical scan may be corrupted. */ static void vscan_stop(GDisplay *g) @@ -193,7 +188,7 @@ static void vscan_stop(GDisplay *g) vclock_quick(g); } -/** Start updating the source driver data (from left to right). */ +/* Start updating the source driver data (from left to right). */ static void hscan_start(GDisplay *g) { /* Disable latching and output enable while we are modifying the row. */ @@ -204,7 +199,7 @@ static void hscan_start(GDisplay *g) setpin_sph(g, FALSE); } -/** Write data to the horizontal row. */ +/* Write data to the horizontal row. */ static void hscan_write(GDisplay *g, const uint8_t *data, int count) { while (count--) @@ -217,7 +212,7 @@ static void hscan_write(GDisplay *g, const uint8_t *data, int count) } } -/** Finish and transfer the row to the source drivers. +/* Finish and transfer the row to the source drivers. * Does not set the output enable, so the drivers are not yet active. */ static void hscan_stop(GDisplay *g) { @@ -231,7 +226,7 @@ static void hscan_stop(GDisplay *g) setpin_le(g, FALSE); } -/** Turn on the power to the E-Ink panel, observing proper power sequencing. */ +/* Turn on the power to the E-Ink panel, observing proper power sequencing. */ static void power_on(GDisplay *g) { unsigned i; @@ -264,7 +259,7 @@ static void power_on(GDisplay *g) vscan_stop(g); } -/** Turn off the power, observing proper power sequencing. */ +/* Turn off the power, observing proper power sequencing. */ static void power_off(GDisplay *g) { /* First the high voltages */ @@ -289,7 +284,7 @@ static void power_off(GDisplay *g) /* ==================================== * Framebuffer emulation layer * ==================================== */ - + #if EINK_PPB == 4 #define PIXELMASK 3 #define PIXEL_WHITE 2 @@ -336,7 +331,7 @@ typedef struct drvPriv { uint8_t g_blockmap[BLOCKS_Y][BLOCKS_X]; } drvPriv; -/** Check if the row contains any allocated blocks. */ +/* Check if the row contains any allocated blocks. */ static bool_t blocks_on_row(GDisplay *g, unsigned by) { unsigned bx; @@ -350,7 +345,7 @@ static bool_t blocks_on_row(GDisplay *g, unsigned by) return FALSE; } -/** Write out a block row. */ +/* Write out a block row. */ static void write_block_row(GDisplay *g, unsigned by) { unsigned bx, dy, dx; @@ -379,7 +374,7 @@ static void write_block_row(GDisplay *g, unsigned by) } } -/** Clear the block map, i.e. deallocate all blocks */ +/* Clear the block map, i.e. deallocate all blocks */ static void clear_block_map(GDisplay *g) { unsigned bx, by; @@ -394,7 +389,7 @@ static void clear_block_map(GDisplay *g) PRIV(g)->g_next_block = 0; } -/** Initialize a newly allocated block. */ +/* Initialize a newly allocated block. */ static void zero_block(block_t *block) { unsigned dx, dy; @@ -407,7 +402,7 @@ static void zero_block(block_t *block) } } -/** Allocate a buffer +/* Allocate a buffer * Automatically flushes if all buffers are full. */ static block_t *alloc_buffer(GDisplay *g, unsigned bx, unsigned by) { diff --git a/drivers/gdisp/HX8347D/HX8347D.h b/drivers/gdisp/HX8347D/HX8347D.h index 280cd748..479a9ef0 100644 --- a/drivers/gdisp/HX8347D/HX8347D.h +++ b/drivers/gdisp/HX8347D/HX8347D.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/HX8347D/HX8347D.h - * @brief GDISP Graphic Driver support header for the HX8347D display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _HX8347D_H #define _HX8347D_H @@ -140,4 +132,3 @@ #define HX8347D_REG_PGSEL 0xff /* Page select */ #endif /* _HX8347D_H */ -/** @} */ diff --git a/drivers/gdisp/HX8347D/board_HX8347D_template.h b/drivers/gdisp/HX8347D/board_HX8347D_template.h index 57ec75f6..fd40d30c 100644 --- a/drivers/gdisp/HX8347D/board_HX8347D_template.h +++ b/drivers/gdisp/HX8347D/board_HX8347D_template.h @@ -5,152 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/HX8347D/board_HX8347D_template.h - * @brief GDISP Graphic Driver subsystem board SPI interface for the HX8347D display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Set the bus in 16 bit mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void busmode16(GDisplay *g) { (void) g; } -/** - * @brief Set the bus in 8 bit mode (the default) - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void busmode8(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint8_t index) { (void) g; (void) index; } -/** - * @brief Send 8 bits of data to the lcd. - * @pre The bus is in 8 bit mode - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint8_t data) { (void) g; (void) data; } -/** - * @brief Send 16 bits of data to the lcd. - * @pre The bus is in 16 bit mode - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_ram16(GDisplay *g, uint16_t data) { (void) g; (void) data; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c index 1b581d4d..34051c22 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c +++ b/drivers/gdisp/HX8347D/gdisp_lld_HX8347D.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/HX8347D/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the HX8347D display. - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/HX8347D/gdisp_lld_config.h b/drivers/gdisp/HX8347D/gdisp_lld_config.h index ab4c8639..0602ca0e 100644 --- a/drivers/gdisp/HX8347D/gdisp_lld_config.h +++ b/drivers/gdisp/HX8347D/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/HX8347D/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the HX8347D display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -30,4 +22,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/ILI9320/board_ILI9320_template.h b/drivers/gdisp/ILI9320/board_ILI9320_template.h index 6f5ad16d..a4787730 100644 --- a/drivers/gdisp/ILI9320/board_ILI9320_template.h +++ b/drivers/gdisp/ILI9320/board_ILI9320_template.h @@ -5,153 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9320/board_ILI9320_template.h - * @brief GDISP Graphic Driver subsystem board interface for the ILI9320 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef GDISP_LLD_BOARD_H #define GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @note The chip select may need to be asserted/de-asserted - * around the actual spi read - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } #endif /* GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c index 8dd5f586..87f29390 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c +++ b/drivers/gdisp/ILI9320/gdisp_lld_ILI9320.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9320/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the ILI9320 display. - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/ILI9320/gdisp_lld_config.h b/drivers/gdisp/ILI9320/gdisp_lld_config.h index 5709de50..04834079 100644 --- a/drivers/gdisp/ILI9320/gdisp_lld_config.h +++ b/drivers/gdisp/ILI9320/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9320/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the ILI9320 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef GDISP_LLD_CONFIG_H #define GDISP_LLD_CONFIG_H @@ -32,5 +24,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/ILI9325/board_ILI9325_template.h b/drivers/gdisp/ILI9325/board_ILI9325_template.h index 07c2fdee..a4787730 100644 --- a/drivers/gdisp/ILI9325/board_ILI9325_template.h +++ b/drivers/gdisp/ILI9325/board_ILI9325_template.h @@ -5,151 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9325/board_ILI9325_template.h - * @brief GDISP Graphic Driver subsystem board interface for the ILI9325 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef GDISP_LLD_BOARD_H #define GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } #endif /* GDISP_LLD_BOARD_H */ -/** @} */ - diff --git a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c index e2900514..118e5933 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c +++ b/drivers/gdisp/ILI9325/gdisp_lld_ILI9325.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9325/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the ILI9325 display. - */ - #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ diff --git a/drivers/gdisp/ILI9325/gdisp_lld_config.h b/drivers/gdisp/ILI9325/gdisp_lld_config.h index c40bd2b7..95bd2937 100644 --- a/drivers/gdisp/ILI9325/gdisp_lld_config.h +++ b/drivers/gdisp/ILI9325/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9325/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the ILI9325 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef GDISP_LLD_CONFIG_H #define GDISP_LLD_CONFIG_H @@ -32,5 +24,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/ILI9341/board_ILI9341_template.h b/drivers/gdisp/ILI9341/board_ILI9341_template.h index b8f55dc1..c4057b1f 100644 --- a/drivers/gdisp/ILI9341/board_ILI9341_template.h +++ b/drivers/gdisp/ILI9341/board_ILI9341_template.h @@ -5,150 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9341/board_ILI9341_template.h - * @brief GDISP Graphic Driver subsystem board interface for the ILI9341 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c index d6679714..f27605a7 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c +++ b/drivers/gdisp/ILI9341/gdisp_lld_ILI9341.c @@ -5,12 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9341/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for - * the ILI9341 and compatible HVGA display - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/ILI9341/gdisp_lld_config.h b/drivers/gdisp/ILI9341/gdisp_lld_config.h index 668a06c9..d3625d70 100644 --- a/drivers/gdisp/ILI9341/gdisp_lld_config.h +++ b/drivers/gdisp/ILI9341/gdisp_lld_config.h @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9481/gdisp_lld_config.h - * @brief GDISP Graphics Driver subsystem low level driver source for - * the ILI9481 and compatible HVGA display - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -32,4 +23,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/ILI9481/board_ILI9481_template.h b/drivers/gdisp/ILI9481/board_ILI9481_template.h index 7824c936..c4057b1f 100644 --- a/drivers/gdisp/ILI9481/board_ILI9481_template.h +++ b/drivers/gdisp/ILI9481/board_ILI9481_template.h @@ -5,151 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9481/board_ILI9481_template.h - * @brief GDISP Graphics Driver subsystem low level driver source for - * the ILI9481 and compatible HVGA display - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c index 748ee469..f0bc7355 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c +++ b/drivers/gdisp/ILI9481/gdisp_lld_ILI9481.c @@ -5,12 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9481/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for - * the ILI9481 and compatible HVGA display - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -325,4 +319,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif #endif /* GFX_USE_GDISP */ -/** @} */ diff --git a/drivers/gdisp/ILI9481/gdisp_lld_config.h b/drivers/gdisp/ILI9481/gdisp_lld_config.h index 3f3a4834..ba48718a 100644 --- a/drivers/gdisp/ILI9481/gdisp_lld_config.h +++ b/drivers/gdisp/ILI9481/gdisp_lld_config.h @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ILI9481/gdisp_lld_config.h - * @brief GDISP Graphics Driver subsystem low level driver source for - * the ILI9481 and compatible HVGA display - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -32,4 +23,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h index 160c9278..0545fcd5 100644 --- a/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h +++ b/drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE12/board_Nokia6610GE12_template.h - * @brief GDISP Graphic Driver subsystem board interface for the Nokia6610 GE12 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H @@ -28,104 +20,40 @@ //#define GDISP_INITIAL_CONTRAST 50 // The initial contrast percentage //#define GDISP_INITIAL_BACKLIGHT 100 // The initial backlight percentage -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c index f0603ca8..c6aa2a7c 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_Nokia6610GE12.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE12/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the Nokia6610 GE12 display. - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h b/drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h index 19a455d8..3f29f611 100644 --- a/drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h +++ b/drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE12/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the Nokia6610 GE12 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -30,4 +22,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h index 28fc9f70..0545fcd5 100644 --- a/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h +++ b/drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/board_Nokia6610GE8_template.h - * @brief GDISP Graphic Driver subsystem board interface for the Nokia6610 GE12 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H @@ -28,104 +20,40 @@ //#define GDISP_INITIAL_CONTRAST 50 // The initial contrast percentage //#define GDISP_INITIAL_BACKLIGHT 100 // The initial backlight percentage -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c index c02b1ec8..cd265e00 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_Nokia6610GE8.c @@ -5,19 +5,11 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the Nokia6610 GE8 display. - * - * @addtogroup GDISP - * @{ - */ - #include "gfx.h" #if GFX_USE_GDISP -/** +/* * This is for the EPSON (GE8) controller driving a Nokia6610 color LCD display. * Note that there is also a PHILIPS (GE12) controller for the same display that this code * does not support. @@ -599,4 +591,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif #endif /* GFX_USE_GDISP */ -/** @} */ diff --git a/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h b/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h index 1476dbcf..b90314d6 100644 --- a/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h +++ b/drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/Nokia6610GE8/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the Nokia6610 GE8 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -46,4 +38,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/RA8875/board_RA8875_template.h b/drivers/gdisp/RA8875/board_RA8875_template.h index fce05129..292484f5 100644 --- a/drivers/gdisp/RA8875/board_RA8875_template.h +++ b/drivers/gdisp/RA8875/board_RA8875_template.h @@ -5,139 +5,50 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1963/board_RA8875_template.h - * @brief GDISP Graphic Driver subsystem board interface for the RA8875 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @note The chip select may need to be asserted/de-asserted - * around the actual spi read - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c index a4d1d0e1..6b58868b 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_RA8875.c +++ b/drivers/gdisp/RA8875/gdisp_lld_RA8875.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/RA8875/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source. - */ - #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ diff --git a/drivers/gdisp/RA8875/gdisp_lld_config.h b/drivers/gdisp/RA8875/gdisp_lld_config.h index 55a07839..03a58afa 100644 --- a/drivers/gdisp/RA8875/gdisp_lld_config.h +++ b/drivers/gdisp/RA8875/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1963/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -32,5 +24,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/S6D1121/board_S6D1121_template.h b/drivers/gdisp/S6D1121/board_S6D1121_template.h index 04742f56..c4057b1f 100644 --- a/drivers/gdisp/S6D1121/board_S6D1121_template.h +++ b/drivers/gdisp/S6D1121/board_S6D1121_template.h @@ -5,150 +5,56 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/S6D1121/board_S6D1121_template.h - * @brief GDISP Graphic Driver subsystem board interface for the S6D1121 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c index 389b27fe..e3f1dd0c 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c +++ b/drivers/gdisp/S6D1121/gdisp_lld_S6D1121.c @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/S6D1121/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the S6d1121 display. - * - * @addtogroup GDISP - * @{ - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -336,5 +328,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif #endif /* GFX_USE_GDISP */ -/** @} */ - diff --git a/drivers/gdisp/S6D1121/gdisp_lld_config.h b/drivers/gdisp/S6D1121/gdisp_lld_config.h index 79e859bc..03a58afa 100644 --- a/drivers/gdisp/S6D1121/gdisp_lld_config.h +++ b/drivers/gdisp/S6D1121/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/S6D1121/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the S6D1121 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -32,5 +24,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/SSD1289/board_SSD1289_template.h b/drivers/gdisp/SSD1289/board_SSD1289_template.h index 7c9cd757..b86d9579 100644 --- a/drivers/gdisp/SSD1289/board_SSD1289_template.h +++ b/drivers/gdisp/SSD1289/board_SSD1289_template.h @@ -5,181 +5,67 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1289/board_SSD1289_template.h - * @brief GDISP Graphic Driver subsystem board interface for the SSD1289 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } -/** - * The below section you can replace with #error if your interface doesn't support DMA - */ #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) //#error "GDISP - SSD1289: This interface does not support DMA" - /** - * @brief Transfer data using DMA but don't increment the source address - * - * @param[in] g The GDisplay structure - * @param[in] buffer The source buffer location - * @param[in] area The number of pixels to transfer - * - * @notapi - */ static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { (void) g; (void) buffer; (void) area; } - /** - * @brief Transfer data using DMA incrementing the source address - * - * @param[in] g The GDisplay structure - * @param[in] buffer The source buffer location - * @param[in] area The number of pixels to transfer - * - * @notapi - */ static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) { (void) g; (void) buffer; @@ -188,4 +74,3 @@ static inline uint16_t read_data(GDisplay *g) { #endif #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c index 75338745..d49e5268 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c +++ b/drivers/gdisp/SSD1289/gdisp_lld_SSD1289.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1289/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the SSD1289 display. - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/SSD1289/gdisp_lld_config.h b/drivers/gdisp/SSD1289/gdisp_lld_config.h index a9166553..8d327bf9 100644 --- a/drivers/gdisp/SSD1289/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1289/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1289/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the SSD1289 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -40,4 +32,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/SSD1306/SSD1306.h b/drivers/gdisp/SSD1306/SSD1306.h index 47ca39e4..d1c59fe4 100644 --- a/drivers/gdisp/SSD1306/SSD1306.h +++ b/drivers/gdisp/SSD1306/SSD1306.h @@ -53,5 +53,3 @@ #define SSD1306_SCROLL_VERTICAL_AND_HORIZONTAL_LEFT 0x2A #endif /* _SSD1306_H */ -/** @} */ - diff --git a/drivers/gdisp/SSD1306/board_SSD1306_template.h b/drivers/gdisp/SSD1306/board_SSD1306_template.h index 5b4bd05c..0bd3f803 100644 --- a/drivers/gdisp/SSD1306/board_SSD1306_template.h +++ b/drivers/gdisp/SSD1306/board_SSD1306_template.h @@ -5,106 +5,37 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1306/board_SSD1306_template.h - * @brief GDISP Graphic Driver subsystem board interface for the SSD1306 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Optional: A byte to prefix on each display page line. - * @note If not defined then no byte is prefixed on each page line. - * - * @notapi - */ //#define SSD1306_PAGE_PREFIX 0x40 -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send a command to the controller. - * - * @param[in] g The GDisplay structure - * @param[in] cmd The command to send * - * - * @notapi - */ static inline void write_cmd(GDisplay *g, uint8_t cmd) { (void) g; (void) cmd; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) { (void) g; (void) data; @@ -112,5 +43,3 @@ static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) { } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ - diff --git a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c index 5dd4c2ab..abea8365 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c +++ b/drivers/gdisp/SSD1306/gdisp_lld_SSD1306.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1306/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the SSD1306 display. - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -279,4 +274,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif // GDISP_NEED_CONTROL #endif // GFX_USE_GDISP - diff --git a/drivers/gdisp/SSD1306/gdisp_lld_config.h b/drivers/gdisp/SSD1306/gdisp_lld_config.h index 627de17b..2b805e86 100644 --- a/drivers/gdisp/SSD1306/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1306/gdisp_lld_config.h @@ -28,5 +28,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/SSD1963/board_SSD1963_template.h b/drivers/gdisp/SSD1963/board_SSD1963_template.h index 5e1999b8..f9f248e7 100644 --- a/drivers/gdisp/SSD1963/board_SSD1963_template.h +++ b/drivers/gdisp/SSD1963/board_SSD1963_template.h @@ -5,47 +5,9 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1963/board_SSD1963_template.h - * @brief GDISP Graphic Driver subsystem board interface for the SSD1963 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief LCD panel specs - * - * @note The timings need to follow the datasheet for your particular TFT/LCD screen - * (the actual screen, not the controller). - * @note Datasheets normally use a specific set of timings and acronyms, their value refers - * to the number of pixel clocks. Non-display periods refer to pulses/timings that occur - * before or after the timings that actually put pixels on the screen. Display periods - * refer to pulses/timings that directly put pixels on the screen. - * @note HDP: Horizontal Display Period, normally the width - 1
- * HT: Horizontal Total period (display + non-display)
- * HPS: non-display period between the start of the horizontal sync (LLINE) signal - * and the first display data
- * LPS: horizontal sync pulse (LLINE) start location in pixel clocks
- * HPW: Horizontal sync Pulse Width
- * VDP: Vertical Display period, normally height - 1
- * VT: Vertical Total period (display + non-display)
- * VPS: non-display period in lines between the start of the frame and the first display - * data in number of lines
- * FPS: vertical sync pulse (LFRAME) start location in lines.
- * VPW: Vertical sync Pulse Width - * @note Here's how to convert them:
- * SCREEN_HSYNC_FRONT_PORCH = ( HT - HPS ) - GDISP_SCREEN_WIDTH
- * SCREEN_HSYNC_PULSE = HPW
- * SCREEN_HSYNC_BACK_PORCH = HPS - HPW
- * SCREEN_VSYNC_FRONT_PORCH = ( VT - VPS ) - GDISP_SCREEN_HEIGHT
- * SCREEN_VSYNC_PULSE = VPW
- * SCREEN_VSYNC_BACK_PORCH = VPS - LPS
- */ - static const LCD_Parameters DisplayTimings[] = { // You need one of these array elements per display { @@ -58,91 +20,35 @@ static const LCD_Parameters DisplayTimings[] = { }, }; -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c index 1e69ef70..74fa3e3e 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c +++ b/drivers/gdisp/SSD1963/gdisp_lld_SSD1963.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1963/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source. - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -282,4 +277,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif #endif /* GFX_USE_GDISP */ - diff --git a/drivers/gdisp/SSD1963/gdisp_lld_config.h b/drivers/gdisp/SSD1963/gdisp_lld_config.h index 8ad94738..f1b61702 100644 --- a/drivers/gdisp/SSD1963/gdisp_lld_config.h +++ b/drivers/gdisp/SSD1963/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD1963/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -30,5 +22,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/SSD1963/ssd1963.h b/drivers/gdisp/SSD1963/ssd1963.h index be328775..2d1ac55f 100644 --- a/drivers/gdisp/SSD1963/ssd1963.h +++ b/drivers/gdisp/SSD1963/ssd1963.h @@ -9,7 +9,6 @@ #define SSD1963_H /* SSD1963 commands */ - #define SSD1963_NOP 0x0000 #define SSD1963_SOFT_RESET 0x0001 #define SSD1963_GET_POWER_MODE 0x000A @@ -95,4 +94,3 @@ #define SSD1963_GET_PIXEL_DATA_INTERFACE 0x00F1 #endif - diff --git a/drivers/gdisp/SSD2119/board_SSD2119_template.h b/drivers/gdisp/SSD2119/board_SSD2119_template.h index b4c6341d..61c54774 100644 --- a/drivers/gdisp/SSD2119/board_SSD2119_template.h +++ b/drivers/gdisp/SSD2119/board_SSD2119_template.h @@ -5,181 +5,67 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD2119/board_SSD2119_template.h - * @brief GDISP Graphic Driver subsystem board template for the SSD2119 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Set the lcd back-light level. - * - * @param[in] g The GDisplay structure - * @param[in] percent 0 to 100% - * - * @notapi - */ static inline void set_backlight(GDisplay *g, uint8_t percent) { (void) g; (void) percent; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send data to the index register. - * - * @param[in] g The GDisplay structure - * @param[in] index The index register to set - * - * @notapi - */ static inline void write_index(GDisplay *g, uint16_t index) { (void) g; (void) index; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint16_t data) { (void) g; (void) data; } -/** - * @brief Set the bus in read mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setreadmode(GDisplay *g) { (void) g; } -/** - * @brief Set the bus back into write mode - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void setwritemode(GDisplay *g) { (void) g; } -/** - * @brief Read data from the lcd. - * @return The data from the lcd - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline uint16_t read_data(GDisplay *g) { (void) g; return 0; } -/** - * The below section you can replace with #error if your interface doesn't support DMA - */ #if defined(GDISP_USE_DMA) || defined(__DOXYGEN__) //#error "GDISP - SSD2119: This interface does not support DMA" - /** - * @brief Transfer data using DMA but don't increment the source address - * - * @param[in] g The GDisplay structure - * @param[in] buffer The source buffer location - * @param[in] area The number of pixels to transfer - * - * @notapi - */ static inline void dma_with_noinc(GDisplay *g, color_t *buffer, int area) { (void) g; (void) buffer; (void) area; } - /** - * @brief Transfer data using DMA incrementing the source address - * - * @param[in] g The GDisplay structure - * @param[in] buffer The source buffer location - * @param[in] area The number of pixels to transfer - * - * @notapi - */ static inline void dma_with_inc(GDisplay *g, color_t *buffer, int area) { (void) g; (void) buffer; @@ -188,4 +74,3 @@ static inline uint16_t read_data(GDisplay *g) { #endif #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ diff --git a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c index 8af9a123..08cddf96 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c +++ b/drivers/gdisp/SSD2119/gdisp_lld_SSD2119.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD2119/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the SSD2119 display. - */ - #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/gdisp/SSD2119/gdisp_lld_config.h b/drivers/gdisp/SSD2119/gdisp_lld_config.h index ec034bef..17983807 100644 --- a/drivers/gdisp/SSD2119/gdisp_lld_config.h +++ b/drivers/gdisp/SSD2119/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD2119/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the SSD2119 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -40,4 +32,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/gdisp/SSD2119/ssd2119.h b/drivers/gdisp/SSD2119/ssd2119.h index a8fa7521..7812d98b 100644 --- a/drivers/gdisp/SSD2119/ssd2119.h +++ b/drivers/gdisp/SSD2119/ssd2119.h @@ -5,19 +5,10 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/SSD2119/ssd2119.h - * @brief GDISP Graphic Driver support header for the SSD2119 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _SSD2119_H #define _SSD2119_H /* SSD2119 registers */ - #define SSD2119_REG_DEVICE_CODE_READ 0x00 #define SSD2119_REG_OSC_START 0x00 #define SSD2119_REG_OUTPUT_CTRL 0x01 @@ -65,4 +56,3 @@ #define SSD2119_REG_Y_RAM_ADDR 0x4F #endif /* _SSD2119_H */ -/** @} */ diff --git a/drivers/gdisp/ST7565/board_ST7565_template.h b/drivers/gdisp/ST7565/board_ST7565_template.h index 4eb45701..3efdbd46 100644 --- a/drivers/gdisp/ST7565/board_ST7565_template.h +++ b/drivers/gdisp/ST7565/board_ST7565_template.h @@ -5,20 +5,9 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ST7565/board_ST7565_template.h - * @brief GDISP Graphic Driver subsystem board interface for the ST7565 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_BOARD_H #define _GDISP_LLD_BOARD_H -/** - * Driver configuration - */ #define ST7565_LCD_BIAS ST7565_LCD_BIAS_7 #define ST7565_ADC ST7565_ADC_NORMAL #define ST7565_COM_SCAN ST7565_COM_SCAN_INC @@ -28,87 +17,32 @@ * #define ST7565_PAGE_ORDER 4,5,6,7,0,1,2,3 */ -/** - * @brief Initialise the board for the display. - * - * @param[in] g The GDisplay structure - * - * @note Set the g->board member to whatever is appropriate. For multiple - * displays this might be a pointer to the appropriate register set. - * - * @notapi - */ static inline void init_board(GDisplay *g) { (void) g; } -/** - * @brief After the initialisation. - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void post_init_board(GDisplay *g) { (void) g; } -/** - * @brief Set or clear the lcd reset pin. - * - * @param[in] g The GDisplay structure - * @param[in] state TRUE = lcd in reset, FALSE = normal operation - * - * @notapi - */ static inline void setpin_reset(GDisplay *g, bool_t state) { (void) g; (void) state; } -/** - * @brief Take exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void acquire_bus(GDisplay *g) { (void) g; } -/** - * @brief Release exclusive control of the bus - * - * @param[in] g The GDisplay structure - * - * @notapi - */ static inline void release_bus(GDisplay *g) { (void) g; } -/** - * @brief Send a command to the controller. - * - * @param[in] g The GDisplay structure - * @param[in] cmd The command to send * - * - * @notapi - */ static inline void write_cmd(GDisplay *g, uint8_t cmd) { (void) g; (void) cmd; } -/** - * @brief Send data to the lcd. - * - * @param[in] g The GDisplay structure - * @param[in] data The data to send - * - * @notapi - */ static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) { (void) g; (void) data; @@ -116,5 +50,3 @@ static inline void write_data(GDisplay *g, uint8_t* data, uint16_t length) { } #endif /* _GDISP_LLD_BOARD_H */ -/** @} */ - diff --git a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c index b3029391..8d331fbc 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_ST7565.c +++ b/drivers/gdisp/ST7565/gdisp_lld_ST7565.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/ST7565/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for the ST7565 display. - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -77,7 +72,7 @@ /* Driver exported functions. */ /*===========================================================================*/ -/** +/* * As this controller can't update on a pixel boundary we need to maintain the * the entire display surface in memory so that we can do the necessary bit * operations. Fortunately it is a small display in monochrome. diff --git a/drivers/gdisp/ST7565/gdisp_lld_config.h b/drivers/gdisp/ST7565/gdisp_lld_config.h index f774e8fa..48587b9e 100644 --- a/drivers/gdisp/ST7565/gdisp_lld_config.h +++ b/drivers/gdisp/ST7565/gdisp_lld_config.h @@ -24,5 +24,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/gdisp/ST7565/st7565.h b/drivers/gdisp/ST7565/st7565.h index 9542dd3f..48636b33 100644 --- a/drivers/gdisp/ST7565/st7565.h +++ b/drivers/gdisp/ST7565/st7565.h @@ -35,5 +35,3 @@ #define ST7565_POWER_CONTROL 0x28 #endif /* _ST7565_H */ -/** @} */ - diff --git a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c index f87826aa..4051c818 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_TestStub.c +++ b/drivers/gdisp/TestStub/gdisp_lld_TestStub.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/TestStub/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source (stub). - */ - #include "gfx.h" #if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ diff --git a/drivers/gdisp/TestStub/gdisp_lld_config.h b/drivers/gdisp/TestStub/gdisp_lld_config.h index 63471c6c..53111358 100644 --- a/drivers/gdisp/TestStub/gdisp_lld_config.h +++ b/drivers/gdisp/TestStub/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/gdisp/TestStub/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header (stub). - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -30,4 +22,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial.c b/drivers/ginput/dial/GADC/ginput_lld_dial.c index cefe5689..c07419bc 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial.c +++ b/drivers/ginput/dial/GADC/ginput_lld_dial.c @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/dial/GADC/ginput_lld_dial.c - * @brief GINPUT Dial low level driver source for GADC hardware. - * - * @defgroup Dial Dial - * @ingroup GINPUT - * @{ - */ - #include "gfx.h" #if GFX_USE_GINPUT && GINPUT_NEED_DIAL @@ -83,4 +74,3 @@ void ginput_lld_dial_poll(DialCallbackFn fn) { } #endif /* GFX_USE_GINPUT && GINPUT_NEED_DIAL */ -/** @} */ diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial_board_template.h b/drivers/ginput/dial/GADC/ginput_lld_dial_board_template.h index 202b5386..e10e52f6 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial_board_template.h +++ b/drivers/ginput/dial/GADC/ginput_lld_dial_board_template.h @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/dial/GADC/ginput_lld_dial_board_template.h - * @brief GINPUT Dial Driver config file. - * - * @defgroup Dial Dial - * @ingroup GINPUT - * @{ - */ - #ifndef _GINPUT_LLD_DIAL_BOARD_H #define _GINPUT_LLD_DIAL_BOARD_H @@ -32,5 +23,3 @@ #endif /* GFX_USE_GINPUT && GINPUT_NEED_DIAL */ #endif /* _GINPUT_LLD_DIAL_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/dial/GADC/ginput_lld_dial_config.h b/drivers/ginput/dial/GADC/ginput_lld_dial_config.h index 3e54b4ca..45c61c1d 100644 --- a/drivers/ginput/dial/GADC/ginput_lld_dial_config.h +++ b/drivers/ginput/dial/GADC/ginput_lld_dial_config.h @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/dial/GADC/ginput_lld_dial_config.h - * @brief GINPUT Dial Driver configuration header. - * - * @defgroup Dial Dial - * @ingroup GINPUT - * @{ - */ - #ifndef _GINPUT_LLD_DIAL_CONFIG_H #define _GINPUT_LLD_DIAL_CONFIG_H @@ -27,4 +18,3 @@ #endif /* GFX_USE_GDISP && GINPUT_NEED_DIAL */ #endif /* _GINPUT_LLD_DIAL_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c index 09290f17..f42d222f 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle.c +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle.c @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/toggle/Pal/ginput_lld_toggle.c - * @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware. - * - * @defgroup Toggle Toggle - * @ingroup GINPUT - * @{ - */ - #include "gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_TOGGLE) /*|| defined(__DOXYGEN__)*/ @@ -22,27 +13,12 @@ GINPUT_TOGGLE_DECLARE_STRUCTURE(); -/** - * @brief Initialise the port. - * - * @param[in] ptc A pointer to one of the entries in GInputToggleConfigTable - * - * @notapi - */ void ginput_lld_toggle_init(const GToggleConfig *ptc) { palSetGroupMode(((IOBus *)ptc->id)->portid, ptc->mask, 0, ptc->mode); } -/** - * @brief Get the bits from the port. - * - * @param[in] ptc A pointer to one of the entries in GInputToggleConfigTable - * - * @notapi - */ unsigned ginput_lld_toggle_getbits(const GToggleConfig *ptc) { return palReadBus((IOBus *)ptc->id); } #endif /* GFX_USE_GINPUT && GINPUT_NEED_TOGGLE */ -/** @} */ diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_template.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_template.h index 84038d16..049160f5 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_template.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_board_template.h @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_board_template.h - * @brief GINPUT Toggle low level driver source for the ChibiOS PAL hardware on the example board. - * - * @defgroup Toggle Toggle - * @ingroup GINPUT - * @{ - */ - #ifndef _GDISP_LLD_TOGGLE_BOARD_H #define _GDISP_LLD_TOGGLE_BOARD_H @@ -45,4 +36,3 @@ } #endif /* _GDISP_LLD_TOGGLE_BOARD_H */ -/** @} */ diff --git a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h index 84155956..0ae2aa3f 100644 --- a/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h +++ b/drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h @@ -3,15 +3,6 @@ * the license was not distributed with this file, you can obtain one at: * * http://ugfx.org/license.html - */ - -/** - * @file drivers/ginput/toggle/Pal/ginput_lld_toggle_config.h - * @brief GINPUT Toggle Driver configuration header. - * - * @defgroup Toggle Toggle - * @ingroup GINPUT - * @{ */ #ifndef _GINPUT_LLD_TOGGLE_CONFIG_H @@ -25,4 +16,3 @@ #endif /* GFX_USE_GDISP && GINPUT_NEED_TOGGLE */ #endif /* _GINPUT_LLD_TOGGLE_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c index 890b65ae..cb9b6f4e 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse.c @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse.c - * @brief GINPUT Touch low level driver source for the ADS7843. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - #include "gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ @@ -34,13 +25,6 @@ static uint16_t sampleBuf[7]; static coord_t lastx, lasty; -/** - * @brief 7-point median filtering code for touch samples - * - * @note This is an internally used routine only. - * - * @notapi - */ static void filter(void) { uint16_t temp; int i,j; @@ -57,29 +41,10 @@ static void filter(void) { } } -/** - * @brief Initialise the mouse/touch. - * - * @notapi - */ void ginput_lld_mouse_init(void) { init_board(); } -/** - * @brief Read the mouse/touch position. - * - * @param[in] pt A pointer to the structure to fill - * - * @note For drivers that don't support returning a position - * when the touch is up (most touch devices), it should - * return the previous position with the new Z value. - * The z value is the pressure for those touch devices - * that support it (-100 to 100 where > 0 is touched) - * or, 0 or 100 for those drivers that don't. - * - * @notapi - */ void ginput_lld_mouse_get_reading(MouseReading *pt) { uint16_t i; @@ -127,4 +92,3 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { } #endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */ -/** @} */ diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h index b4699c76..09783adf 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h @@ -5,67 +5,27 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_board_template.h - * @brief GINPUT Touch low level driver source for the ADS7843 on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - #ifndef _GINPUT_LLD_MOUSE_BOARD_H #define _GINPUT_LLD_MOUSE_BOARD_H -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ static inline void init_board(void) { } -/** - * @brief Check whether the surface is currently touched - * @return TRUE if the surface is currently touched - * - * @notapi - */ static inline bool_t getpin_pressed(void) { } -/** - * @brief Aquire the bus ready for readings - * - * @notapi - */ static inline void aquire_bus(void) { } -/** - * @brief Release the bus after readings - * - * @notapi - */ static inline void release_bus(void) { } -/** - * @brief Read a value from touch controller - * @return The value read from the controller - * - * params[in] port The controller port to read. - * - * @notapi - */ static inline uint16_t read_value(uint16_t port) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h index 5c959521..31840a51 100644 --- a/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/ADS7843/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -29,4 +19,3 @@ #define GINPUT_MOUSE_CLICK_TIME 500 #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/touch/FT5x06/ft5x06.h b/drivers/ginput/touch/FT5x06/ft5x06.h index 2b91d1c6..bfc1d080 100644 --- a/drivers/ginput/touch/FT5x06/ft5x06.h +++ b/drivers/ginput/touch/FT5x06/ft5x06.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/FT5x06/ft5x06.h - * @brief Register definition header for the STMPE811 touch controller. - * - * @addtogroup GINPUT - * @{ - */ - #ifndef _FT5x06_H #define _FT5x06_H @@ -78,5 +70,3 @@ #define FT5x06_ID_G_ERR 0xA9 #endif /* _FT5x06_H */ -/** @} */ - diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse.c b/drivers/ginput/touch/FT5x06/ginput_lld_mouse.c index 43baa9b7..7a50c5f6 100644 --- a/drivers/ginput/touch/FT5x06/ginput_lld_mouse.c +++ b/drivers/ginput/touch/FT5x06/ginput_lld_mouse.c @@ -5,15 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse.c - * @brief GINPUT Touch low level driver source for the STMPE811. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - #include "gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ @@ -28,11 +19,6 @@ static coord_t x, y, z; static uint8_t touched; -/** - * @brief Initialise the mouse/touch. - * - * @notapi - */ void ginput_lld_mouse_init(void) { init_board(); @@ -65,20 +51,6 @@ void ginput_lld_mouse_init(void) { write_reg(FT5x06_ID_G_PERIODMONITOR, 1, 0x28); } -/** - * @brief Read the mouse/touch position. - * - * @param[in] pt A pointer to the structure to fill - * - * @note For drivers that don't support returning a position - * when the touch is up (most touch devices), it should - * return the previous position with the new Z value. - * The z value is the pressure for those touch devices - * that support it (-100 to 100 where > 0 is touched) - * or, 0 or 100 for those drivers that don't. - * - * @notapi - */ void ginput_lld_mouse_get_reading(MouseReading *pt) { // Poll to get the touched status uint8_t last_touched; @@ -114,5 +86,3 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { } #endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */ -/** @} */ - diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h index d13881da..b7744a49 100644 --- a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h +++ b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h @@ -5,64 +5,23 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/FT5x06/ginput_lld_mouse_board_template.h - * @brief GINPUT Touch low level driver source for the FT5x06 on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - #ifndef _GINPUT_LLD_MOUSE_BOARD_H #define _GINPUT_LLD_MOUSE_BOARD_H -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ static void init_board(void) { } -/** - * @brief Check whether an interrupt is raised - * @return TRUE if there is an interrupt signal present - * - * @notapi - */ static inline bool_t getpin_irq(void) { } -/** - * @brief Write a value into a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * @param[in] val The value - * - * @notapi - */ static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { } -/** - * @brief Read the value of a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * - * @return Data read from device (one byte or two depending on n param) - * - * @notapi - */ static uint16_t read_reg(uint8_t reg, uint8_t n) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_config.h b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_config.h index 57d3f135..24335a0a 100644 --- a/drivers/ginput/touch/FT5x06/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/FT5x06/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -29,4 +19,3 @@ #define GINPUT_MOUSE_CLICK_TIME 450 #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse.c b/drivers/ginput/touch/MCU/ginput_lld_mouse.c index d7a2e314..ad2519e4 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse.c +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse.c @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/MCU/ginput_lld_mouse.c - * @brief GINPUT Touch low level driver source for the MCU. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #include "gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ @@ -25,13 +15,6 @@ static uint16_t sampleBuf[7]; -/** - * @brief 7-point median filtering code for touchscreen samples - * - * @note This is an internally used routine only. - * - * @notapi - */ static void filter(void) { uint16_t temp; int i,j; @@ -48,31 +31,10 @@ static void filter(void) { } } -/** - * @brief Initialise the mouse/touch. - * - * @notapi - */ void ginput_lld_mouse_init(void) { init_board(); } -/** - * @brief Read the mouse/touch position. - * - * @param[in] pt A pointer to the structure to fill - * - * @note We use a 7 sample medium filter on each coordinate to remove analogue noise. - * @note During touch transition the ADC can return some very strange - * results. To fix this behaviour we don't return until - * we have tested the touch is in the same state at both the beginning - * and the end of the reading. - * @note Whilst x and y can return readings in any range so long as it fits in 16 bits, - * the z value must be ranged by the board file to be a rough percentage. Anything - * greater than 80% pressure is a touch. - * - * @notapi - */ void ginput_lld_mouse_get_reading(MouseReading *pt) { uint16_t i; @@ -116,4 +78,3 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) { } #endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */ -/** @} */ diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h index 52af9269..e213bcb9 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h @@ -5,105 +5,37 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/MCU/ginput_lld_mouse_board_template.h - * @brief GINPUT Touch low level driver source for the MCU on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _GINPUT_LLD_MOUSE_BOARD_H #define _GINPUT_LLD_MOUSE_BOARD_H -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ static inline void init_board(void) { } -/** - * @brief Acquire the bus ready for readings - * - * @notapi - */ static inline void aquire_bus(void) { } -/** - * @brief Release the bus after readings - * - * @notapi - */ static inline void release_bus(void) { } -/** - * @brief Set up the device for a x coordinate read - * @note This is performed once followed by multiple - * x coordinate read's (which are then median filtered) - * - * @notapi - */ static inline void setup_x(void) { } -/** - * @brief Set up the device for a y coordinate read - * @note This is performed once followed by multiple - * y coordinate read's (which are then median filtered) - * - * @notapi - */ static inline void setup_y(void) { } -/** - * @brief Set up the device for a z coordinate (pressure) read - * @note This is performed once followed by multiple - * z coordinate read's (which are then median filtered) - * - * @notapi - */ static inline void setup_z(void) { palClearPad(GPIOB, GPIOB_DRIVEA); palClearPad(GPIOB, GPIOB_DRIVEB); chThdSleepMilliseconds(2); } -/** - * @brief Read an x value from touch controller - * @return The value read from the controller - * - * @notapi - */ static inline uint16_t read_x(void) { } -/** - * @brief Read a y value from touch controller - * @return The value read from the controller - * - * @notapi - */ static inline uint16_t read_y(void) { } -/** - * @brief Read a z value from touch controller - * @return The value read from the controller. - * @note The return value must be scaled between 0 and 100. - * Values over 80 are considered as "touch" down. - * - * @notapi - */ static inline uint16_t read_z(void) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h b/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h index 0c9e9300..328e6337 100644 --- a/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h +++ b/drivers/ginput/touch/MCU/ginput_lld_mouse_config_template.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/MCU/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -29,4 +19,3 @@ #define GINPUT_MOUSE_CLICK_TIME 500 #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c index d650e603..e658fae2 100644 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse.c @@ -4,16 +4,7 @@ * * http://ugfx.org/license.html */ - -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse.c - * @brief GINPUT Touch low level driver source for the STMPE811. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - + #include "gfx.h" #if (GFX_USE_GINPUT && GINPUT_NEED_MOUSE) /*|| defined(__DOXYGEN__)*/ @@ -43,11 +34,6 @@ static void setActiveWindow(uint16_t bl_x, uint16_t bl_y, uint16_t tr_x, uint16_ write_reg(STMPE811_REG_WDW_BL_Y, 2, bl_y); } -/** - * @brief Initialise the mouse/touch. - * - * @notapi - */ void ginput_lld_mouse_init(void) { init_board(); @@ -81,20 +67,6 @@ void ginput_lld_mouse_init(void) write_reg(STMPE811_REG_INT_CTRL, 1, 0x01); // Level interrupt, enable intrrupts } -/** - * @brief Read the mouse/touch position. - * - * @param[in] pt A pointer to the structure to fill - * - * @note For drivers that don't support returning a position - * when the touch is up (most touch devices), it should - * return the previous position with the new Z value. - * The z value is the pressure for those touch devices - * that support it (-100 to 100 where > 0 is touched) - * or, 0 or 100 for those drivers that don't. - * - * @notapi - */ void ginput_lld_mouse_get_reading(MouseReading *pt) { bool_t clearfifo; // Do we need to clear the FIFO @@ -158,5 +130,3 @@ void ginput_lld_mouse_get_reading(MouseReading *pt) } #endif /* GFX_USE_GINPUT && GINPUT_NEED_MOUSE */ -/** @} */ - diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h index 3df898da..b7744a49 100644 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h @@ -5,64 +5,23 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_board_template.h - * @brief GINPUT Touch low level driver source for the STMPE811 on the example board. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * @{ - */ - #ifndef _GINPUT_LLD_MOUSE_BOARD_H #define _GINPUT_LLD_MOUSE_BOARD_H -/** - * @brief Initialise the board for the touch. - * - * @notapi - */ static void init_board(void) { } -/** - * @brief Check whether an interrupt is raised - * @return TRUE if there is an interrupt signal present - * - * @notapi - */ static inline bool_t getpin_irq(void) { } -/** - * @brief Write a value into a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * @param[in] val The value - * - * @notapi - */ static void write_reg(uint8_t reg, uint8_t n, uint16_t val) { } -/** - * @brief Read the value of a certain register - * - * @param[in] reg The register address - * @param[in] n The amount of bytes (one or two) - * - * @return Data read from device (one byte or two depending on n param) - * - * @notapi - */ static uint16_t read_reg(uint8_t reg, uint8_t n) { } #endif /* _GINPUT_LLD_MOUSE_BOARD_H */ -/** @} */ - diff --git a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h index c7427958..5cd512eb 100644 --- a/drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h +++ b/drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/STMPE811/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -33,4 +23,3 @@ #define STMP811_NO_GPIO_IRQPIN FALSE #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ diff --git a/drivers/ginput/touch/STMPE811/stmpe811.h b/drivers/ginput/touch/STMPE811/stmpe811.h index 494b5f5c..1ee9c211 100644 --- a/drivers/ginput/touch/STMPE811/stmpe811.h +++ b/drivers/ginput/touch/STMPE811/stmpe811.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/ginput/touch/STMPE811/stmpe811.h - * @brief Register definition header for the STMPE811 touch controller. - * - * @addtogroup GINPUT - * @{ - */ - #ifndef _STMPE811_H #define _STMPE811_H @@ -89,4 +81,3 @@ #define STMPE811_REG_TEMP_TH 0x62 #endif /* _STMPE811_H */ -/** @} */ diff --git a/drivers/multiple/Win32/gdisp_lld_Win32.c b/drivers/multiple/Win32/gdisp_lld_Win32.c index 7bd9379f..3643d727 100644 --- a/drivers/multiple/Win32/gdisp_lld_Win32.c +++ b/drivers/multiple/Win32/gdisp_lld_Win32.c @@ -5,10 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/Win32/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for Win32. - */ #include "gfx.h" #if GFX_USE_GDISP @@ -1177,4 +1173,3 @@ LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { #endif /* GINPUT_NEED_TOGGLE */ #endif /* GFX_USE_GDISP */ - diff --git a/drivers/multiple/Win32/gdisp_lld_config.h b/drivers/multiple/Win32/gdisp_lld_config.h index 1554161b..659dfb77 100644 --- a/drivers/multiple/Win32/gdisp_lld_config.h +++ b/drivers/multiple/Win32/gdisp_lld_config.h @@ -3,14 +3,6 @@ * the license was not distributed with this file, you can obtain one at: * * http://ugfx.org/license.html - */ - -/** - * @file drivers/multiple/Win32/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for Win32. - * - * @addtogroup GDISP - * @{ */ #ifndef _GDISP_LLD_CONFIG_H @@ -58,5 +50,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/Win32/ginput_lld_mouse_config.h b/drivers/multiple/Win32/ginput_lld_mouse_config.h index a58d92d1..8263ebed 100644 --- a/drivers/multiple/Win32/ginput_lld_mouse_config.h +++ b/drivers/multiple/Win32/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/Win32/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -46,5 +36,3 @@ //#define GINPUT_MOUSE_POLL_PERIOD 25 // Poll driven #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/Win32/ginput_lld_toggle_config.h b/drivers/multiple/Win32/ginput_lld_toggle_config.h index dd0c9b5c..46a30b5f 100644 --- a/drivers/multiple/Win32/ginput_lld_toggle_config.h +++ b/drivers/multiple/Win32/ginput_lld_toggle_config.h @@ -3,16 +3,6 @@ * the license was not distributed with this file, you can obtain one at: * * http://ugfx.org/license.html - */ - -/** - * @file drivers/multiple/Win32/ginput_lld_toggle_config.h - * @brief GINPUT Toggle Driver configuration header. - * - * @defgroup Toggle Toggle - * @ingroup GINPUT - * - * @{ */ #ifndef _GINPUT_LLD_TOGGLE_CONFIG_H @@ -46,5 +36,3 @@ #endif /* GFX_USE_GDISP && GINPUT_NEED_TOGGLE */ #endif /* _GINPUT_LLD_TOGGLE_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/X/gdisp_lld_X.c b/drivers/multiple/X/gdisp_lld_X.c index 940f4f7b..29115f53 100644 --- a/drivers/multiple/X/gdisp_lld_X.c +++ b/drivers/multiple/X/gdisp_lld_X.c @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/X/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for X. - */ - #include "gfx.h" #if GFX_USE_GDISP @@ -18,13 +13,6 @@ #include "drivers/multiple/X/gdisp_lld_config.h" #include "src/gdisp/driver.h" -/** - * Our color model - Default or 24 bit only. - * - * At present we don't define this as we don't need to. - * It may however be useful later if we implement bitblits. - * As this may be dead code we don't include it in gdisp/options.h - */ #ifndef GDISP_FORCE_24BIT #define GDISP_FORCE_24BIT FALSE #endif @@ -336,5 +324,3 @@ LLDSPEC void gdisp_lld_draw_pixel(GDisplay *g) #endif /* GINPUT_NEED_MOUSE */ #endif /* GFX_USE_GDISP */ -/** @} */ - diff --git a/drivers/multiple/X/gdisp_lld_config.h b/drivers/multiple/X/gdisp_lld_config.h index 631ecf46..55d61d74 100644 --- a/drivers/multiple/X/gdisp_lld_config.h +++ b/drivers/multiple/X/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/X/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for the X11 display. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -34,5 +26,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/X/ginput_lld_mouse_config.h b/drivers/multiple/X/ginput_lld_mouse_config.h index dc3d5a20..8263ebed 100644 --- a/drivers/multiple/X/ginput_lld_mouse_config.h +++ b/drivers/multiple/X/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/X/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -46,5 +36,3 @@ //#define GINPUT_MOUSE_POLL_PERIOD 25 // Poll driven #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/uGFXnet/gdisp_lld_config.h b/drivers/multiple/uGFXnet/gdisp_lld_config.h index f67e3192..e181d91e 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_config.h +++ b/drivers/multiple/uGFXnet/gdisp_lld_config.h @@ -5,14 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/uGFXnet/gdisp_lld_config.h - * @brief GDISP Graphic Driver subsystem low level driver header for uGFXnet. - * - * @addtogroup GDISP - * @{ - */ - #ifndef _GDISP_LLD_CONFIG_H #define _GDISP_LLD_CONFIG_H @@ -38,5 +30,3 @@ #endif /* GFX_USE_GDISP */ #endif /* _GDISP_LLD_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c index 18a53580..bfe430df 100644 --- a/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c +++ b/drivers/multiple/uGFXnet/gdisp_lld_uGFXnet.c @@ -5,10 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/Win32/gdisp_lld.c - * @brief GDISP Graphics Driver subsystem low level driver source for uGFX network display. - */ #include "gfx.h" #if GFX_USE_GDISP diff --git a/drivers/multiple/uGFXnet/ginput_lld_mouse_config.h b/drivers/multiple/uGFXnet/ginput_lld_mouse_config.h index b0a0e04f..576df7ee 100644 --- a/drivers/multiple/uGFXnet/ginput_lld_mouse_config.h +++ b/drivers/multiple/uGFXnet/ginput_lld_mouse_config.h @@ -5,16 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/Win32/ginput_lld_mouse_config.h - * @brief GINPUT LLD header file for mouse/touch driver. - * - * @defgroup Mouse Mouse - * @ingroup GINPUT - * - * @{ - */ - #ifndef _LLD_GINPUT_MOUSE_CONFIG_H #define _LLD_GINPUT_MOUSE_CONFIG_H @@ -49,5 +39,3 @@ #define GINPUT_MOUSE_NO_ROTATION TRUE #endif /* _LLD_GINPUT_MOUSE_CONFIG_H */ -/** @} */ - diff --git a/drivers/multiple/uGFXnet/uGFXnetProtocol.h b/drivers/multiple/uGFXnet/uGFXnetProtocol.h index 153a3adf..521cca0f 100644 --- a/drivers/multiple/uGFXnet/uGFXnetProtocol.h +++ b/drivers/multiple/uGFXnet/uGFXnetProtocol.h @@ -5,11 +5,6 @@ * http://ugfx.org/license.html */ -/** - * @file drivers/multiple/uGFXnet/uGFXnetProtocol.h - * @brief GDISP uGFXnet protocol header. - */ - #define GNETCODE_VERSION GNETCODE_VERSION_1_0 // The current protocol version // The list of possible protocol version numbers -- cgit v1.2.3 From c16cb15ce9b5e4cc1a913def9614f8a587bc0868 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 30 Mar 2014 19:08:53 +1000 Subject: Fix definition of when GADC is turned on for GADC audio driver --- drivers/gaudio/gadc/driver.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gaudio/gadc/driver.mk b/drivers/gaudio/gadc/driver.mk index 8e943577..b5a2768a 100644 --- a/drivers/gaudio/gadc/driver.mk +++ b/drivers/gaudio/gadc/driver.mk @@ -5,5 +5,5 @@ GFXSRC += $(GFXLIB)/drivers/gaudio/gadc/gaudio_record_lld.c GFXINC += $(GFXLIB)/drivers/gaudio/gadc # Make sure the GADC sub-system is turned on -GFXDEFS += -DGFX_USE_GADC=TRUE +GFXDEFS += -DGFX_USE_GADC=GAUDIO_NEED_RECORD -- cgit v1.2.3 From 04f03ea71da1337c501b598c6038afaf0216fed8 Mon Sep 17 00:00:00 2001 From: inmarket Date: Sun, 30 Mar 2014 19:10:31 +1000 Subject: New PWM audio driver for audio output using a digital pin on a CPU --- drivers/gaudio/pwm/driver.mk | 5 + drivers/gaudio/pwm/gaudio_play_board_template.h | 38 ++++++++ drivers/gaudio/pwm/gaudio_play_config.h | 34 +++++++ drivers/gaudio/pwm/gaudio_play_lld.c | 117 ++++++++++++++++++++++++ drivers/gaudio/pwm/readme.txt | 12 +++ 5 files changed, 206 insertions(+) create mode 100644 drivers/gaudio/pwm/driver.mk create mode 100644 drivers/gaudio/pwm/gaudio_play_board_template.h create mode 100644 drivers/gaudio/pwm/gaudio_play_config.h create mode 100644 drivers/gaudio/pwm/gaudio_play_lld.c create mode 100644 drivers/gaudio/pwm/readme.txt (limited to 'drivers') diff --git a/drivers/gaudio/pwm/driver.mk b/drivers/gaudio/pwm/driver.mk new file mode 100644 index 00000000..52f752aa --- /dev/null +++ b/drivers/gaudio/pwm/driver.mk @@ -0,0 +1,5 @@ +# List the required driver. +GFXSRC += $(GFXLIB)/drivers/gaudio/pwm/gaudio_play_lld.c + +# Required include directories +GFXINC += $(GFXLIB)/drivers/gaudio/pwm diff --git a/drivers/gaudio/pwm/gaudio_play_board_template.h b/drivers/gaudio/pwm/gaudio_play_board_template.h new file mode 100644 index 00000000..24039d17 --- /dev/null +++ b/drivers/gaudio/pwm/gaudio_play_board_template.h @@ -0,0 +1,38 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GAUDIO_PLAY_BOARD_H +#define GAUDIO_PLAY_BOARD_H + +/* + * This routine is defined in the driver - the timer interrupt should call this routine. + * + * static void gaudio_play_pwm_timer_callbackI(void); + * + */ + +static bool gaudio_play_pwm_setup(uint32_t frequency, ArrayDataFormat format) { + /* Initialise the PWM - use a midpoint value for the initial PWM value */ + /* Initialise the timer interrupt @ frequency */ + /* Return FALSE if any parameter invalid */ +} + +static void gaudio_play_pwm_start(void) { + /* Start the PWM */ + /* Start the timer interrupt */ +} + +static void gaudio_play_pwm_stop(void) { + /* Stop the timer interrupt */ + /* Stop the PWM */ +} + +static void gaudio_play_pwm_setI(uint16_t value) { + /* Set the PWM value */ +} + +#endif /* GAUDIO_PLAY_BOARD_H */ diff --git a/drivers/gaudio/pwm/gaudio_play_config.h b/drivers/gaudio/pwm/gaudio_play_config.h new file mode 100644 index 00000000..9c65cd11 --- /dev/null +++ b/drivers/gaudio/pwm/gaudio_play_config.h @@ -0,0 +1,34 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GAUDIO_PLAY_CONFIG_H +#define GAUDIO_PLAY_CONFIG_H + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +/* These may need to change for your hardware. If so copy this file to your + * project directory and then alter it. + * The maximum sample frequency should be less than + * Max PWM Clock / (2 ^ Bits per sample) + * eg. For the AT91SAM7 max PWM clock = 48MHz / 2 + * For 10 bit PWM accuracy that means GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY = 23,437 Hz + */ +#define GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY 22000 +#define GAUDIO_PLAY_NUM_FORMATS 2 +#define GAUDIO_PLAY_FORMAT1 ARRAY_DATA_10BITUNSIGNED +#define GAUDIO_PLAY_FORMAT2 ARRAY_DATA_8BITUNSIGNED +#define GAUDIO_PLAY_NUM_CHANNELS 1 +#define GAUDIO_PLAY_CHANNEL0_IS_STEREO FALSE +#define GAUDIO_PLAY_MONO 0 + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ + +#endif /* GAUDIO_PLAY_CONFIG_H */ diff --git a/drivers/gaudio/pwm/gaudio_play_lld.c b/drivers/gaudio/pwm/gaudio_play_lld.c new file mode 100644 index 00000000..07fd14b2 --- /dev/null +++ b/drivers/gaudio/pwm/gaudio_play_lld.c @@ -0,0 +1,117 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/* Include the driver defines */ +#include "src/gaudio/driver_play.h" + +/* Forward definition */ +static void gaudio_play_pwm_timer_callbackI(void); + +/* Include the board interface */ +#include "gaudio_play_board.h" + +static GDataBuffer *pplay; +static ArrayDataFormat playfmt; +static size_t playlen; +static uint8_t *pdata; + +static void gaudio_play_pwm_timer_callbackI(void) { + if (pplay) { + + // Get the next value from the current data buffer + if (gfxSampleFormatBits(playfmt) > 8) { + gaudio_play_pwm_setI(*(uint16_t *)pdata); + pdata += 2; + } else { + gaudio_play_pwm_setI(*pdata); + pdata++; + } + + // Are we done yet + if (--playlen) + return; + gaudioPlayReleaseDataBlockI(pplay); + + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) { + // All is done + gaudioPlayDoneI(); + return; + } + + } else { + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + if (gfxSampleFormatBits(playfmt) > 8) + playlen >>= 1; + pdata = (uint8_t *)(pplay+1); +} + + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + (void) channel; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_10BITUNSIGNED) + return FALSE; + + playfmt = format; + return gaudio_play_pwm_setup(frequency, format); +} + +bool_t gaudio_play_lld_set_volume(uint8_t vol) { + (void) vol; + return FALSE; +} + +void gaudio_play_lld_start(void) { + + gfxSystemLock(); + // Get a new data buffer + if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { + gfxSystemUnlock(); // Nothing to do + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + if (gfxSampleFormatBits(playfmt) > 8) + playlen >>= 1; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + + // Start the playing + gaudio_play_pwm_start(); +} + +void gaudio_play_lld_stop(void) { + // Stop everything + gaudio_play_pwm_stop(); + + // We may need to clean up the remaining buffer. + gfxSystemLock(); + if (pplay) { + gaudioPlayReleaseDataBlockI(pplay); + pplay = 0; + gaudioPlayDoneI(); + } + gfxSystemUnlock(); +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/pwm/readme.txt b/drivers/gaudio/pwm/readme.txt new file mode 100644 index 00000000..1dd3ed9a --- /dev/null +++ b/drivers/gaudio/pwm/readme.txt @@ -0,0 +1,12 @@ +This driver uses a PWM output and a timer to implement an audio play channel. + +Whilst the default config settings will probably work for your hardware, you may need to change them. +If so copy gaudio_play_config.h to your project directory and then alter it. + +The maximum sample frequency is governed primarily by the number of bits of resolution and the +maximum PWM clock rate. The maximum sample frequency should be less than... + + Max PWM Clock / (2 ^ Bits per sample) + +eg. For the AT91SAM7 max PWM clock = 48MHz / 2 + For 10 bit PWM accuracy that means GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY = 23,437 Hz -- cgit v1.2.3 From 1454d20f2eb2a64acadbefefbc1072c65bd7a4b1 Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 17 Apr 2014 23:06:45 +0200 Subject: Added LGDP4532 display driver --- drivers/gdisp/LGD4532/board_LGD4532_template.h | 71 +++++ drivers/gdisp/LGD4532/gdisp_lld.mk | 2 + drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c | 359 +++++++++++++++++++++++++ drivers/gdisp/LGD4532/gdisp_lld_config.h | 21 ++ 4 files changed, 453 insertions(+) create mode 100644 drivers/gdisp/LGD4532/board_LGD4532_template.h create mode 100644 drivers/gdisp/LGD4532/gdisp_lld.mk create mode 100644 drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c create mode 100644 drivers/gdisp/LGD4532/gdisp_lld_config.h (limited to 'drivers') diff --git a/drivers/gdisp/LGD4532/board_LGD4532_template.h b/drivers/gdisp/LGD4532/board_LGD4532_template.h new file mode 100644 index 00000000..ca89cdc1 --- /dev/null +++ b/drivers/gdisp/LGD4532/board_LGD4532_template.h @@ -0,0 +1,71 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GDISP_LLD_BOARD_H +#define GDISP_LLD_BOARD_H + +static inline void init_board(GDisplay *g) +{ + (void) g; +} + +static inline void post_init_board(GDisplay *g) +{ + (void) g; +} + +static inline void setpin_reset(GDisplay *g, bool_t state) +{ + (void) g; + (void) state; +} + +static inline void set_backlight(GDisplay *g, uint8_t percent) +{ + (void) g; + (void) percent; +} + +static inline void acquire_bus(GDisplay *g) +{ + (void) g; +} + +static inline void release_bus(GDisplay *g) +{ + (void) g; +} + +static inline void write_index(GDisplay *g, uint16_t index) +{ + (void) g; + (void) index; +} + +static inline void write_data(GDisplay *g, uint16_t data) +{ + (void) g; + (void) data; +} + +static inline void setreadmode(GDisplay *g) +{ + (void) g; +} + +static inline void setwritemode(GDisplay *g) +{ + (void) g; +} + +static inline uint16_t read_data(GDisplay *g) +{ + (void) g; + return 0; +} + +#endif /* GDISP_LLD_BOARD_H */ diff --git a/drivers/gdisp/LGD4532/gdisp_lld.mk b/drivers/gdisp/LGD4532/gdisp_lld.mk new file mode 100644 index 00000000..8323b891 --- /dev/null +++ b/drivers/gdisp/LGD4532/gdisp_lld.mk @@ -0,0 +1,2 @@ +GFXINC += $(GFXLIB)/drivers/gdisp/LGD4532 +GFXSRC += $(GFXLIB)/drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c diff --git a/drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c b/drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c new file mode 100644 index 00000000..1cd58f16 --- /dev/null +++ b/drivers/gdisp/LGD4532/gdisp_lld_LGD4532.c @@ -0,0 +1,359 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP + +/* This controller is only ever used with a 240 x 320 display */ +#if defined(GDISP_SCREEN_HEIGHT) + #warning "GDISP: This low level driver does not support setting a screen size. It is being ignored." + #undef GDISP_SCREEN_HEIGHT +#endif +#if defined(GDISP_SCREEN_WIDTH) + #warning "GDISP: This low level driver does not support setting a screen size. It is being ignored." + #undef GDISP_SCREEN_WIDTH +#endif + +#define GDISP_DRIVER_VMT GDISPVMT_LGD4532 +#include "gdisp_lld_config.h" +#include "src/gdisp/driver.h" + +#include "board_LGD4532.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 320 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 240 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 50 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +// Some common routines and macros +#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } + +static void set_cursor(GDisplay *g) { + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + write_reg(g, 0x20, g->p.x); + write_reg(g, 0x21, g->p.y); + break; + + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + write_reg(g, 0x20, g->p.y); + write_reg(g, 0x21, g->p.x); + break; + } + write_index(g, 0x22); +} + +static void set_viewport(GDisplay* g) { + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + write_reg(g, 0x50, g->p.x); + write_reg(g, 0x51, g->p.x + g->p.cx - 1); + write_reg(g, 0x52, g->p.y); + write_reg(g, 0x53, g->p.y + g->p.cy - 1); + break; + + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + write_reg(g, 0x50, g->p.y); + write_reg(g, 0x51, g->p.y + g->p.cy - 1); + write_reg(g, 0x52, g->p.x); + write_reg(g, 0x53, g->p.x + g->p.cx - 1); + break; + } +} + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + // No private area for this controller + g->priv = 0; + + // Initialise the board interface + init_board(g); + + /* Hardware reset */ + setpin_reset(g, TRUE); + gfxSleepMilliseconds(1); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(2); + + acquire_bus(g); + setwritemode(g); + + // chinese code starts here + //############# void Power_Set(void) ################// + write_reg(g, 0x00, 0x0001); + gfxSleepMilliseconds(10); + + write_reg(g, 0x15, 0x0030); + write_reg(g, 0x11, 0x0040); + write_reg(g, 0x10, 0x1628); + write_reg(g, 0x12, 0x0000); + write_reg(g, 0x13, 0x104d); + gfxSleepMilliseconds(10); + write_reg(g, 0x12, 0x0010); + gfxSleepMilliseconds(10); + write_reg(g, 0x10, 0x2620); + write_reg(g, 0x13, 0x344d); //304d + gfxSleepMilliseconds(10); + + write_reg(g, 0x01, 0x0100); + write_reg(g, 0x02, 0x0300); + write_reg(g, 0x03, 0x1038);//0x1030 + write_reg(g, 0x08, 0x0604); + write_reg(g, 0x09, 0x0000); + write_reg(g, 0x0A, 0x0008); + + write_reg(g, 0x41, 0x0002); + write_reg(g, 0x60, 0xA700); + write_reg(g, 0x61, 0x0001); + write_reg(g, 0x90, 0x0182); + write_reg(g, 0x93, 0x0001); + write_reg(g, 0xa3, 0x0010); + gfxSleepMilliseconds(10); + + //################# void Gamma_Set(void) ####################// + write_reg(g, 0x30, 0x0000); + write_reg(g, 0x31, 0x0502); + write_reg(g, 0x32, 0x0307); + write_reg(g, 0x33, 0x0305); + write_reg(g, 0x34, 0x0004); + write_reg(g, 0x35, 0x0402); + write_reg(g, 0x36, 0x0707); + write_reg(g, 0x37, 0x0503); + write_reg(g, 0x38, 0x1505); + write_reg(g, 0x39, 0x1505); + gfxSleepMilliseconds(10); + + //################## void Display_ON(void) ####################// + write_reg(g, 0x07, 0x0001); + gfxSleepMilliseconds(10); + write_reg(g, 0x07, 0x0021); + write_reg(g, 0x07, 0x0023); + gfxSleepMilliseconds(10); + write_reg(g, 0x07, 0x0033); + gfxSleepMilliseconds(10); + write_reg(g, 0x07, 0x0133); + // chinese code ends here + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + // Turn on the backlight + set_backlight(g, GDISP_INITIAL_BACKLIGHT); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + + return TRUE; +} + +#if GDISP_HARDWARE_STREAM_WRITE + LLDSPEC void gdisp_lld_write_start(GDisplay *g) { + acquire_bus(g); + set_viewport(g); + } + LLDSPEC void gdisp_lld_write_color(GDisplay *g) { + write_data(g, gdispColor2Native(g->p.color)); + } + LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { + release_bus(g); + } + LLDSPEC void gdisp_lld_write_pos(GDisplay *g) { + set_cursor(g); + } +#endif + +#if GDISP_HARDWARE_STREAM_READ + LLDSPEC void gdisp_lld_read_start(GDisplay *g) { + acquire_bus(g); + set_viewport(g); + set_cursor(g); + setreadmode(g); + dummy_read(g); + } + LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + uint16_t data; + + data = read_data(g); + return gdispNative2Color(data); + } + LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { + setwritemode(g); + release_bus(g); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); + write_reg(g, 0x10, 0x0000); + write_reg(g, 0x11, 0x0000); + write_reg(g, 0x12, 0x0000); + write_reg(g, 0x13, 0x0000); + release_bus(g); + set_backlight(g, 0); + break; + + case powerOn: + //*************Power On sequence ******************// + acquire_bus(g); + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x17B0); /* SAP, BT[3:0], AP, DSTB, SLP, STB */ + write_reg(g, 0x11, 0x0147); /* DC1[2:0], DC0[2:0], VC[2:0] */ + gfxSleepMilliseconds(50); + write_reg(g, 0x12, 0x013C); /* VREG1OUT voltage */ + gfxSleepMilliseconds(50); + write_reg(g, 0x13, 0x0E00); /* VDV[4:0] for VCOM amplitude */ + write_reg(g, 0x29, 0x0009); /* VCM[4:0] for VCOMH */ + gfxSleepMilliseconds(50); + write_reg(g, 0x07, 0x0173); /* 262K color and display ON */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + case powerSleep: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); /* display OFF */ + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + case powerDeepSleep: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); /* display OFF */ + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + case GDISP_ROTATE_0: + acquire_bus(g); + write_reg(g, 0x01, 0x0100); + write_reg(g, 0x03, 0x1030); + write_reg(g, 0x60, 0x2700); + release_bus(g); + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + + case GDISP_ROTATE_90: + acquire_bus(g); + write_reg(g, 0x01, 0x0100); + write_reg(g, 0x03, 0x1038); + write_reg(g, 0x60, 0xA700); + release_bus(g); + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + + case GDISP_ROTATE_180: + acquire_bus(g); + write_reg(g, 0x01, 0x0000); + write_reg(g, 0x03, 0x1030); + write_reg(g, 0x60, 0xa700); + release_bus(g); + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + + case GDISP_ROTATE_270: + acquire_bus(g); + write_reg(g, 0x01, 0x0000); + write_reg(g, 0x03, 0x1038); + write_reg(g, 0x60, 0x2700); + release_bus(g); + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + + default: + return; + } + + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_BACKLIGHT: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + set_backlight(g, (unsigned)g->p.ptr); + g->g.Backlight = (unsigned)g->p.ptr; + return; + + default: + return; + } + } +#endif + +#endif /* GFX_USE_GDISP */ diff --git a/drivers/gdisp/LGD4532/gdisp_lld_config.h b/drivers/gdisp/LGD4532/gdisp_lld_config.h new file mode 100644 index 00000000..3f11ecc3 --- /dev/null +++ b/drivers/gdisp/LGD4532/gdisp_lld_config.h @@ -0,0 +1,21 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GDISP_LLD_CONFIG_H +#define GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +#define GDISP_HARDWARE_STREAM_WRITE TRUE +#define GDISP_HARDWARE_STREAM_READ TRUE +#define GDISP_HARDWARE_STREAM_POS TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB565 + +#endif /* GFX_USE_GDISP */ +#endif /* _GDISP_LLD_CONFIG_H */ -- cgit v1.2.3 From d76104fefe8b1969945cfcae8f5f9b2be756807c Mon Sep 17 00:00:00 2001 From: Joel Bodenmann Date: Thu, 24 Apr 2014 22:52:37 +0200 Subject: Added ILI93xx drived by user xlh1460 --- drivers/gdisp/ILI93xx/board_ILI93xx_template.h | 72 ++++ drivers/gdisp/ILI93xx/gdisp_lld.mk | 3 + drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c | 438 +++++++++++++++++++++++++ drivers/gdisp/ILI93xx/gdisp_lld_config.h | 22 ++ 4 files changed, 535 insertions(+) create mode 100644 drivers/gdisp/ILI93xx/board_ILI93xx_template.h create mode 100644 drivers/gdisp/ILI93xx/gdisp_lld.mk create mode 100644 drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c create mode 100644 drivers/gdisp/ILI93xx/gdisp_lld_config.h (limited to 'drivers') diff --git a/drivers/gdisp/ILI93xx/board_ILI93xx_template.h b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h new file mode 100644 index 00000000..18dbe653 --- /dev/null +++ b/drivers/gdisp/ILI93xx/board_ILI93xx_template.h @@ -0,0 +1,72 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GDISP_LLD_BOARD_H +#define GDISP_LLD_BOARD_H + +static inline void init_board(GDisplay *g) +{ + (void) g; +} + +static inline void post_init_board(GDisplay *g) +{ + (void) g; +} + +static inline void setpin_reset(GDisplay *g, bool_t state) +{ + (void) g; + (void) state; +} + +static inline void set_backlight(GDisplay *g, uint8_t percent) +{ + (void) g; + (void) percent; +} + +static inline void acquire_bus(GDisplay *g) +{ + (void) g; +} + +static inline void release_bus(GDisplay *g) +{ + (void) g; +} + +static inline void write_index(GDisplay *g, uint16_t index) +{ + (void) g; + (void) index; +} + +static inline void write_data(GDisplay *g, uint16_t data) +{ + (void) g; + (void) data; +} + +static inline void setreadmode(GDisplay *g) +{ + (void) g +} + +static inline void setwritemode(GDisplay *g) +{ + (void) g; +} + +static inline uint16_t read_data(GDisplay *g) +{ + (void) g; + + return 0; +} + +#endif /* GDISP_LLD_BOARD_H */ diff --git a/drivers/gdisp/ILI93xx/gdisp_lld.mk b/drivers/gdisp/ILI93xx/gdisp_lld.mk new file mode 100644 index 00000000..6c38e49a --- /dev/null +++ b/drivers/gdisp/ILI93xx/gdisp_lld.mk @@ -0,0 +1,3 @@ +GFXINC += $(GFXLIB) +GFXINC += $(GFXLIB)/drivers/gdisp/ILI93xx +GFXSRC += $(GFXLIB)/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c new file mode 100644 index 00000000..277d0aff --- /dev/null +++ b/drivers/gdisp/ILI93xx/gdisp_lld_ILI93xx.c @@ -0,0 +1,438 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GDISP /*|| defined(__DOXYGEN__)*/ + +/* This controller is only ever used with a 240 x 320 display */ +#if defined(GDISP_SCREEN_HEIGHT) + #warning "GDISP: This low level driver does not support setting a screen size. It is being ignored." + #undef GDISP_SCREEN_HEIGHT +#endif +#if defined(GDISP_SCREEN_WIDTH) + #warning "GDISP: This low level driver does not support setting a screen size. It is being ignored." + #undef GDISP_SCREEN_WIDTH +#endif + +#define GDISP_DRIVER_VMT GDISPVMT_ILI93xx +#include "drivers/gdisp/ILI93xx/gdisp_lld_config.h" +#include "src/gdisp/driver.h" + +#include "board_ILI93xx.h" + +/*===========================================================================*/ +/* Driver local definitions. */ +/*===========================================================================*/ + +#ifndef GDISP_SCREEN_HEIGHT + #define GDISP_SCREEN_HEIGHT 320 +#endif +#ifndef GDISP_SCREEN_WIDTH + #define GDISP_SCREEN_WIDTH 240 +#endif +#ifndef GDISP_INITIAL_CONTRAST + #define GDISP_INITIAL_CONTRAST 50 +#endif +#ifndef GDISP_INITIAL_BACKLIGHT + #define GDISP_INITIAL_BACKLIGHT 100 +#endif + +/*===========================================================================*/ +/* Driver local variables. */ +/*===========================================================================*/ + +/*===========================================================================*/ +/* Driver local functions. */ +/*===========================================================================*/ + +// Some common routines and macros +#define dummy_read(g) { volatile uint16_t dummy; dummy = read_data(g); (void) dummy; } +#define write_reg(g, reg, data) { write_index(g, reg); write_data(g, data); } + +static inline uint16_t read_reg(GDisplay *g, uint32_t reg) { + write_index(g, reg); + return read_data(g); + } + +static void set_cursor(GDisplay *g) { + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + write_reg(g, 0x20, g->p.x); + write_reg(g, 0x21, g->p.y); + break; + + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + write_reg(g, 0x20, g->p.y); + write_reg(g, 0x21, g->p.x); + break; + } + write_index(g, 0x22); +} + +static void set_viewport(GDisplay* g) { + switch(g->g.Orientation) { + default: + case GDISP_ROTATE_0: + case GDISP_ROTATE_180: + write_reg(g, 0x50, g->p.x); + write_reg(g, 0x51, g->p.x + g->p.cx - 1); + write_reg(g, 0x52, g->p.y); + write_reg(g, 0x53, g->p.y + g->p.cy - 1); + break; + + case GDISP_ROTATE_90: + case GDISP_ROTATE_270: + write_reg(g, 0x50, g->p.y); + write_reg(g, 0x51, g->p.y + g->p.cy - 1); + write_reg(g, 0x52, g->p.x); + write_reg(g, 0x53, g->p.x + g->p.cx - 1); + break; + } +} + + +LLDSPEC bool_t gdisp_lld_init(GDisplay *g) { + + unsigned short DeviceCode; + + // No private area for this controller + g->priv = 0; + + // Initialise the board interface + init_board(g); + + /* Hardware reset */ + setpin_reset(g, TRUE); + gfxSleepMilliseconds(1); + setpin_reset(g, FALSE); + gfxSleepMilliseconds(10); + setpin_reset(g, TRUE); + gfxSleepMilliseconds(50); + + acquire_bus(g); + setreadmode(g); + DeviceCode = read_reg(g, 0x00); + setwritemode(g); + + if( DeviceCode == 0x9320 || DeviceCode == 0x9300 ) + { + write_reg(g, 0x00, 0x0000); + write_reg(g, 0x01, 0x0100); /* Driver Output Contral */ + write_reg(g, 0x02, 0x0700); /* LCD Driver Waveform Contral */ + write_reg(g, 0x03, 0x1038); /* Set the scan mode */ + write_reg(g, 0x04, 0x0000); /* Scalling Contral */ + write_reg(g, 0x08, 0x0202); /* Display Contral 2 */ + write_reg(g, 0x09, 0x0000); /* Display Contral 3 */ + write_reg(g, 0x0a, 0x0000); /* Frame Cycle Contal */ + write_reg(g, 0x0c, (1<<0)); /* Extern Display Interface Contral 1 */ + write_reg(g, 0x0d, 0x0000); /* Frame Maker Position */ + write_reg(g, 0x0f, 0x0000); /* Extern Display Interface Contral 2 */ + gfxSleepMilliseconds(50); + write_reg(g, 0x07, 0x0101); /* Display Contral */ + gfxSleepMilliseconds(50); + write_reg(g, 0x10, (1<<12)|(0<<8)|(1<<7)|(1<<6)|(0<<4)); /* Power Control 1 */ + write_reg(g, 0x11, 0x0007); /* Power Control 2 */ + write_reg(g, 0x12, (1<<8)|(1<<4)|(0<<0)); /* Power Control 3 */ + write_reg(g, 0x13, 0x0b00); /* Power Control 4 */ + write_reg(g, 0x29, 0x0000); /* Power Control 7 */ + write_reg(g, 0x2b, (1<<14)|(1<<4)); + write_reg(g, 0x50, 0); /* Set X Start */ + write_reg(g, 0x51, 239); /* Set X End */ + write_reg(g, 0x52, 0); /* Set Y Start */ + write_reg(g, 0x53, 319); /* Set Y End */ + gfxSleepMilliseconds(50); + + write_reg(g, 0x60, 0x2700); /* Driver Output Control */ + write_reg(g, 0x61, 0x0001); /* Driver Output Control */ + write_reg(g, 0x6a, 0x0000); /* Vertical Srcoll Control */ + + write_reg(g, 0x80, 0x0000); /* Display Position? Partial Display 1 */ + write_reg(g, 0x81, 0x0000); /* RAM Address Start? Partial Display 1 */ + write_reg(g, 0x82, 0x0000); /* RAM Address End-Partial Display 1 */ + write_reg(g, 0x83, 0x0000); /* Displsy Position? Partial Display 2 */ + write_reg(g, 0x84, 0x0000); /* RAM Address Start? Partial Display 2 */ + write_reg(g, 0x85, 0x0000); /* RAM Address End? Partial Display 2 */ + + write_reg(g, 0x90, (0<<7)|(16<<0)); /* Frame Cycle Contral */ + write_reg(g, 0x92, 0x0000); /* Panel Interface Contral 2 */ + write_reg(g, 0x93, 0x0001); /* Panel Interface Contral 3 */ + write_reg(g, 0x95, 0x0110); /* Frame Cycle Contral */ + write_reg(g, 0x97, (0<<8)); + write_reg(g, 0x98, 0x0000); /* Frame Cycle Contral */ + write_reg(g, 0x07, 0x0133); + } + else if( DeviceCode == 0x9325 || DeviceCode == 0x9328) + { + + write_reg(g, 0x00e7, 0x0010); + write_reg(g, 0x0000, 0x0001); /* start internal osc */ + write_reg(g, 0x0001, 0x0100); + write_reg(g, 0x0002, 0x0700); /* power on sequence */ + write_reg(g, 0x0003, (1<<12)|(1<<5)|(1<<4)|(0<<3) ); /* importance */ + write_reg(g, 0x0004, 0x0000); + write_reg(g, 0x0008, 0x0207); + write_reg(g, 0x0009, 0x0000); + write_reg(g, 0x000a, 0x0000); /* display setting */ + write_reg(g, 0x000c, 0x0001); /* display setting */ + write_reg(g, 0x000d, 0x0000); + write_reg(g, 0x000f, 0x0000); + /* Power On sequence */ + write_reg(g, 0x0010, 0x0000); + write_reg(g, 0x0011, 0x0007); + write_reg(g, 0x0012, 0x0000); + write_reg(g, 0x0013, 0x0000); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0010, 0x1590); + write_reg(g, 0x0011, 0x0227); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0012, 0x009c); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0013, 0x1900); + write_reg(g, 0x0029, 0x0023); + write_reg(g, 0x002b, 0x000e); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0020, 0x0000); + write_reg(g, 0x0021, 0x0000); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0030, 0x0007); + write_reg(g, 0x0031, 0x0707); + write_reg(g, 0x0032, 0x0006); + write_reg(g, 0x0035, 0x0704); + write_reg(g, 0x0036, 0x1f04); + write_reg(g, 0x0037, 0x0004); + write_reg(g, 0x0038, 0x0000); + write_reg(g, 0x0039, 0x0706); + write_reg(g, 0x003c, 0x0701); + write_reg(g, 0x003d, 0x000f); + gfxSleepMilliseconds(50); /* delay 50 ms */ + write_reg(g, 0x0050, 0x0000); + write_reg(g, 0x0051, 0x00ef); + write_reg(g, 0x0052, 0x0000); + write_reg(g, 0x0053, 0x013f); + write_reg(g, 0x0060, 0xa700); + write_reg(g, 0x0061, 0x0001); + write_reg(g, 0x006a, 0x0000); + write_reg(g, 0x0080, 0x0000); + write_reg(g, 0x0081, 0x0000); + write_reg(g, 0x0082, 0x0000); + write_reg(g, 0x0083, 0x0000); + write_reg(g, 0x0084, 0x0000); + write_reg(g, 0x0085, 0x0000); + + write_reg(g, 0x0090, 0x0010); + write_reg(g, 0x0092, 0x0000); + write_reg(g, 0x0093, 0x0003); + write_reg(g, 0x0095, 0x0110); + write_reg(g, 0x0097, 0x0000); + write_reg(g, 0x0098, 0x0000); + /* display on sequence */ + write_reg(g, 0x0007, 0x0133); + + write_reg(g, 0x0020, 0x0000); + write_reg(g, 0x0021, 0x0000); + } + + gfxSleepMilliseconds(100); /* delay 50 ms */ + + + // Finish Init + post_init_board(g); + + // Release the bus + release_bus(g); + + // Turn on the backlight + set_backlight(g, GDISP_INITIAL_BACKLIGHT); + + /* Initialise the GDISP structure */ + g->g.Width = GDISP_SCREEN_WIDTH; + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Orientation = GDISP_ROTATE_0; + g->g.Powermode = powerOn; + g->g.Backlight = GDISP_INITIAL_BACKLIGHT; + g->g.Contrast = GDISP_INITIAL_CONTRAST; + + return TRUE; +} + +#if GDISP_HARDWARE_STREAM_WRITE + LLDSPEC void gdisp_lld_write_start(GDisplay *g) { + acquire_bus(g); + set_viewport(g); + } + LLDSPEC void gdisp_lld_write_color(GDisplay *g) { + write_data(g, gdispColor2Native(g->p.color)); + //write_data(g, COLOR2NATIVE(g->p.color)); + } + LLDSPEC void gdisp_lld_write_stop(GDisplay *g) { + release_bus(g); + } + LLDSPEC void gdisp_lld_write_pos(GDisplay *g) { + set_cursor(g); + } +#endif + +#if GDISP_HARDWARE_STREAM_READ + LLDSPEC void gdisp_lld_read_start(GDisplay *g) { + acquire_bus(g); + set_viewport(g); + set_cursor(g); + setreadmode(g); + dummy_read(g); + } + LLDSPEC color_t gdisp_lld_read_color(GDisplay *g) { + uint16_t data; + + data = read_data(g); + return gdispNative2Color(data); + } + LLDSPEC void gdisp_lld_read_stop(GDisplay *g) { + setwritemode(g); + release_bus(g); + } +#endif + +#if GDISP_NEED_CONTROL && GDISP_HARDWARE_CONTROL + LLDSPEC void gdisp_lld_control(GDisplay *g) { + switch(g->p.x) { + case GDISP_CONTROL_POWER: + if (g->g.Powermode == (powermode_t)g->p.ptr) + return; + switch((powermode_t)g->p.ptr) { + case powerOff: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); + write_reg(g, 0x10, 0x0000); + write_reg(g, 0x11, 0x0000); + write_reg(g, 0x12, 0x0000); + write_reg(g, 0x13, 0x0000); + release_bus(g); + set_backlight(g, 0); + break; + + case powerOn: + //*************Power On sequence ******************// + acquire_bus(g); + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], AP, DSTB, SLP, STB */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x17B0); /* SAP, BT[3:0], AP, DSTB, SLP, STB */ + write_reg(g, 0x11, 0x0147); /* DC1[2:0], DC0[2:0], VC[2:0] */ + gfxSleepMilliseconds(50); + write_reg(g, 0x12, 0x013C); /* VREG1OUT voltage */ + gfxSleepMilliseconds(50); + write_reg(g, 0x13, 0x0E00); /* VDV[4:0] for VCOM amplitude */ + write_reg(g, 0x29, 0x0009); /* VCM[4:0] for VCOMH */ + gfxSleepMilliseconds(50); + write_reg(g, 0x07, 0x0173); /* 262K color and display ON */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + case powerSleep: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); /* display OFF */ + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x0002); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + case powerDeepSleep: + acquire_bus(g); + write_reg(g, 0x07, 0x0000); /* display OFF */ + write_reg(g, 0x10, 0x0000); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + write_reg(g, 0x11, 0x0000); /* DC1[2:0], DC0[2:0], VC[2:0] */ + write_reg(g, 0x12, 0x0000); /* VREG1OUT voltage */ + write_reg(g, 0x13, 0x0000); /* VDV[4:0] for VCOM amplitude */ + gfxSleepMilliseconds(200); /* Dis-charge capacitor power voltage */ + write_reg(g, 0x10, 0x0004); /* SAP, BT[3:0], APE, AP, DSTB, SLP */ + release_bus(g); + set_backlight(g, g->g.Backlight); + break; + + default: + return; + } + g->g.Powermode = (powermode_t)g->p.ptr; + return; + + case GDISP_CONTROL_ORIENTATION: + if (g->g.Orientation == (orientation_t)g->p.ptr) + return; + switch((orientation_t)g->p.ptr) { + case GDISP_ROTATE_0: + acquire_bus(g); + write_reg(g, 0x01, 0x0100); + write_reg(g, 0x03, 0x1030); + write_reg(g, 0x60, 0xa700); + release_bus(g); + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + + case GDISP_ROTATE_90: + acquire_bus(g); + write_reg(g, 0x01, 0x0100); + write_reg(g, 0x03, 0x1038); + write_reg(g, 0x60, 0x2700); + release_bus(g); + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + + case GDISP_ROTATE_180: + acquire_bus(g); + write_reg(g, 0x01, 0x0000); + write_reg(g, 0x03, 0x1030); + write_reg(g, 0x60, 0x2700); + release_bus(g); + g->g.Height = GDISP_SCREEN_HEIGHT; + g->g.Width = GDISP_SCREEN_WIDTH; + break; + + case GDISP_ROTATE_270: + acquire_bus(g); + write_reg(g, 0x01, 0x0000); + write_reg(g, 0x03, 0x1038); + write_reg(g, 0x60, 0xa700); + release_bus(g); + g->g.Height = GDISP_SCREEN_WIDTH; + g->g.Width = GDISP_SCREEN_HEIGHT; + break; + + default: + return; + } + + g->g.Orientation = (orientation_t)g->p.ptr; + return; + + case GDISP_CONTROL_BACKLIGHT: + if ((unsigned)g->p.ptr > 100) + g->p.ptr = (void *)100; + set_backlight(g, (unsigned)g->p.ptr); + g->g.Backlight = (unsigned)g->p.ptr; + return; + + default: + return; + } + } +#endif + +#endif /* GFX_USE_GDISP */ diff --git a/drivers/gdisp/ILI93xx/gdisp_lld_config.h b/drivers/gdisp/ILI93xx/gdisp_lld_config.h new file mode 100644 index 00000000..0fd5ffac --- /dev/null +++ b/drivers/gdisp/ILI93xx/gdisp_lld_config.h @@ -0,0 +1,22 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GDISP_LLD_CONFIG_H +#define GDISP_LLD_CONFIG_H + +#if GFX_USE_GDISP + +#define GDISP_HARDWARE_STREAM_WRITE TRUE +#define GDISP_HARDWARE_STREAM_READ TRUE +#define GDISP_HARDWARE_STREAM_POS TRUE +#define GDISP_HARDWARE_CONTROL TRUE + +#define GDISP_LLD_PIXELFORMAT GDISP_PIXELFORMAT_RGB565 + +#endif /* GFX_USE_GDISP */ + +#endif /* _GDISP_LLD_CONFIG_H */ -- cgit v1.2.3 From 81c19da89f6055ee19ebcb7c5fc786bd82dadbe8 Mon Sep 17 00:00:00 2001 From: inmarket Date: Tue, 29 Apr 2014 16:35:57 +1000 Subject: First version vs1053 audio play driver. Compiles but not tested yet. --- drivers/gaudio/vs1053/driver.mk | 7 + drivers/gaudio/vs1053/gaudio_play_board_template.h | 71 +++++ drivers/gaudio/vs1053/gaudio_play_config.h | 29 ++ drivers/gaudio/vs1053/gaudio_play_lld.c | 348 +++++++++++++++++++++ drivers/gaudio/vs1053/readme.txt | 4 + drivers/gaudio/vs1053/vs1053.h | 101 ++++++ 6 files changed, 560 insertions(+) create mode 100644 drivers/gaudio/vs1053/driver.mk create mode 100644 drivers/gaudio/vs1053/gaudio_play_board_template.h create mode 100644 drivers/gaudio/vs1053/gaudio_play_config.h create mode 100644 drivers/gaudio/vs1053/gaudio_play_lld.c create mode 100644 drivers/gaudio/vs1053/readme.txt create mode 100644 drivers/gaudio/vs1053/vs1053.h (limited to 'drivers') diff --git a/drivers/gaudio/vs1053/driver.mk b/drivers/gaudio/vs1053/driver.mk new file mode 100644 index 00000000..d0419c80 --- /dev/null +++ b/drivers/gaudio/vs1053/driver.mk @@ -0,0 +1,7 @@ +# List the required driver. +GFXSRC += $(GFXLIB)/drivers/gaudio/vs1053/gaudio_play_lld.c + +# Required include directories +GFXINC += $(GFXLIB)/drivers/gaudio/vs1053 + +GFXDEFS += -DGFX_USE_GTIMER=TRUE diff --git a/drivers/gaudio/vs1053/gaudio_play_board_template.h b/drivers/gaudio/vs1053/gaudio_play_board_template.h new file mode 100644 index 00000000..d6125bbc --- /dev/null +++ b/drivers/gaudio/vs1053/gaudio_play_board_template.h @@ -0,0 +1,71 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GAUDIO_PLAY_BOARD_H +#define GAUDIO_PLAY_BOARD_H + +// Initialise the board +static void board_init(void) { + +} + +// Chip is initialised enough so we can talk fast to it +static void board_init_end(void) { + +} + +// Reset the board +static void board_reset(void) { + +} + +// Returns the state of the dreq pin +static bool board_dreq(void) { + +} + +// Start a command write +static void board_startcmdwrite(void) { + +} + +// End a command write +static void board_endcmdwrite(void) { + +} + +// Start a command read +static void board_startcmdread(void) { + +} + +// End a command read +static void board_endcmdread(void) { + +} + +// Start a data write +static void board_startdatawrite(void) { + +} + +// End a data write +static void board_enddatawrite(void) { + +} + +// Write data to the SPI port +static void board_spiwrite(const uint8_t *buf, unsigned len) { + +} + +// Read data from the SPI port +static void board_spiread(uint8_t *buf, unsigned len) { + +} + +#endif /* GAUDIO_PLAY_BOARD_H */ diff --git a/drivers/gaudio/vs1053/gaudio_play_config.h b/drivers/gaudio/vs1053/gaudio_play_config.h new file mode 100644 index 00000000..bd2af503 --- /dev/null +++ b/drivers/gaudio/vs1053/gaudio_play_config.h @@ -0,0 +1,29 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef GAUDIO_PLAY_CONFIG_H +#define GAUDIO_PLAY_CONFIG_H + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/*===========================================================================*/ +/* Driver hardware support. */ +/*===========================================================================*/ + +#define GAUDIO_PLAY_MAX_SAMPLE_FREQUENCY 48000 +#define GAUDIO_PLAY_NUM_FORMATS 2 +#define GAUDIO_PLAY_FORMAT1 ARRAY_DATA_16BITSIGNED +#define GAUDIO_PLAY_FORMAT2 ARRAY_DATA_8BITUNSIGNED +#define GAUDIO_PLAY_NUM_CHANNELS 2 +#define GAUDIO_PLAY_CHANNEL0_IS_STEREO FALSE +#define GAUDIO_PLAY_CHANNEL1_IS_STEREO TRUE +#define GAUDIO_PLAY_MONO 0 +#define GAUDIO_PLAY_STEREO 1 + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ + +#endif /* GAUDIO_PLAY_CONFIG_H */ diff --git a/drivers/gaudio/vs1053/gaudio_play_lld.c b/drivers/gaudio/vs1053/gaudio_play_lld.c new file mode 100644 index 00000000..9e77e383 --- /dev/null +++ b/drivers/gaudio/vs1053/gaudio_play_lld.c @@ -0,0 +1,348 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#include "gfx.h" + +#if GFX_USE_GAUDIO && GAUDIO_NEED_PLAY + +/* Include the driver defines */ +#include "src/gaudio/driver_play.h" + +/* Include the vs1053 registers */ +#include "drivers/gaudio/vs1053/vs1053.h" + +/* Include the board interface */ +#include "gaudio_play_board.h" + +// Override-able parameters +#ifndef VS1053_CLK + #define VS1053_CLK 12288000 +#endif +#ifndef VS1053_FIRMWARE_PATCH + #define VS1053_FIRMWARE_PATCH FALSE +#endif + +// Load the patch file if desired. New format patches only. +#if VS1053_FIRMWARE_PATCH + #define SKIP_PLUGIN_VARNAME + static const uint16_t plugin[] = { /* Compressed plugin */ + #include "vs1053_patch.plg" + }; +#endif + +// Set various stuff based on the clock +#if VS1053_CLK >= 16192000 + #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS|SM_CLK_RANGE) + #define VS1053_CLKI (VS1053_CLK/2) +#else + #define SCI_MODE_STARTUP (SCI_MODE_DEFAULTS) + #define VS1053_CLKI (VS1053_CLK) +#endif +#if VS1053_CLKI > 13000000 || VS1053_CLKI < 12000000 + #error "GAUDIO(vs1053): VS1053_CLK is out of range" +#endif +#if VS1053_CLKI == 12288000 + #define SC_FREQ_ADJUST 0x0000 +#else + #define SC_FREQ_ADJUST ((VS1053_CLKI-8000000)/4000) +#endif +#define VS1053_MAX_SAMPLE_RATE (VS1053_CLKI/256) +#if VS1053_CLKI > 1228800 + #define SC_CLOCK_MODE (SC_MULT_3|SC_ADD_1|SC_FREQ_ADJUST) +#else + #define SC_CLOCK_MODE (SC_MULT_3_5|SC_ADD_1|SC_FREQ_ADJUST) +#endif + +// Our static variables +static bool_t vs1053_isinit; +static GTimer playTimer; + +// Some common macro's +#define waitforready() while(!board_dreq()) gfxSleepMilliseconds(5) + +static void cmd_write(uint16_t addr, uint16_t data) { + char buf[4]; + buf[0] = 2; + buf[1] = (char)addr; + buf[2] = (char)(data >> 8); + buf[3] = (char)data; + + waitforready(); + board_startcmdwrite(); + board_spiwrite(buf, 4); + board_endcmdwrite(); +} + +#if VS1053_CLK > 12288000 + static inline void cmd_writenodreq(uint16_t addr, uint16_t data) { + uint8_t buf[4]; + + // This is the same as cmd_write() except for it doesn't wait for dreq first + buf[0] = 2; + buf[1] = (uint8_t)addr; + buf[2] = (uint8_t)(data >> 8); + buf[3] = (uint8_t)data; + + board_startcmdwrite(); + board_spiwrite(buf, 4); + board_endcmdwrite(); + } +#endif + +static uint16_t cmd_read(uint16_t addr) { + uint8_t buf[2]; + + buf[0] = 3; + buf[1] = (char)addr; + + board_startcmdread(); + board_spiwrite(buf, 2); + board_spiread(buf, 2); + board_endcmdread(); + return (((uint16_t)buf[0])<<8)|buf[1]; +} + +static void data_write(const uint8_t *data, unsigned len) { + board_startdatawrite(); + board_spiwrite(data, len); + board_enddatawrite(); +} + +#if VS1053_FIRMWARE_PATCH + static void LoadUserCode(void) { + int i; + uint16_t addr, n, val; + + for(i=0; i 12288000 + cmd_writenodreq(SCI_MODE, SCI_MODE_STARTUP); // Set super-clock before dreq + #endif + + // Set up registers + cmd_write(SCI_MODE, SCI_MODE_STARTUP); // Set mode + cmd_write(SCI_CLOCKF, SC_CLOCK_MODE); // Set clocks + board_init_end(); // Clocks are now set up + cmd_write(SCI_BASS, 0x0000); // No treble or bass boost + cmd_write(SCI_VOL, VOL_MAX); // Maximum volume + + // Load any firmware + #if VS1053_FIRMWARE_PATCH + LoadUserCode(); + + // Reset mode just in case + cmd_write(SCI_MODE, SCI_MODE_STARTUP); + #endif +} + +static void vs1053_soft_reset(void) { + cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_RESET); + gfxSleepMilliseconds(1); // Wait for at least 2uS + waitforready(); + + // Reload any firmware + #if VS1053_FIRMWARE_PATCH + LoadUserCode(); + + // Reset mode just in case + cmd_write(SCI_MODE, SCI_MODE_STARTUP); + #endif +} + +static uint16_t vs1053_getendbyte(void) { + cmd_write(SCI_WRAMADDR, WRAMADDR_EXTRAPARAMS+4); + return cmd_read(SCI_WRAM); +} + +static GTimer playTimer; +static GDataBuffer *pplay; +static size_t playlen; +static uint8_t *pdata; + +static void FeedData(void *param) { + unsigned len; + (void) param; + + // While there is data space + while (!board_dreq()) { + + // Send up to 32 bytes + len = playlen; + if (len > 32) len = 32; + data_write(pdata, len); + pdata += len; + playlen -= len; + + // Have we finished the buffer + while (!playlen) { + gfxSystemLock(); + gaudioPlayReleaseDataBlockI(pplay); + + // Get a new data buffer + if (!(pplay = gaudioPlayGetDataBlockI())) { + // We should really only do the play-done when the audio + // has really finished playing. Unfortunately there seems + // to be no documented way of determining this. + gaudioPlayDoneI(); + gfxSystemUnlock(); + gtimerStop(&playTimer); + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + } + } +} + +/*===========================================================================*/ +/* External declarations. */ +/*===========================================================================*/ + +bool_t gaudio_play_lld_init(uint16_t channel, uint32_t frequency, ArrayDataFormat format) { + uint32_t brate; + uint32_t bps; + uint8_t buf[4]; + static const uint8_t hdr1[] = { + 'R', 'I', 'F', 'F', + 0xFF, 0xFF, 0xFF, 0xFF, + 'W', 'A', 'V', 'E', + 'f', 'm', 't', ' ', + 16, 0, 0, 0, + 0x01, 0x00, + }; + static const uint8_t hdr2[] = { + 'd', 'a', 't', 'a', + 0xFF, 0xFF, 0xFF, 0xFF, + }; + + if (format != ARRAY_DATA_8BITUNSIGNED && format != ARRAY_DATA_16BITSIGNED) + return FALSE; + if (frequency > VS1053_MAX_SAMPLE_RATE) + return FALSE; + + // Reset the chip if needed + if (!vs1053_isinit) { + vs1053_hard_reset(); + vs1053_isinit = TRUE; + } + + // Setup + bps = (gfxSampleFormatBits(format)+7)/8; + if (channel == GAUDIO_PLAY_STEREO) + bps *= 2; + brate = frequency * bps; + + // Write the RIFF header + waitforready(); + data_write(hdr1, sizeof(hdr1)); + buf[0] = channel == GAUDIO_PLAY_STEREO ? 2 : 1; buf[1] = 0; data_write(buf, 2); + buf[0] = frequency; buf[1] = frequency>>8; buf[2] = frequency>>16; buf[3] = frequency>>24; data_write(buf, 4); + buf[0] = brate; buf[1] = brate>>8; buf[2] = brate>>16; buf[3] = brate>>24; data_write(buf, 4); + waitforready(); // 32 bytes max before checking + buf[0] = bps; buf[1] = 0; data_write(buf, 2); + buf[0] = gfxSampleFormatBits(format); buf[1] = 0; data_write(buf, 2); + data_write(hdr2, sizeof(hdr2)); + return TRUE; +} + +bool_t gaudio_play_lld_set_volume(uint8_t vol) { + // Volume is 0xFE -> 0x00. Adjust vol to match + vol = ~vol; + if (vol == 0xFF) vol = 0xFE; + + cmd_write(SCI_VOL, ((uint16_t)vol) << 8 | vol); + return TRUE; +} + +void gaudio_play_lld_start(void) { + + gfxSystemLock(); + // Get a new data buffer + if (pplay || !(pplay = gaudioPlayGetDataBlockI())) { + gfxSystemUnlock(); // Nothing to do + return; + } + + // Set up ready for the new buffer + playlen = pplay->len; + pdata = (uint8_t *)(pplay+1); + gfxSystemUnlock(); + + // Start the playing by starting the timer and executing FeedData immediately just to get things started + // We really should set the timer to be equivalent to half the available data but that is just too hard to calculate. + gtimerStart(&playTimer, FeedData, 0, TRUE, 5); + FeedData(0); +} + +void gaudio_play_lld_stop(void) { + uint8_t ch; + unsigned i; + + // Stop the timer interrupt + gtimerStop(&playTimer); + + // We may need to clean up the remaining buffer. + gfxSystemLock(); + if (pplay) { + gaudioPlayReleaseDataBlockI(pplay); + pplay = 0; + gaudioPlayDoneI(); + } + gfxSystemUnlock(); + + // Set CANCEL + cmd_write(SCI_MODE, cmd_read(SCI_MODE)|SM_CANCEL); + + // Write up to 2048 bytes of data + ch = 0; + for(i = 0; i < 2048; i++) { + if (!(i & 0x1F)) { + waitforready(); + if (!(cmd_read(SCI_MODE) & SM_CANCEL)) + break; + } + data_write(&ch, 1); + } + + // Make sure the cancel worked + waitforready(); + if ((cmd_read(SCI_MODE) & SM_CANCEL)) + vs1053_soft_reset(); + + // Send the terminating data + ch = vs1053_getendbyte(); + for(i = 0; i < 2052; i++) { + if (!(i & 0x1F)) + waitforready(); + data_write(&ch, 1); + } +} + +#endif /* GFX_USE_GAUDIO && GAUDIO_NEED_PLAY */ diff --git a/drivers/gaudio/vs1053/readme.txt b/drivers/gaudio/vs1053/readme.txt new file mode 100644 index 00000000..6e99e56f --- /dev/null +++ b/drivers/gaudio/vs1053/readme.txt @@ -0,0 +1,4 @@ +This chip supports playing in many formats including MP3 etc. +For this driver however we only support PCM in 8 bit unisgned and 16 bit signed formats. + +Requires GFX_USE_GTIMER \ No newline at end of file diff --git a/drivers/gaudio/vs1053/vs1053.h b/drivers/gaudio/vs1053/vs1053.h new file mode 100644 index 00000000..1ae613be --- /dev/null +++ b/drivers/gaudio/vs1053/vs1053.h @@ -0,0 +1,101 @@ +/* + * This file is subject to the terms of the GFX License. If a copy of + * the license was not distributed with this file, you can obtain one at: + * + * http://ugfx.org/license.html + */ + +#ifndef _VS1053_H +#define _VS1053_H + +// Registers +#define SCI_MODE 0x00 + #define SM_DIFF 0x0001 + #define SM_LAYER12 0x0002 + #define SM_RESET 0x0004 + #define SM_CANCEL 0x0008 + #define SM_EARSPEAKER_LO 0x0010 + #define SM_TESTS 0x0020 + #define SM_STREAM 0x0040 + #define SM_EARSPEAKER_HI 0x0080 + #define SM_DACT 0x0100 + #define SM_SDIORD 0x0200 + #define SM_SDISHARE 0x0400 + #define SM_SDINEW 0x0800 + #define SM_ADPCM 0x1000 + #define SM_LINE1 0x4000 + #define SM_CLK_RANGE 0x8000 + #define SCI_MODE_DEFAULTS (SM_LINE1|SM_SDINEW) +#define SCI_STATUS 0x01 + #define SS_DO_NOT_JUMP 0x8000 + #define SS_SWING_MASK 0x7000 + #define SS_SWING_SHIFT 12 + #define SS_VCM_OVERLOAD 0x0800 + #define SS_VCM_DISABLE 0x0400 + #define SS_VER_MASK 0x00F0 + #define SS_VER_SHIFT 4 + #define SS_APDOWN2 0x0008 + #define SS_APDOWN1 0x0004 + #define SS_SS_AD_CLOCK 0x0002 + #define SS_REFERENCE_SEL 0x0001 +#define SCI_BASS 0x02 + #define ST_AMPLITUDE_MASK 0xF000 + #define ST_AMPLITUDE_SHIFT 12 + #define ST_FREQLIMIT_MASK 0x0F00 + #define ST_FREQLIMIT_SHIFT 8 + #define SB_AMPLITUDE_MASK 0x00F0 + #define SB_AMPLITUDE_SHIFT 4 + #define SB_FREQLIMIT_MASK 0x000F + #define SB_FREQLIMIT_SHIFT 0 +#define SCI_CLOCKF 0x03 + #define SC_MULT_1 0x0000 + #define SC_MULT_2 0x2000 + #define SC_MULT_2_5 0x4000 + #define SC_MULT_3 0x6000 + #define SC_MULT_3_5 0x8000 + #define SC_MULT_4 0xa000 + #define SC_MULT_4_5 0xc000 + #define SC_MULT_5 0xe000 + #define SC_ADD_NONE 0x0000 + #define SC_ADD_1 0x0800 + #define SC_ADD_1_5 0x1000 + #define SC_ADD_2 0x1800 + #define SC_FREQ_MASK 0x07FF +#define SCI_DECODE_TIME 0x04 +#define SCI_AUDATA 0x05 + #define SR_RATE_MASK 0xFFFE + #define SR_IS_STEREO 0x0001 +#define SCI_WRAM 0x06 +#define SCI_WRAMADDR 0x07 + #define WRAMADDR_XDATA 0x1800 + #define WRAMADDR_YDATA 0x5800 + #define WRAMADDR_INSTR 0x8040 + #define WRAMADDR_IO 0xC000 + #define WRAMADDR_EXTRAPARAMS 0x1E02 +#define SCI_HDAT0 0x08 +#define SCI_HDAT1 0x09 + #define HD_FMT_NONE 0x0000 + #define HD_FMT_WAV 0x7665 + #define HD_FMT_AAC_ADTS 0x4154 + #define HD_FMT_AAC_ADIF 0x4144 + #define HD_FMT_AAC_M4A 0x4D34 + #define HD_FMT_WMA 0x574D + #define HD_FMT_MIDI 0x4D54 + #define HD_FMT_OGG 0x4F67 + #define HD_FMT_MP3_MIN 0xFFE0 + #define HD_FMT_MP3_MAX 0xFFFF +#define SCI_AIADDR 0x0A +#define SCI_VOL 0x0B + #define VOL_LEFT_MASK 0xFF00 + #define VOL_LEFT_SHIFT 8 + #define VOL_RIGHT_MASK 0x00FF + #define VOL_RIGHT_SHIFT 0 + #define VOL_POWERDOWN 0xFFFF + #define VOL_MAX 0x0000 + #define VOL_MIN 0xFEFE +#define SCI_AICTRL0 0x0C +#define SCI_AICTRL1 0x0D +#define SCI_AICTRL2 0x0E +#define SCI_AICTRL3 0x0F + +#endif /* _VS1053_H */ -- cgit v1.2.3