![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Color Oled(SSD1331) connect to STMicroelectronics Nucleo-F466
mbed-os/targets/TARGET_Atmel/TARGET_SAM_CortexM4/drivers/supc/supc.h@3:f3764f852aa8, 2018-10-11 (annotated)
- Committer:
- kadonotakashi
- Date:
- Thu Oct 11 02:27:46 2018 +0000
- Revision:
- 3:f3764f852aa8
- Parent:
- 0:8fdf9a60065b
Nucreo 446 + SSD1331 test version;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
kadonotakashi | 0:8fdf9a60065b | 1 | /** |
kadonotakashi | 0:8fdf9a60065b | 2 | * \file |
kadonotakashi | 0:8fdf9a60065b | 3 | * |
kadonotakashi | 0:8fdf9a60065b | 4 | * \brief Supply Controller (SUPC) driver for SAM. |
kadonotakashi | 0:8fdf9a60065b | 5 | * |
kadonotakashi | 0:8fdf9a60065b | 6 | * Copyright (c) 2011-2015 Atmel Corporation. All rights reserved. |
kadonotakashi | 0:8fdf9a60065b | 7 | * |
kadonotakashi | 0:8fdf9a60065b | 8 | * \asf_license_start |
kadonotakashi | 0:8fdf9a60065b | 9 | * |
kadonotakashi | 0:8fdf9a60065b | 10 | * \page License |
kadonotakashi | 0:8fdf9a60065b | 11 | * |
kadonotakashi | 0:8fdf9a60065b | 12 | * Redistribution and use in source and binary forms, with or without |
kadonotakashi | 0:8fdf9a60065b | 13 | * modification, are permitted provided that the following conditions are met: |
kadonotakashi | 0:8fdf9a60065b | 14 | * |
kadonotakashi | 0:8fdf9a60065b | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
kadonotakashi | 0:8fdf9a60065b | 16 | * this list of conditions and the following disclaimer. |
kadonotakashi | 0:8fdf9a60065b | 17 | * |
kadonotakashi | 0:8fdf9a60065b | 18 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
kadonotakashi | 0:8fdf9a60065b | 19 | * this list of conditions and the following disclaimer in the documentation |
kadonotakashi | 0:8fdf9a60065b | 20 | * and/or other materials provided with the distribution. |
kadonotakashi | 0:8fdf9a60065b | 21 | * |
kadonotakashi | 0:8fdf9a60065b | 22 | * 3. The name of Atmel may not be used to endorse or promote products derived |
kadonotakashi | 0:8fdf9a60065b | 23 | * from this software without specific prior written permission. |
kadonotakashi | 0:8fdf9a60065b | 24 | * |
kadonotakashi | 0:8fdf9a60065b | 25 | * 4. This software may only be redistributed and used in connection with an |
kadonotakashi | 0:8fdf9a60065b | 26 | * Atmel microcontroller product. |
kadonotakashi | 0:8fdf9a60065b | 27 | * |
kadonotakashi | 0:8fdf9a60065b | 28 | * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED |
kadonotakashi | 0:8fdf9a60065b | 29 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
kadonotakashi | 0:8fdf9a60065b | 30 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE |
kadonotakashi | 0:8fdf9a60065b | 31 | * EXPRESSLY AND SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR |
kadonotakashi | 0:8fdf9a60065b | 32 | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
kadonotakashi | 0:8fdf9a60065b | 33 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
kadonotakashi | 0:8fdf9a60065b | 34 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
kadonotakashi | 0:8fdf9a60065b | 35 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, |
kadonotakashi | 0:8fdf9a60065b | 36 | * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
kadonotakashi | 0:8fdf9a60065b | 37 | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
kadonotakashi | 0:8fdf9a60065b | 38 | * POSSIBILITY OF SUCH DAMAGE. |
kadonotakashi | 0:8fdf9a60065b | 39 | * |
kadonotakashi | 0:8fdf9a60065b | 40 | * \asf_license_stop |
kadonotakashi | 0:8fdf9a60065b | 41 | * |
kadonotakashi | 0:8fdf9a60065b | 42 | */ |
kadonotakashi | 0:8fdf9a60065b | 43 | /* |
kadonotakashi | 0:8fdf9a60065b | 44 | * Support and FAQ: visit <a href="http://www.atmel.com/design-support/">Atmel Support</a> |
kadonotakashi | 0:8fdf9a60065b | 45 | */ |
kadonotakashi | 0:8fdf9a60065b | 46 | |
kadonotakashi | 0:8fdf9a60065b | 47 | #ifndef SUPC_H_INCLUDED |
kadonotakashi | 0:8fdf9a60065b | 48 | #define SUPC_H_INCLUDED |
kadonotakashi | 0:8fdf9a60065b | 49 | |
kadonotakashi | 0:8fdf9a60065b | 50 | #include "compiler.h" |
kadonotakashi | 0:8fdf9a60065b | 51 | |
kadonotakashi | 0:8fdf9a60065b | 52 | /// @cond 0 |
kadonotakashi | 0:8fdf9a60065b | 53 | /**INDENT-OFF**/ |
kadonotakashi | 0:8fdf9a60065b | 54 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 55 | extern "C" { |
kadonotakashi | 0:8fdf9a60065b | 56 | #endif |
kadonotakashi | 0:8fdf9a60065b | 57 | /**INDENT-ON**/ |
kadonotakashi | 0:8fdf9a60065b | 58 | /// @endcond |
kadonotakashi | 0:8fdf9a60065b | 59 | |
kadonotakashi | 0:8fdf9a60065b | 60 | /** Key used to write SUPC registers */ |
kadonotakashi | 0:8fdf9a60065b | 61 | #ifndef SUPC_CR_KEY_PASSWD |
kadonotakashi | 0:8fdf9a60065b | 62 | #define SUPC_CR_KEY_PASSWD SUPC_CR_KEY(0xA5U) |
kadonotakashi | 0:8fdf9a60065b | 63 | #endif |
kadonotakashi | 0:8fdf9a60065b | 64 | |
kadonotakashi | 0:8fdf9a60065b | 65 | #ifndef SUPC_MR_KEY_PASSWD |
kadonotakashi | 0:8fdf9a60065b | 66 | #define SUPC_MR_KEY_PASSWD SUPC_MR_KEY(0xA5U) |
kadonotakashi | 0:8fdf9a60065b | 67 | #endif |
kadonotakashi | 0:8fdf9a60065b | 68 | |
kadonotakashi | 0:8fdf9a60065b | 69 | #if (SAM4C || SAM4CP || SAM4CM) |
kadonotakashi | 0:8fdf9a60065b | 70 | /** Power Mode */ |
kadonotakashi | 0:8fdf9a60065b | 71 | enum slcdc_power_mode { |
kadonotakashi | 0:8fdf9a60065b | 72 | /** The internal supply source and the external supply source are both deselected. */ |
kadonotakashi | 0:8fdf9a60065b | 73 | SLCDC_POWER_MODE_LCDOFF = SUPC_MR_LCDMODE_LCDOFF, |
kadonotakashi | 0:8fdf9a60065b | 74 | /** The external supply source for LCD is selected */ |
kadonotakashi | 0:8fdf9a60065b | 75 | SLCDC_POWER_MODE_LCDON_EXTVR = SUPC_MR_LCDMODE_LCDON_EXTVR, |
kadonotakashi | 0:8fdf9a60065b | 76 | /** The internal supply source for LCD is selected */ |
kadonotakashi | 0:8fdf9a60065b | 77 | SLCDC_POWER_MODE_LCDON_INVR = SUPC_MR_LCDMODE_LCDON_INVR, |
kadonotakashi | 0:8fdf9a60065b | 78 | }; |
kadonotakashi | 0:8fdf9a60065b | 79 | #endif |
kadonotakashi | 0:8fdf9a60065b | 80 | |
kadonotakashi | 0:8fdf9a60065b | 81 | #if (!SAMG) |
kadonotakashi | 0:8fdf9a60065b | 82 | void supc_enable_backup_mode(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 83 | void supc_enable_voltage_regulator(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 84 | void supc_disable_voltage_regulator(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 85 | #endif |
kadonotakashi | 0:8fdf9a60065b | 86 | void supc_switch_sclk_to_32kxtal(Supc *p_supc, uint32_t ul_bypass); |
kadonotakashi | 0:8fdf9a60065b | 87 | void supc_enable_brownout_detector(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 88 | void supc_disable_brownout_detector(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 89 | void supc_enable_brownout_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 90 | void supc_disable_brownout_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 91 | void supc_set_monitor_threshold(Supc *p_supc, uint32_t ul_threshold); |
kadonotakashi | 0:8fdf9a60065b | 92 | void supc_set_monitor_sampling_period(Supc *p_supc, uint32_t ul_period); |
kadonotakashi | 0:8fdf9a60065b | 93 | void supc_enable_monitor_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 94 | void supc_disable_monitor_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 95 | void supc_enable_monitor_interrupt(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 96 | void supc_disable_monitor_interrupt(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 97 | #if (!(SAMG51 || SAMG53 || SAMG54)) |
kadonotakashi | 0:8fdf9a60065b | 98 | void supc_set_wakeup_mode(Supc *p_supc, uint32_t ul_mode); |
kadonotakashi | 0:8fdf9a60065b | 99 | void supc_set_wakeup_inputs(Supc *p_supc, uint32_t ul_inputs, |
kadonotakashi | 0:8fdf9a60065b | 100 | uint32_t ul_transition); |
kadonotakashi | 0:8fdf9a60065b | 101 | #endif |
kadonotakashi | 0:8fdf9a60065b | 102 | uint32_t supc_get_status(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 103 | #if (SAM4C || SAM4CP || SAM4CM) |
kadonotakashi | 0:8fdf9a60065b | 104 | void supc_enable_backup_power_on_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 105 | void supc_disable_backup_power_on_reset(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 106 | enum slcdc_power_mode supc_get_slcd_power_mode(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 107 | void supc_set_slcd_power_mode(Supc *p_supc, enum slcdc_power_mode mode); |
kadonotakashi | 0:8fdf9a60065b | 108 | void supc_set_slcd_vol(Supc *p_supc, uint32_t vol); |
kadonotakashi | 0:8fdf9a60065b | 109 | #endif |
kadonotakashi | 0:8fdf9a60065b | 110 | #if SAMG54 |
kadonotakashi | 0:8fdf9a60065b | 111 | void supc_set_regulator_trim_factory(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 112 | void supc_set_regulator_trim_user(Supc *p_supc, uint32_t value); |
kadonotakashi | 0:8fdf9a60065b | 113 | #endif |
kadonotakashi | 0:8fdf9a60065b | 114 | #if (SAMV70 || SAMV71 || SAME70 || SAMS70) |
kadonotakashi | 0:8fdf9a60065b | 115 | void supc_backup_sram_on(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 116 | void supc_backup_sram_off(Supc *p_supc); |
kadonotakashi | 0:8fdf9a60065b | 117 | #endif |
kadonotakashi | 0:8fdf9a60065b | 118 | |
kadonotakashi | 0:8fdf9a60065b | 119 | /// @cond 0 |
kadonotakashi | 0:8fdf9a60065b | 120 | /**INDENT-OFF**/ |
kadonotakashi | 0:8fdf9a60065b | 121 | #ifdef __cplusplus |
kadonotakashi | 0:8fdf9a60065b | 122 | } |
kadonotakashi | 0:8fdf9a60065b | 123 | #endif |
kadonotakashi | 0:8fdf9a60065b | 124 | /**INDENT-ON**/ |
kadonotakashi | 0:8fdf9a60065b | 125 | /// @endcond |
kadonotakashi | 0:8fdf9a60065b | 126 | |
kadonotakashi | 0:8fdf9a60065b | 127 | #endif /* SUPC_H_INCLUDED */ |