V.06 11/3

Dependencies:   FT6206 SDFileSystem SPI_TFT_ILI9341 TFT_fonts

Fork of ATT_AWS_IoT_demo by attiot

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers AddingDevice.h Source File

AddingDevice.h

00001 /*
00002 
00003 To add another device some functions/macros need to be defined.
00004 The Device folder shows examples of other devices.
00005 
00006 1. In MACROS.h the include to the macro file need to be added.
00007 
00008 2. A <NameOfYourFile.h> file needs to be added, it needs to include the ifdef(target) statement, and definitions for:
00009 MODSERIAL_IRQ_REG    ---   register which enables/disables serial IRQs
00010 DISABLE_TX_IRQ       ---   macro that disables TX IRQs
00011 DISABLE_RX_IRQ       ---   macro that disables RX IRQs
00012 ENABLE_TX_IRQ        ---   macro that enables TX IRQs
00013 ENABLE_RX_IRQ        ---   macro that enables RX IRQs
00014 
00015 RESET_TX_FIFO        ---   macro that resets TX FIFO buffer, if applicable. If not, something like while(1==0) won't do anything and doesn't generate compiler warnings
00016 RESET_RX_FIFO        ---   macro that resets RX FIFO buffer, if no hardware options, you can also read data until no more data is available
00017 
00018 MODSERIAL_READ_REG   ---   register where RX data is in
00019 MODSERIAL_WRITE_REG  ---   register where TX data is in (can be same as previous)
00020 MODSERIAL_READABLE   ---   returns true if new data is available in read_reg
00021 MODSERIAL_WRITABLE   ---   returns true if we may write new data in write_reg
00022 
00023 RX_IRQ_ENABLED       ---   checks if RX IRQs are enabled by MODSERIAL. Only required if the device has no registers that tell which IRQ fired. If those registers are available (LPCs have then), may just be 'true'
00024 TX_IRQ_ENABLED       ---   checks if TX IRQs are enabled by MODSERIAL. See previous
00025 
00026 3. A <NameOfYourFile.cpp> file needs to be added, it needs to include the ifdef(target) statement, and functions for:
00027 void setBase(void)   ---   function that sets _base pointer to point to correct UART, and _IRQ pointer to point to correct IRQ.
00028 
00029 void initDevice(void)---   function that allows for setting registers after everything else is initialized, if required
00030 
00031 bool txIsBusy(void)  ---   function that returns true as long as long as device isn't done with transmitting
00032 
00033 */
00034