12345678910111213141516171819202122232425262728293031 |
- #ifndef _ADRS2040U_I2C_H
- #define _ADRS2040U_I2C_H 1
- #define DEBUG_PRINT(...) if(_DEBUG){printf(__VA_ARGS__);}
- #define _DEBUG 1
- // ADRS2040UのSPI GPIO
- #define SPI_MOSI 4
- #define SPI_SCK 2
- #define SPI_MISO 3
- #define SPI_CS 5
- // ADRS2040U I2Cアドレス
- #define I2C0_SLAVE_ADDR 0x41
- // I2Cで使うGPIO
- #define GPIO_SDA0 0
- #define GPIO_SCK0 1
- // I2Cレジスタ
- enum ADRS2040_CMD {
- ADRS2040_CMD_INVALID, // 無効
- ADRS2040_CMD_ADC_START, // ADCフリーラン開始
- ADRS2040_CMD_ADC_STOP, // ADCフリーラン停止
- ADRS2040_CMD_SET_RATE, // サンプリングレート設定
- ADRS2040_CMD_GET_COUNT, // バッファデータ数
- ADRS2040_CMD_GET_VALUE, // ADCデータ読み取り
- };
- #endif
|