LoginSignup
0
0

(レジ直)StampS3の5番、Lチカで遊ぶ。(キャスト)

Posted at

目的
GPIOレジスターに直接出力する。
カラー液晶駆動の為に5番をLチカする。

o_coq028.jpg




//reg_di_gpio5_M5S3_2


//定義
#define GPIO_0to31SET_REG   *((volatile unsigned long *)GPIO_OUT_W1TS_REG)
#define GPIO_0to31CLR_REG   *((volatile unsigned long *)GPIO_OUT_W1TC_REG)


//初期化
void setup() {

  //GPIOの初期化
  pinMode(5, OUTPUT);
  
}//setup


//メインループ
void loop() {
  
  //digitalWrite(5, HIGH);
  GPIO_0to31SET_REG = GPIO_0to31SET_REG | (1<<5);
  delay(1000);
  
  //digitalWrite(5, LOW);
  GPIO_0to31CLR_REG = GPIO_0to31CLR_REG | (1<<5);
  delay(1000);
  
}//loop



0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0