GithubHelp home page GithubHelp logo

devegied / f030_wms_bmp_serial_i2c Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 465 KB

testing CubeMX, UART, I2C and Black Magic Probe with PIO on STM32F030

License: BSD 3-Clause "New" or "Revised" License

C 98.73% C++ 0.88% Makefile 0.14% Python 0.01% Assembly 0.24%
stm32 stm32f0 stm32f030 uart i2c i2c-slave

f030_wms_bmp_serial_i2c's Introduction

project for testing a lot of things with STM32F030:

  1. PlatformIO STM32 platform without framework (realy with CubeMX framework but PIO have outdated STM32F0 HAL/LL/CMSIS)
  2. CubeMX for initialization code generation
  3. STM32 UART serial communication with interrupts (single direction, only output)
  4. STM32 IC2 slave with interrupts, sequential streams and restarts
  5. Black magic probe (on BluePill) for uploading code/debuging/serial communication

I2C master for testing I2C implementation in STM32F030 with Arduino can be found here

for upload/debug/serial communication one needs to ajust Black Magic Probe serial ports in platformio.ini file (options upload_port, debug_port and monitor_port) and for quick reset task in .vscode/tasks.json file

Used STM32 HAL API
HAL_StatusTypeDef HAL_I2C_EnableListen_IT(I2C_HandleTypeDef *hi2c);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Transmit_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
HAL_StatusTypeDef HAL_I2C_Slave_Seq_Receive_IT(I2C_HandleTypeDef *hi2c, uint8_t *pData, uint16_t Size, uint32_t XferOptions);
void HAL_I2C_SlaveTxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_SlaveRxCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_ListenCpltCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_ErrorCallback(I2C_HandleTypeDef *hi2c);
void HAL_I2C_AddrCallback(I2C_HandleTypeDef *hi2c, uint8_t TransferDirection, uint16_t AddrMatchCode);

void HAL_Delay(uint32_t Delay);

void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin);
void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState);

__HAL_UART_DISABLE_IT(__HANDLE__, __INTERRUPT__)
__HAL_UART_ENABLE_IT(__HANDLE__, __INTERRUPT__)
__HAL_UART_GET_FLAG(__HANDLE__, __FLAG__)
__HAL_UART_GET_IT_SOURCE(__HANDLE__, __INTERRUPT__)

f030_wms_bmp_serial_i2c's People

Contributors

devegied avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.