mbed_library_study_meeting_v1.0.key

Similar documents
Java updated

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

Nios® II HAL API を使用したソフトウェア・サンプル集 「Modular Scatter-Gather DMA Core」

SystemC 2.0を用いた簡易CPUバスモデルの設計

CM-3G 周辺モジュール拡張技術文書 MS5607センサ(温度、気圧)

新・明解Java入門

ESP32-KEY-KIT-R1 (ESP-WROOM-32 ) Copyright c 2

: : : TSTank 2

Java演習(4) -- 変数と型 --

SystemC言語概論

Slide 1

Condition DAQ condition condition 2 3 XML key value

PowerPoint Presentation

WinHPC ppt

PBASIC 2.5 PBASIC 2.5 $PBASIC directive PIN type New DEBUG control characters DEBUGIN Line continuation for comma-delimited lists IF THEN ELSE * SELEC

PowerPoint プレゼンテーション

Java (5) 1 Lesson 3: x 2 +4x +5 f(x) =x 2 +4x +5 x f(10) x Java , 3.0,..., 10.0, 1.0, 2.0,... flow rate (m**3/s) "flow

Introduction Purpose This training course demonstrates the use of the High-performance Embedded Workshop (HEW), a key tool for developing software for

ESP8266-CORE-R Copyrig

MPI MPI MPI.NET C# MPI Version2


ex01.dvi

RHEA key

FlashAirの本_web.indd

K227 Java 2

joho07-1.ppt

Windows Web Windows Windows WinSock

/* do-while */ #include <stdio.h> #include <math.h> int main(void) double val1, val2, arith_mean, geo_mean; printf( \n ); do printf( ); scanf( %lf, &v

program.dvi

Ver.1 1/17/2003 2

3 Java 3.1 Hello World! Hello World public class HelloWorld { public static void main(string[] args) { System.out.println("Hello World");


double float

解きながら学ぶC++入門編

A B 1: Ex. MPICH-G2 C.f. NXProxy [Tanaka] 2:

CM-3G 周辺モジュール拡張技術文書 INA226センサ(電流、電圧、電力)

1 C STL(1) C C C libc C C C++ STL(Standard Template Library ) libc libc C++ C STL libc STL iostream Algorithm libc STL string vector l

CX-Checker CX-Checker (1)XPath (2)DOM (3) 3 XPath CX-Checker. MISRA-C 62%(79/127) SQMlint 76%(13/17) XPath CX-Checker 3. CX-Checker 4., MISRA-C CX- Ch

slide

Java 3 p.2 3 Java : boolean Graphics draw3drect fill3drect C int C OK while (1) int boolean switch case C Calendar java.util.calendar A

Smalltalk_

untitled

SCV in User Forum Japan 2003

2016 VOCALOID Group, Yamaha Corporation 2

Quartus II ハンドブック Volume 5、セクションIV. マルチプロセッサの調整

A/B (2018/06/08) Ver kurino/2018/soft/soft.html A/B

‚æ4›ñ

新版明解C言語 実践編

Lab GPIO_35 GPIO

Java学習教材

やさしいJavaプログラミング -Great Ideas for Java Programming サンプルPDF

para02-2.dvi

r07.dvi

JAXA key

ohp07.dvi

1) OOP 2) ( ) 3.2) printf Number3-2.cpp #include <stdio.h> class Number Number(); // ~Number(); // void setnumber(float n); float getnumber();

RubyKaigi2009 COBOL

C言語によるアルゴリズムとデータ構造

ARM Corporate Presentation

Arduino UNO IS Report No. Report Medical Information System Laboratory

untitled

1.ppt

ストラドプロシージャの呼び出し方

mbed-nucleo-f401re-offline-works

Applet java.lang.object java.awt.component java.awt.container java.awt.panel java.applet.applet

Local variable x y i paint public class Sample extends Applet { public void paint( Graphics gc ) { int x, y;... int i=10 ; while ( i < 100 ) {... i +=

MINI2440マニュアル

PowerPoint プレゼンテーション

RX600 & RX200シリーズ アプリケーションノート RX用仮想EEPROM


Java (9) 1 Lesson Java System.out.println() 1 Java API 1 Java Java 1

/ SCHEDULE /06/07(Tue) / Basic of Programming /06/09(Thu) / Fundamental structures /06/14(Tue) / Memory Management /06/1

ex01.dvi

超初心者用

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

main

2: 3: A, f, φ f(t = A sin(2πft + φ = A sin(ωt + φ ω 2πf 440Hz A ( ( 4 ( 5 f(t = sin(2πf 1t + sin(2πf 2 t = 2 sin(2πt(f 1 + f 2 /2 cos(2πt(f 1 f

thesis.dvi

haskell.gby

[ 1] 1 Hello World!! 1 #include <s t d i o. h> 2 3 int main ( ) { 4 5 p r i n t f ( H e l l o World!! \ n ) ; 6 7 return 0 ; 8 } 1:

18 C ( ) hello world.c 1 #include <stdio.h> 2 3 main() 4 { 5 printf("hello World\n"); 6 } [ ] [ ] #include <stdio.h> % cc hello_world.c %./a.o

untitled

HTML Java Tips dp8t-asm/java/tips/ Apache Tomcat Java if else f

class IntCell { private int value ; int getvalue() {return value; private IntCell next; IntCell next() {return next; IntCell(int value) {this.value =

ALG ppt

PC Windows 95, Windows 98, Windows NT, Windows 2000, MS-DOS, UNIX CPU

1: Preference Display 1 package sample. pref ; 2 3 import android. app. Activity ; 4 import android. content. Intent ; 5 import android. content. Shar

Java Java Java Java Java 4 p * *** ***** *** * Unix p a,b,c,d 100,200,250,500 a*b = a*b+c = a*b+c*d = (a+b)*(c+d) = 225

listings-ext

PowerPoint プレゼンテーション

Web 1 p.2 1 Servlet Servlet Web Web Web Apache Web Servlet JSP Web Apache Tomcat Jetty Apache Tomcat, Jetty Java JDK, Eclipse

2 ColorSpace DepthSpace CameraSpace Kinect V2 Kinect V2 BOdyIndex 3. NtKinect Kinect V2 C++ NtKinect [4] NtKinect = Kinect SDK + + STL(C++) + OpenCV +

Exam : 1z1-809-JPN Title : Java SE 8 Programmer II Vendor : Oracle Version : DEMO Get Latest & Valid 1z1-809-JPN Exam's Question and Answers 1 from Ac


Safari AppletViewer Web HTML Netscape Web Web 15-1 Applet Web Applet init Web paint Web start Web HTML stop destroy update init Web paint start Web up

Moji3 API


「Android Studioではじめる 簡単Androidアプリ開発」正誤表

Q&A集

untitled

Transcription:

mbed _mbed 2014 11 7 https://atnd.org/events/57766 version 1.0, 07-Nov.-2014 Tedd OKANO mbed - - 4.0 (^^; 1 mbed

TEDD OKANO https://twitter.com/tedd_okano 10 I 2 C http://developer.mbed.org/users/okano/ http://developer.mbed.org/users/nxpfan/ http://developer.mbed.org/users/nxp_ip/ 2

mbed mbed.org 3 mbed mbed.org mbed

#include "mbed.h" #include "SB1602E.h" SB1602E lcd( p28, p27 ); // SDA, SCL int main() { lcd.printf( 0, "Hello world!\r" ); lcd.printf( 1, "pi = %.6f\r", 3.14159265 ); http://developer.mbed.org/components/sb1602e/ 4 mbed-sdk(mbed )

mbed-sdk (mbed ) C/C++ Programs Runtime Platforms (Java ME Embedded,.NET MF, elua, etc) mbed Components Accelerometer, GPS, Wifi, Cellular, Compass,... mbed SDK Runtime, Memory Model, Peripheral APIs, STDIO, RTOS, Platform features MCU Vendor Driver Libraries Toolchain C libraries CMSIS-CORE RTOS http://developer.mbed.org/handbook/mbed-sdk http://developer.mbed.org/components/ 5 (GPIO ) (UART I2C..) ( )

/ http://developer.mbed.org/components/ 6

GUI http://developer.mbed.org/users/okano/notebook/how_to_make_library_and_components_jp/ 7

8

HelloWorld 9 HelloWorld

.. 10 ( )

11

http://developer.mbed.org/users/okano/notebook/lm75b-temperature-sensor-interface/ LM75B : I 2 C 12 2 I C LM75B LM75B mbed.org

13

http://developer.mbed.org/users/okano/code/test_lm75b_hello/ 14 mbed.org

Revisions (Revision History) Commit (Commit Changes) ( ) Format Code 15 mbed.org ( )

Revisions Switch.. 16 Rivision History (1) (2) Revisions (3) (4) Switch

#include "mbed.h" // LM75B I2C slave address #define ADDRESS_LM75B 0x90 // LM75B registers #define LM75B_Conf 0x01 #define LM75B_Temp 0x00 #define LM75B_Tos 0x03 #define LM75B_Thyst 0x02 I2C i2c( p28, p27 ); void init( void ); float read_temp( void ); int main() { init(); while(1) { printf( "temp = %7.3f\r\n", read_temp() ); wait( 1 ); read_temp() ( ) void init( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Conf; command[ 1 ] = 0x00; 0x90 0x01 0x00 i2c.write( ADDRESS_LM75B, command, 2 ); float read_temp( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Temp; 0x90 0x00 2 i2c.write( ADDRESS_LM75B, command, 1 ); // Send command string i2c.read( ADDRESS_LM75B, command, 2 ); // read two bytes data return ( (float)( (command[ 0 ] << 8) command[1] ) / 256.0 ); 17 mbed-sdk C I 2 C mbed-sdk API _Hello ( )

_Hello ( ) test_lm75b test_lm75b_hello LM75B test_lm75b ( ) 18

19 C++

20

.cpp.h 21.cpp.h.h.cpp main.cpp main ( )

.. / Export( ) / 22 New Library New FIle

#include "mbed.h" // LM75B I2C slave address #define ADDRESS_LM75B 0x90 // LM75B registers #define LM75B_Conf 0x01 #define LM75B_Temp 0x00 #define LM75B_Tos 0x03 #define LM75B_Thyst 0x02 I2C i2c( p28, p27 ); void init( void ); float read_temp( void ); int main() { init(); while(1) { printf( "temp = %7.3f\r\n", read_temp() ); wait( 1 ); void init( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Conf; command[ 1 ] = 0x00; i2c.write( ADDRESS_LM75B, command, 2 ); float read_temp( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Temp; main.cpp i2c.write( ADDRESS_LM75B, command, 1 ); // Send command string i2c.read( ADDRESS_LM75B, command, 2 ); // read two bytes data return ( (float)( (command[ 0 ] << 8) command[1] ) / 256.0 ); #include "mbed.h" #include "test_lm75b.h" test_lm75b temp( p28, p27 ); int main() #include "mbed.h" { while(1) { // LM75B I2C slave address printf( "temp = %7.3f\r\n", temp.read() #define ); ADDRESS_LM75B 0x90 wait( 1 ); #include "test_lm75b.h" test_lm75b::test_lm75b( PinName sda, PinName scl ) : i2c( sda, scl ) { init(); test_lm75b::~test_lm75b() { void test_lm75b::init( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Conf; command[ 1 ] = 0x00; i2c.write( ADDRESS_LM75B, command, 2 ); float test_lm75b::read( void ) { char command[ 2 ]; main.cpp // LM75B registers #define LM75B_Conf 0x01 #define LM75B_Temp 0x00 #define LM75B_Tos 0x03 #define LM75B_Thyst 0x02 test_lm75b.h class test_lm75b { public: test_lm75b( PinName sda, PinName scl ); ~test_lm75b(); void init( void ); float read( void ); private: I2C i2c; ; test_lm75b.cpp command[ 0 ] = LM75B_Temp; i2c.write( ADDRESS_LM75B, command, 1 ); // Send command string i2c.read( ADDRESS_LM75B, command, 2 ); // read two bytes data return ( (float)( (command[ 0 ] << 8) command[1] ) / 256.0 ); 23 3 main.cpp.h.cpp

#include "mbed.h" // LM75B I2C slave address #define ADDRESS_LM75B 0x90 test_lm75b.h // LM75B registers #define LM75B_Conf 0x01 #define LM75B_Temp 0x00 #define LM75B_Tos 0x03 #define LM75B_Thyst 0x02 class test_lm75b { public: test_lm75b( PinName sda, PinName scl ); ~test_lm75b(); void init( void ); float read( void ); private: I2C i2c; ; I 2 C #include "test_lm75b.h" test_lm75b::test_lm75b( PinName sda, PinName scl ) : i2c( sda, scl ) { init(); test_lm75b::~test_lm75b() { void test_lm75b::init( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Conf; command[ 1 ] = 0x00; i2c.write( ADDRESS_LM75B, command, 2 ); float test_lm75b::read( void ) { char command[ 2 ]; command[ 0 ] = LM75B_Temp; test_lm75b.cpp i2c.write( ADDRESS_LM75B, command, 1 ); // Send command string i2c.read( ADDRESS_LM75B, command, 2 ); // read two bytes data return ( (float)( (command[ 0 ] << 8) command[1] ) / 256.0 ); 24.h ( ) (public) (private).cpp init() read()

.. main() main() 25 I 2 C main ( )

26 C++

27

#include "mbed.h" // LM75B I2C slave address #define ADDRESS_LM75B 0x90 // LM75B registers #define LM75B_Conf 0x01 #define LM75B_Temp 0x00 #define LM75B_Tos 0x03 #define LM75B_Thyst 0x02 test_lm75b.h 3 0x90 class test_lm75b { public: test_lm75b( PinName sda, PinName scl, char address = ADDRESS_LM75B ); ~test_lm75b(); void init( void ); float read( void ); operator float( void ); private: I2C i2c; char adr; ; test_lm75b.cpp... test_lm75b::test_lm75b( PinName sda, PinName scl, char address ) : i2c( sda, scl ), adr( address ) { init();... 28

main.cpp #include "mbed.h" #include "test_lm75b.h" test_lm75b temp0( p28, p27, 0x90 ); test_lm75b temp1( p28, p27, 0x92 ); int main() { while(1) { printf( "temp0 = %7.3f\r\n", temp0.read() ); printf( "temp1 = %7.3f\r\n", temp1.read() ); wait( 1 ); =0x90 =0x92 29 2 0x90 0x92

I2C 30

#include "mbed.h" #include "test_lm75b.h" test_lm75b temp0( p28, p27, 0x90 ); test_lm75b temp1( p28, p27, 0x92 ); Q A 2 I2C mbed SDK int main() { while(1) { printf( "temp0 = %7.3f\r\n", temp0.read() ); printf( "temp1 = %7.3f\r\n", temp1.read() ); wait( 1 ); 31 (I2C ) mbed-sdk

test_lm75b test_lm75b I2C I2C 400kHz 100kHz (..) 32 2 ( I C)

test_lm75b test_lm75b I2C test_lm75b I2C 1 33

#include "mbed.h" #include "test_lm75b.h" test_lm75b tmp[] = { test_lm75b( p28, p27, 0x90 ), test_lm75b( p28, p27, 0x92 ), test_lm75b( p28, p27, 0x93 ), test_lm75b( p28, p27, 0x94 ), test_lm75b( p28, p27, 0x96 ), test_lm75b( p28, p27, 0x98 ), test_lm75b( p28, p27, 0x9A ), test_lm75b( p28, p27, 0x9C ) ; int main() { for ( int i = 0; i < 4; i++ ) { printf( "temp = %7.3f\r\n", (float)(tmp[ i ]) ); wait( 1 );.. #include "mbed.h" #include "test_lm75b.h" I2C i2c( p28, p27 ); test_lm75b tmp[] = { test_lm75b( i2c, 0x90 ), test_lm75b( i2c, 0x92 ), test_lm75b( i2c, 0x93 ), test_lm75b( i2c, 0x94 ), test_lm75b( i2c, 0x96 ), test_lm75b( i2c, 0x98 ), test_lm75b( i2c, 0x9A ), test_lm75b( i2c, 0x9C ) ; int main() { i2c.frequency( 10 * 1000 ); while(1) { for ( int i = 0; i < 4; i++ ) { printf( "temp = %7.3f\r\n, (float)(tmp[ i ]) ); wait( 1 ); I 2 C 34.. ( )..

#include "mbed.h" #include "test_lm75b.h" I2C i2c( p28, p27 ); test_lm75b temp( i2c ); int main() { float t; i2c.frequency( 400 * 1000 ); while(1) { t = temp; printf( "temp = %7.3f\r\n", t ); wait( 1 ); main.cpp 35 I2C main

I2C i2c( p28, p27 ); test_lm75b temp( i2c ); int main() { float t; i2c.frequency( 400 * 1000 ); while(1) { t = temp; printf( "temp = %7.3f\r\n", t ); wait( 1 ); main.cpp class test_lm75b { public: test_lm75b( I2C i2c_obj, char address = ADDRESS_LM75B ); ~test_lm75b(); void init( void ); float read( void ); operator float( void ); private: I2C i2c; char adr; ; test_lm75b.h #include "test_lm75b.h" test_lm75b::test_lm75b( I2C i2c_obj, char address ) : i2c( i2c_obj ), adr( address ) { init(); test_lm75b.cpp 36

orz 400kHz 100kHz 37 I2C orz

test_lm75b test_lm75b I2C I2C I2C orz 38

I2C i2c( p28, p27 ); test_lm75b temp( i2c ); int main() { float t; i2c.frequency( 400 * 1000 ); while(1) { t = temp; printf( "temp = %7.3f\r\n", t ); wait( 1 ); main.cpp class test_lm75b { public: test_lm75b( I2C i2c_obj, char address = ADDRESS_LM75B ); ~test_lm75b(); void init( void ); float read( void ); operator float( void ); private: I2C i2c; char adr; ; test_lm75b.h #include "test_lm75b.h" test_lm75b::test_lm75b( I2C i2c_obj, char address ) : i2c( i2c_obj ), adr( address ) { init(); test_lm75b.cpp test_lm75b I2C m( )m 39 10

40

I2C i2c( p28, p27 ); test_lm75b temp( i2c ); int main() { float t; i2c.frequency( 400 * 1000 ); while(1) { t = temp; printf( "temp = %7.3f\r\n", t ); wait( 1 ); main.cpp class test_lm75b { public: test_lm75b( I2C &i2c_obj, char address = ADDRESS_LM75B ); ~test_lm75b(); void init( void ); float read( void ); operator float( void ); private: I2C &i2c; char adr; ; test_lm75b.h #include "test_lm75b.h" test_lm75b::test_lm75b( I2C &i2c_obj, char address ) : i2c( i2c_obj ), adr( address ) { init(); test_lm75b.cpp I2C 41 main I2C I2C

100kHz 400kHz 42

43

2 I2C C++ (^^) 44 2

I2C I2C I2C I2C I2C 45

... class test_lm75b { public: test_lm75b( PinName sda, PinName scl, char address = ADDRESS_LM75B ); test_lm75b( I2C &i2c_obj, char address = ADDRESS_LM75B ); ~test_lm75b(); void init( void ); float read( void ); operator float( void ); private: I2C *i2c_p; I2C &i2c; char adr; ; I2C test_lm75b.h 2... test_lm75b::test_lm75b( PinName sda, PinName scl, char address ) { : i2c_p( new I2C( sda, scl ) ), i2c( *i2c_p ), adr( address ) init(); test_lm75b::test_lm75b( I2C &i2c_obj, char address ) : i2c_p( NULL ), i2c( i2c_obj ), adr( address ) { init(); test_lm75b::~test_lm75b() { if ( NULL!= i2c_p ) delete i2c_p;... I2C test_lm75b.cpp I2C I2C I2C 46 ( C++..) I2C i2c_p I2C i2c_p NULL I2C i2c_p!= NULL i2c_p == NULL

#include "mbed.h" #include "test_lm75b.h" test_lm75b temp0( p28, p27 ); I2C i2c( p28, p27 ); test_lm75b temp1( i2c ); int main() { float t0; float t1; i2c.frequency( 400 * 1000 ); while(1) { t0 = temp0; t1 = temp1; printf( "temp = %7.3f, %7.3f\r\n", t0, t1 ); wait( 1 ); main.cpp 47 temp0 I2C 100kHz temp1 400kHz

48..

49

API.h Doxygen 50 mbed.org.h Doxygen

51 Doxygen API

/** */ @ @ * * i2c.frequency( 400 * 1000 ); * while(1) { * t0 = temp0; * t1 = temp1; * printf( "temp = %7.3f, %7.3f\r\n", t0, t1 ); * wait( 1 ); * * * @endcode */ class test_lm75b { public: /** Create a test_lm75b instance connected to specified I2C pins with specified address * * @param sda I2C-bus SDA pin * @param scl I2C-bus SCL pin * @param address (option) I2C-bus slave address (default: 0x90) */ test_lm75b( PinName sda, PinName scl, char address = ADDRESS_LM75B ); /** Create a test_lm75b instance connected to specified I2C pins with specified address * * @param i2c_obj I2C object (instance) * @param address (option) I2C-bus slave address (default: 0x90) */ test_lm75b( I2C &i2c_obj, char address = ADDRESS_LM75B ); /** Destractor */ ~test_lm75b(); /** Initialization */ void init( void ); /** Read temperature * * @return value of degree Celsius (in float) */ float read( void ); /** Read temperature * * @return the object returns the read value */ operator float( void ); private: I2C *i2c_p; I2C &i2c; char adr; ; 52

DOXYGEN https://developer.mbed.org/handbook/api-documentation 53 URL ( (.h #define ) )

54

/ OK 55

/ ( ) 56 / OK Public (Unlisted) URL Apache2

57

CQ http://developer.mbed.org/teams/cq-publishing/code/marmex_vb_hello/ Apache2 58 ( (History ) )

59

Wiki Wiki Wiki 60 / Edit repository homepage Wiki

http://developer.mbed.org/cookbook/wiki-syntax Wiki Editing tips Full Wiki syntax Preview Wiki HTML web 61 Editing tips Wiki Full Wiki Syntax

Wiki Q&A 62 Wiki mbed.org Q&A.. Wiki

63 mbed Cookbook mbed

Add a component HelloWorld 64 (HelloWorld ) Add a component

URL URL Wiki 65

Tested platforms 66 Tested platforms mbed

( ) Hello Hello 67

68

.. Pull ( ) 69..

(1) MARY-VB 70

SPI MARY-VB MARY-VB MARY-OB MARY-OB 9 / MARY-VB 8 / SPI 71 MARMEX-VB OLED SPI 8 OLED 9

MARMEX-OB MARMEX-VB SPI SPI MARMEX_OB_oled( PinName mosi, PinName sclk, PinName cs, PinName rst, PinName power_pin ) : NokiaLCD( mosi, sclk, cs, rst, NokiaLCD::LCD6100 ), _power_pin( power_pin ) {... _spi.format( 9 ); _spi.frequency( SPI_FREQUENCY );... 9 / MARMEX_VB::MARMEX_VB( PinName SPI_mosi, PinName SPI_miso, PinName SPI_sck, PinName SPI_cs, PinName cam_reset, PinName I2C_sda, PinName I2C_scl ) : _spi( SPI_mosi, SPI_miso, SPI_sck ), _cs( SPI_cs ), _reset( cam_reset ), _i2c( I2C_sda, I2C_scl ) {... _spi.format( 8 ); _spi.frequency( SPI_FREQUENCY );... _spi.write() 9 / 8 / 8 / 72 OLED ( ) SPI SDK

SPI SPI disply_spi( p5, p6, p7 ); SPI camera_spi( p5, p6, p7); DigitalOut disply_cs( p20 ); DigitalOut camera_cs( p22 );... disply_spi.format( 9 ); camera_spi.format( 8 );... disply_cs = 0; disply_spi.write( data_for_disply ); disply_cs = 1;... camera_cs = 0; camera_spi.write( data_for_camera ); camera_cs = 1;... MARMEX-VB SDK 73 SPI 2 write

9 8 http://developer.mbed.org/users/okano/code/multiple_instance_for_spi/ 74

app I2C instance processor MCU I 2 C master I 2 C slave I 2 C slave I 2 C bus I 2 C slave app SPI instance SPI instance SPI processor MCU SPI master SPI slave SPI slave SPI bus 75 1 1 1

(2) ( ) 76 /

MARMEX-VB CQ https://developer.mbed.org/users/okano/code/mary_camera_hello/graph http://developer.mbed.org/teams/cq-publishing/code/marmex_vb_test/graph 77

(^^; ISP http://developer.mbed.org/users/okano/code/ika_shouyu_poppoyaki/graph 78

(3) mbed LPC1768 (mbed ) (^^; ARM 79 mbed (mbed LPC1768)

(4) 80 mbed (mbed LPC1768)

40pin LPCXpresso Arduino.. 81 40pin LPCXpresso Arduino..

.. LPCXpresso mbed 82 LPCXpresso mbed

(5) (MCU ) 83 mbed MCU MCU mbed-sdk MCU

#if ( LINE_READ_OPT == USING_SSP_FIFO ) #define FIFO_DEPTH 4 #if defined( SSP_AUTO_SELECTION ) #if defined( TARGET_MBED_LPC1768 ) #define SPI_PORT_SELECTOR LPC_SSP1 #elif defined( TARGET_LPC11U35_501 ) defined( TARGET_LPC11U24_401 ) #define SPI_PORT_SELECTOR LPC_SSP0 #endif #elif defined( SSP_USE_SSP0 ) #define SPI_PORT_SELECTOR LPC_SSP0 #elif defined( SSP_USE_SSP1 ) #define SPI_PORT_SELECTOR LPC_SSP1 #else #error when using FIFO option for the optimization, choose one of definition SSP_USE_SSP0.. #endif // #if defined( SSP_AUTO_SELECTION ) char reg = COMMAND_READ CAMERA_DATA_REGISTER COMMAND_ADDR_INCREMENT; int n; if ( _read_order_change ) { _cs = 0; for(n = FIFO_DEPTH; n > 0; n--) { SPI_PORT_SELECTOR->DR = reg; do { while (!(SPI_PORT_SELECTOR->SR & 0x4)); *p = (SPI_PORT_SELECTOR->DR & 0xFF); if (n++ < (n_of_pixels << 1) - FIFO_DEPTH) SPI_PORT_SELECTOR->DR = reg; CMSIS ( ) while (!(SPI_PORT_SELECTOR->SR & 0x4)); *p++ = (SPI_PORT_SELECTOR->DR << 8); if (n++ < (n_of_pixels << 1) - FIFO_DEPTH) SPI_PORT_SELECTOR->DR = reg; while(n < (n_of_pixels << 1)); _cs = 1; http://developer.mbed.org/teams/cq-publishing/code/marmex_vb/file/84e6c89a9a6d/marmex_vb.cpp 84.. mbed

(6) 85..

http://developer.mbed.org/users/okano/code/ika_shouyu_poppoyaki/graph 86 Yamamoto \(^^)/

87 /

Review Close 88

(7) 89 mbed.org mbed.org Twitter

(8) https://developer.mbed.org/users/shintamainjp/ 90 mbed.org C++ (^^)

(9) mbed-sdk 91 mbed-sdk

http://developer.mbed.org/users/mbed_official/code/mbed-src/ https://github.com/mbedmicro/mbed 92 mbed.org mbed-sdk Github