Skip to content
Snippets Groups Projects
Select Git revision
  • 2e00c2b35710d858814fb4162755e5bfea267fa1
  • master default protected
  • backslash
  • nickname-match-configs
  • genofire/leds_rgb_get_state
  • genofire/rockets-state
  • genofire/ble-follow-py
  • plaetzchen/ios-workaround
  • blinkisync-as-preload
  • genofire/haule-ble-fs-deactive
  • schneider/max30001-pycardium
  • schneider/max30001-epicaridum
  • schneider/max30001
  • schneider/stream-locks
  • ios-workarounds
  • schneider/fundamental-test
  • schneider/ble-buffers
  • schneider/maxim-sdk-update
  • ch3/splashscreen
  • koalo/bhi160-works-but-dirty
  • koalo/wip/i2c-for-python
  • v1.9
  • v1.8
  • v1.7
  • v1.6
  • v1.5
  • v1.4
  • v1.3
  • v1.2
  • v1.1
  • v1.0
  • release-1
  • bootloader-v1
  • v0.0
34 results

modules.h

Blame
  • Forked from card10 / firmware
    1482 commits behind, 2 commits ahead of the upstream repository.
    Rahix's avatar
    rahix authored
    Multiple tasks might access the i2c bus simultaneously.  To prevent
    race conditions, this patch introduces a lock which tasks should
    acquire before accessing the bus.
    
    Signed-off-by: default avatarRahix <rahix@rahix.de>
    2e00c2b3
    History
    modules.h 1.27 KiB
    #ifndef MODULES_H
    #define MODULES_H
    
    /* ---------- FAT fs ------------------------------------------------------ */
    /* Number of bits to use for indexing into our internal pool of files/directories
     * This indirectly specifies the size of the pool as 1^EPIC_FAT_FD_INDEX_BITS
     * Increase if number of open file descriptors is not enough, but be aware of
     * memory usage of the pool!
     */
    #define EPIC_FAT_FD_INDEX_BITS 8
    #define EPIC_FAT_STATIC_SEMAPHORE 1
    void fatfs_init(void);
    
    /* ---------- Serial ------------------------------------------------------- */
    #define SERIAL_READ_BUFFER_SIZE   128
    void vSerialTask(void *pvParameters);
    
    /* ---------- PMIC --------------------------------------------------------- */
    /* In 1/10s */
    #define PMIC_PRESS_SLEEP           20
    #define PMIC_PRESS_POWEROFF        40
    void vPmicTask(void *pvParameters);
    
    /* ---------- BHI160 ------------------------------------------------------- */
    #define BHI160_FIFO_SIZE             128
    #define BHI160_MUTEX_WAIT_MS          50
    void vBhi160Task(void *pvParameters);
    
    /* ---------- I2C ---------------------------------------------------------- */
    int i2c_init(void);
    int i2c_lock(void);
    void i2c_unlock(void);
    
    // Forces an unlock of the display. Only to be used in epicardium
    void disp_forcelock();
    #endif /* MODULES_H */