mirror of
https://github.com/eddyem/STM8_samples.git
synced 2026-03-22 01:31:00 +03:00
Added software I2C on timer TIM2
This commit is contained in:
46
si7005_softi2c/ports_definition.h
Normal file
46
si7005_softi2c/ports_definition.h
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
* ports_definition.h - definition of ports pins & so on
|
||||
*
|
||||
* Copyright 2014 Edward V. Emelianov <eddy@sao.ru, edward.emelianoff@gmail.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||||
* MA 02110-1301, USA.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#ifndef __PORTS_DEFINITION_H__
|
||||
#define __PORTS_DEFINITION_H__
|
||||
|
||||
#include "stm8l.h"
|
||||
|
||||
// macro for using in port constructions like PORT(LED_PORT, ODR) = xx
|
||||
#define CONCAT(a, b) a ## _ ## b
|
||||
#define PORT(a, b) CONCAT(a , b)
|
||||
|
||||
// on-board LED
|
||||
#define LED_PORT PC
|
||||
#define LED_PIN GPIO_PIN2
|
||||
|
||||
// UART2_TX
|
||||
#define UART_PORT PD
|
||||
#define UART_TX_PIN GPIO_PIN5
|
||||
|
||||
//soft I2C
|
||||
#define I2C_SDA_PORT PB
|
||||
#define I2C_SDA_PIN GPIO_PIN4
|
||||
#define I2C_SCL_PORT PB
|
||||
#define I2C_SCL_PIN GPIO_PIN5
|
||||
|
||||
#endif // __PORTS_DEFINITION_H__
|
||||
Reference in New Issue
Block a user