Frank Duignan
/
NRF52832_ili9341
Basic driver working
main.cpp
- Committer:
- f3d
- Date:
- 2021-02-01
- Revision:
- 79:a022f7789a49
- Parent:
- 77:9140e10d79ee
- Child:
- 80:ff42f77928ad
File content as of revision 79:a022f7789a49:
/* SDT-example-blinky * * Copyright (c) 2018 Sigma Delta Technologies Inc. * * MIT License * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation * files (the "Software"), to deal in the Software without * restriction, including without limitation the rights to use, * copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following * conditions: * * The above copyright notice and this permission notice shall be * included in all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR * OTHER DEALINGS IN THE SOFTWARE. */ #include "mbed.h" /* Serial */ #define BAUDRATE 9600 Serial g_Serial_pc(P0_18, P0_14, BAUDRATE); /* DigitalOut */ #define LED_ON 0 #define LED_OFF 1 //DigitalOut g_DO_LedRed(LED_RED, LED_OFF); //DigitalOut g_DO_LedGreen(LED_GREEN, LED_OFF); //DigitalOut g_DO_LedBlue(LED_BLUE, LED_OFF); DigitalOut g_DO_LedBlue(A5, LED_OFF); //mosi,miso,clk,ss SPI spi(P0_25,P0_26,P0_27,P0_28); DigitalOut Rst(P0_21); DigitalOut DC(P0_20); int main(void) { spi.format(8, 3); spi.frequency(1000000); while(true) { //g_Serial_pc.printf("LED Toggle\r\n"); spi.write(0xa5); g_DO_LedBlue = !g_DO_LedBlue; wait(0.1); // 1sec } return 0; }