Skip to content
Igor Usenko edited this page Dec 28, 2021 · 25 revisions

Introduction

There are two API layers

  1. Watch API (lower level)
  2. System API (higher level)

Each subsystem of the watch should be used only by their API.
APIs are mapped according to how the watch library does it (for example getTouch, for some reason, inside the Watch API). For thread safety, all watch APIs can be used only after taking watchMutex. One exclusion - call to log.
API is just a call mapping. Some default values are possible. No logic in API, because there is no simple way to test it here.

API list

Watch APIs

  • Power
  • RTC
  • Watch
  • TFT
  • BMA
  • Motor
  • I2S

System APIs

  • System
  • Sound

header file

name is equals to API name
no watch or freertos specific here. we should be able to use it in the native env
standard C types only
declares all the needed typedefs for API functions
declares the struct <ApiName>Api with all available API functions
declares all the needed data structs
declares default factory function for the API

source file

name is equals to API name

test mock

implement minimal behavior. specific behavior can be implemented inside a test.

Clone this wiki locally